2020-03-18 17:24:33 +08:00
|
|
|
/*
|
|
|
|
|
* v1_job_spec.h
|
|
|
|
|
*
|
|
|
|
|
* JobSpec describes how the job execution will look like.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef _v1_job_spec_H_
|
|
|
|
|
#define _v1_job_spec_H_
|
|
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include "../external/cJSON.h"
|
|
|
|
|
#include "../include/list.h"
|
|
|
|
|
#include "../include/keyValuePair.h"
|
2020-06-20 09:41:15 +08:00
|
|
|
#include "../include/binary.h"
|
|
|
|
|
|
|
|
|
|
typedef struct v1_job_spec_t v1_job_spec_t;
|
|
|
|
|
|
2020-03-18 17:24:33 +08:00
|
|
|
#include "v1_label_selector.h"
|
2022-09-26 01:26:15 +00:00
|
|
|
#include "v1_pod_failure_policy.h"
|
2020-03-18 17:24:33 +08:00
|
|
|
#include "v1_pod_template_spec.h"
|
2024-05-18 13:20:54 +00:00
|
|
|
#include "v1_success_policy.h"
|
2020-03-18 17:24:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct v1_job_spec_t {
|
|
|
|
|
long active_deadline_seconds; //numeric
|
|
|
|
|
int backoff_limit; //numeric
|
2023-09-06 01:56:31 +00:00
|
|
|
int backoff_limit_per_index; //numeric
|
2021-09-14 21:52:06 +08:00
|
|
|
char *completion_mode; // string
|
2020-03-18 17:24:33 +08:00
|
|
|
int completions; //numeric
|
2024-05-18 13:20:54 +00:00
|
|
|
char *managed_by; // string
|
2020-03-18 17:24:33 +08:00
|
|
|
int manual_selector; //boolean
|
2023-09-06 01:56:31 +00:00
|
|
|
int max_failed_indexes; //numeric
|
2020-03-18 17:24:33 +08:00
|
|
|
int parallelism; //numeric
|
2022-09-26 01:26:15 +00:00
|
|
|
struct v1_pod_failure_policy_t *pod_failure_policy; //model
|
2023-09-06 01:56:31 +00:00
|
|
|
char *pod_replacement_policy; // string
|
2020-03-18 17:24:33 +08:00
|
|
|
struct v1_label_selector_t *selector; //model
|
2024-05-18 13:20:54 +00:00
|
|
|
struct v1_success_policy_t *success_policy; //model
|
2021-09-14 21:52:06 +08:00
|
|
|
int suspend; //boolean
|
2021-01-05 15:42:34 +08:00
|
|
|
struct v1_pod_template_spec_t *_template; //model
|
2020-03-18 17:24:33 +08:00
|
|
|
int ttl_seconds_after_finished; //numeric
|
|
|
|
|
|
2025-02-11 19:36:46 +00:00
|
|
|
int _library_owned; // Is the library responsible for freeing this object?
|
2020-03-18 17:24:33 +08:00
|
|
|
} v1_job_spec_t;
|
|
|
|
|
|
2025-02-11 19:36:46 +00:00
|
|
|
__attribute__((deprecated)) v1_job_spec_t *v1_job_spec_create(
|
2020-03-18 17:24:33 +08:00
|
|
|
long active_deadline_seconds,
|
|
|
|
|
int backoff_limit,
|
2023-09-06 01:56:31 +00:00
|
|
|
int backoff_limit_per_index,
|
2021-09-14 21:52:06 +08:00
|
|
|
char *completion_mode,
|
2020-03-18 17:24:33 +08:00
|
|
|
int completions,
|
2024-05-18 13:20:54 +00:00
|
|
|
char *managed_by,
|
2020-03-18 17:24:33 +08:00
|
|
|
int manual_selector,
|
2023-09-06 01:56:31 +00:00
|
|
|
int max_failed_indexes,
|
2020-03-18 17:24:33 +08:00
|
|
|
int parallelism,
|
2022-09-26 01:26:15 +00:00
|
|
|
v1_pod_failure_policy_t *pod_failure_policy,
|
2023-09-06 01:56:31 +00:00
|
|
|
char *pod_replacement_policy,
|
2020-03-18 17:24:33 +08:00
|
|
|
v1_label_selector_t *selector,
|
2024-05-18 13:20:54 +00:00
|
|
|
v1_success_policy_t *success_policy,
|
2021-09-14 21:52:06 +08:00
|
|
|
int suspend,
|
2021-01-05 15:42:34 +08:00
|
|
|
v1_pod_template_spec_t *_template,
|
2020-03-18 17:24:33 +08:00
|
|
|
int ttl_seconds_after_finished
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
void v1_job_spec_free(v1_job_spec_t *v1_job_spec);
|
|
|
|
|
|
|
|
|
|
v1_job_spec_t *v1_job_spec_parseFromJSON(cJSON *v1_job_specJSON);
|
|
|
|
|
|
|
|
|
|
cJSON *v1_job_spec_convertToJSON(v1_job_spec_t *v1_job_spec);
|
|
|
|
|
|
|
|
|
|
#endif /* _v1_job_spec_H_ */
|
|
|
|
|
|