2020-03-18 17:24:33 +08:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <ctype.h>
|
|
|
|
|
#include "FlowcontrolApiserverAPI.h"
|
|
|
|
|
|
2020-06-20 09:41:15 +08:00
|
|
|
#define MAX_NUMBER_LENGTH 16
|
2020-03-18 17:24:33 +08:00
|
|
|
#define MAX_BUFFER_LENGTH 4096
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// get information of a group
|
|
|
|
|
//
|
|
|
|
|
v1_api_group_t*
|
2025-02-11 19:36:46 +00:00
|
|
|
FlowcontrolApiserverAPI_getAPIGroup(apiClient_t *apiClient)
|
2020-03-18 17:24:33 +08:00
|
|
|
{
|
|
|
|
|
list_t *localVarQueryParameters = NULL;
|
|
|
|
|
list_t *localVarHeaderParameters = NULL;
|
|
|
|
|
list_t *localVarFormParameters = NULL;
|
2022-03-09 10:56:53 +08:00
|
|
|
list_t *localVarHeaderType = list_createList();
|
2020-03-18 17:24:33 +08:00
|
|
|
list_t *localVarContentType = NULL;
|
|
|
|
|
char *localVarBodyParameters = NULL;
|
2025-02-11 19:36:46 +00:00
|
|
|
size_t localVarBodyLength = 0;
|
|
|
|
|
|
|
|
|
|
// clear the error code from the previous api call
|
|
|
|
|
apiClient->response_code = 0;
|
2020-03-18 17:24:33 +08:00
|
|
|
|
|
|
|
|
// create the path
|
2025-02-11 19:36:46 +00:00
|
|
|
char *localVarPath = strdup("/apis/flowcontrol.apiserver.k8s.io/");
|
|
|
|
|
|
2020-03-18 17:24:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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,
|
2025-02-11 19:36:46 +00:00
|
|
|
localVarBodyLength,
|
2020-03-18 17:24:33 +08:00
|
|
|
"GET");
|
|
|
|
|
|
2022-04-12 21:14:09 +08:00
|
|
|
// uncomment below to 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");
|
|
|
|
|
//}
|
2020-03-18 17:24:33 +08:00
|
|
|
//nonprimitive not container
|
2025-02-11 19:36:46 +00:00
|
|
|
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;
|
|
|
|
|
}
|
2020-03-18 17:24:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//return type
|
|
|
|
|
if (apiClient->dataReceived) {
|
|
|
|
|
free(apiClient->dataReceived);
|
2020-06-20 09:41:15 +08:00
|
|
|
apiClient->dataReceived = NULL;
|
|
|
|
|
apiClient->dataReceivedLen = 0;
|
2020-03-18 17:24:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-09 10:56:53 +08:00
|
|
|
list_freeList(localVarHeaderType);
|
2020-03-18 17:24:33 +08:00
|
|
|
|
|
|
|
|
free(localVarPath);
|
|
|
|
|
return elementToReturn;
|
|
|
|
|
end:
|
2020-09-02 14:25:31 -07:00
|
|
|
free(localVarPath);
|
2020-03-18 17:24:33 +08:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|