Automated openapi generation from release-1.26
Signed-off-by: Kubernetes Prow Robot <k8s.ci.robot@gmail.com>
This commit is contained in:
81
kubernetes/api/ResourceAPI.c
Normal file
81
kubernetes/api/ResourceAPI.c
Normal file
@@ -0,0 +1,81 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#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)
|
||||
|
||||
|
||||
// get information of a group
|
||||
//
|
||||
v1_api_group_t*
|
||||
ResourceAPI_getAPIGroup(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/")+1;
|
||||
char *localVarPath = malloc(sizeOfPath);
|
||||
snprintf(localVarPath, sizeOfPath, "/apis/resource.k8s.io/");
|
||||
|
||||
|
||||
|
||||
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 *ResourceAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived);
|
||||
v1_api_group_t *elementToReturn = v1_api_group_parseFromJSON(ResourceAPIlocalVarJSON);
|
||||
cJSON_Delete(ResourceAPIlocalVarJSON);
|
||||
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;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user