diff --git a/kubernetes/.openapi-generator/COMMIT b/kubernetes/.openapi-generator/COMMIT index bfa1b3b1..2625db50 100644 --- a/kubernetes/.openapi-generator/COMMIT +++ b/kubernetes/.openapi-generator/COMMIT @@ -1,2 +1,2 @@ Requested Commit/Tag : master -Actual Commit : 187af2ec4e8a5f6f8f3bdf376134ba0a8cd677de +Actual Commit : 89eea742fe3ac5204bd1907d77ac350b458f4d0b diff --git a/kubernetes/.openapi-generator/FILES b/kubernetes/.openapi-generator/FILES index e2fbb82a..cf285693 100644 --- a/kubernetes/.openapi-generator/FILES +++ b/kubernetes/.openapi-generator/FILES @@ -28,8 +28,6 @@ api/AuthenticationAPI.c api/AuthenticationAPI.h api/AuthenticationV1API.c api/AuthenticationV1API.h -api/AuthenticationV1beta1API.c -api/AuthenticationV1beta1API.h api/AuthorizationAPI.c api/AuthorizationAPI.h api/AuthorizationV1API.c @@ -50,12 +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 @@ -106,6 +108,8 @@ 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 @@ -139,7 +143,6 @@ docs/AppsAPI.md docs/AppsV1API.md docs/AuthenticationAPI.md docs/AuthenticationV1API.md -docs/AuthenticationV1beta1API.md docs/AuthorizationAPI.md docs/AuthorizationV1API.md docs/AutoscalingAPI.md @@ -150,9 +153,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 @@ -178,6 +183,7 @@ docs/RbacAuthorizationV1API.md docs/ResourceAPI.md docs/ResourceV1alpha3API.md docs/ResourceV1beta1API.md +docs/ResourceV1beta2API.md docs/SchedulingAPI.md docs/SchedulingV1API.md docs/StorageAPI.md @@ -343,6 +349,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 @@ -378,6 +385,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 @@ -447,6 +457,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 @@ -458,6 +469,7 @@ 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 @@ -583,6 +595,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 @@ -698,6 +714,8 @@ docs/v1alpha3_allocated_device_status.md docs/v1alpha3_allocation_result.md docs/v1alpha3_basic_device.md docs/v1alpha3_cel_device_selector.md +docs/v1alpha3_counter.md +docs/v1alpha3_counter_set.md docs/v1alpha3_device.md docs/v1alpha3_device_allocation_configuration.md docs/v1alpha3_device_allocation_result.md @@ -709,9 +727,17 @@ docs/v1alpha3_device_class_configuration.md docs/v1alpha3_device_class_list.md docs/v1alpha3_device_class_spec.md docs/v1alpha3_device_constraint.md +docs/v1alpha3_device_counter_consumption.md docs/v1alpha3_device_request.md docs/v1alpha3_device_request_allocation_result.md docs/v1alpha3_device_selector.md +docs/v1alpha3_device_sub_request.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/v1alpha3_device_toleration.md docs/v1alpha3_network_device_data.md docs/v1alpha3_opaque_device_configuration.md docs/v1alpha3_resource_claim.md @@ -731,6 +757,11 @@ docs/v1beta1_allocation_result.md docs/v1beta1_audit_annotation.md docs/v1beta1_basic_device.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 @@ -743,13 +774,20 @@ 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_expression_warning.md docs/v1beta1_ip_address.md docs/v1beta1_ip_address_list.md docs/v1beta1_ip_address_spec.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_named_rule_with_operations.md @@ -770,8 +808,6 @@ docs/v1beta1_resource_pool.md docs/v1beta1_resource_slice.md docs/v1beta1_resource_slice_list.md docs/v1beta1_resource_slice_spec.md -docs/v1beta1_self_subject_review.md -docs/v1beta1_self_subject_review_status.md docs/v1beta1_service_cidr.md docs/v1beta1_service_cidr_list.md docs/v1beta1_service_cidr_spec.md @@ -788,6 +824,45 @@ docs/v1beta1_validation.md docs/v1beta1_variable.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_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 @@ -1134,6 +1209,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 @@ -1204,6 +1281,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 @@ -1342,6 +1425,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 @@ -1364,6 +1449,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 @@ -1614,6 +1701,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 @@ -1844,6 +1939,10 @@ model/v1alpha3_basic_device.c model/v1alpha3_basic_device.h model/v1alpha3_cel_device_selector.c model/v1alpha3_cel_device_selector.h +model/v1alpha3_counter.c +model/v1alpha3_counter.h +model/v1alpha3_counter_set.c +model/v1alpha3_counter_set.h model/v1alpha3_device.c model/v1alpha3_device.h model/v1alpha3_device_allocation_configuration.c @@ -1866,12 +1965,28 @@ model/v1alpha3_device_class_spec.c model/v1alpha3_device_class_spec.h model/v1alpha3_device_constraint.c model/v1alpha3_device_constraint.h +model/v1alpha3_device_counter_consumption.c +model/v1alpha3_device_counter_consumption.h model/v1alpha3_device_request.c model/v1alpha3_device_request.h model/v1alpha3_device_request_allocation_result.c model/v1alpha3_device_request_allocation_result.h model/v1alpha3_device_selector.c model/v1alpha3_device_selector.h +model/v1alpha3_device_sub_request.c +model/v1alpha3_device_sub_request.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/v1alpha3_device_toleration.c +model/v1alpha3_device_toleration.h model/v1alpha3_network_device_data.c model/v1alpha3_network_device_data.h model/v1alpha3_opaque_device_configuration.c @@ -1910,6 +2025,16 @@ model/v1beta1_basic_device.c model/v1beta1_basic_device.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 @@ -1934,12 +2059,20 @@ 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_expression_warning.c model/v1beta1_expression_warning.h model/v1beta1_ip_address.c @@ -1948,6 +2081,12 @@ 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_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 @@ -1988,10 +2127,6 @@ 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_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_service_cidr.c model/v1beta1_service_cidr.h model/v1beta1_service_cidr_list.c @@ -2024,6 +2159,84 @@ 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_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 @@ -2234,6 +2447,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 @@ -2269,6 +2483,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 @@ -2338,6 +2555,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 @@ -2349,6 +2567,7 @@ 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 @@ -2474,6 +2693,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 @@ -2589,6 +2812,8 @@ unit-test/test_v1alpha3_allocated_device_status.c unit-test/test_v1alpha3_allocation_result.c unit-test/test_v1alpha3_basic_device.c unit-test/test_v1alpha3_cel_device_selector.c +unit-test/test_v1alpha3_counter.c +unit-test/test_v1alpha3_counter_set.c unit-test/test_v1alpha3_device.c unit-test/test_v1alpha3_device_allocation_configuration.c unit-test/test_v1alpha3_device_allocation_result.c @@ -2600,9 +2825,17 @@ unit-test/test_v1alpha3_device_class_configuration.c unit-test/test_v1alpha3_device_class_list.c unit-test/test_v1alpha3_device_class_spec.c unit-test/test_v1alpha3_device_constraint.c +unit-test/test_v1alpha3_device_counter_consumption.c unit-test/test_v1alpha3_device_request.c unit-test/test_v1alpha3_device_request_allocation_result.c unit-test/test_v1alpha3_device_selector.c +unit-test/test_v1alpha3_device_sub_request.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_v1alpha3_device_toleration.c unit-test/test_v1alpha3_network_device_data.c unit-test/test_v1alpha3_opaque_device_configuration.c unit-test/test_v1alpha3_resource_claim.c @@ -2622,6 +2855,11 @@ unit-test/test_v1beta1_allocation_result.c unit-test/test_v1beta1_audit_annotation.c unit-test/test_v1beta1_basic_device.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 @@ -2634,13 +2872,20 @@ 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_expression_warning.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_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_named_rule_with_operations.c @@ -2661,8 +2906,6 @@ 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_self_subject_review.c -unit-test/test_v1beta1_self_subject_review_status.c unit-test/test_v1beta1_service_cidr.c unit-test/test_v1beta1_service_cidr_list.c unit-test/test_v1beta1_service_cidr_spec.c @@ -2679,6 +2922,45 @@ unit-test/test_v1beta1_validation.c unit-test/test_v1beta1_variable.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_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 de37f5c4..4c631cf2 100644 --- a/kubernetes/.openapi-generator/VERSION +++ b/kubernetes/.openapi-generator/VERSION @@ -1 +1 @@ -7.12.0-SNAPSHOT +7.14.0-SNAPSHOT diff --git a/kubernetes/.openapi-generator/swagger.json-default.sha256 b/kubernetes/.openapi-generator/swagger.json-default.sha256 index c1178ee7..1f538f37 100644 --- a/kubernetes/.openapi-generator/swagger.json-default.sha256 +++ b/kubernetes/.openapi-generator/swagger.json-default.sha256 @@ -1 +1 @@ -5ba08c0638f22fd6b6a31cbff2541999028cfc7c60562ce5ac8c112e0449f8e9 \ No newline at end of file +5b5d846934d76cef905764794700f8799592d65a2e5148a5336aaccee08b11d3 \ No newline at end of file diff --git a/kubernetes/CMakeLists.txt b/kubernetes/CMakeLists.txt index acbbc18b..4615b636 100644 --- a/kubernetes/CMakeLists.txt +++ b/kubernetes/CMakeLists.txt @@ -1,9 +1,6 @@ cmake_minimum_required (VERSION 2.6...3.10.2) project (CGenerator C) -enable_language(C) -enable_language(CXX) - cmake_policy(SET CMP0063 NEW) set(CMAKE_C_VISIBILITY_PRESET default) @@ -206,6 +203,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 @@ -241,6 +239,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 @@ -310,6 +311,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 @@ -321,6 +323,7 @@ set(SRCS 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 @@ -446,6 +449,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 @@ -561,6 +568,8 @@ set(SRCS model/v1alpha3_allocation_result.c model/v1alpha3_basic_device.c model/v1alpha3_cel_device_selector.c + model/v1alpha3_counter.c + model/v1alpha3_counter_set.c model/v1alpha3_device.c model/v1alpha3_device_allocation_configuration.c model/v1alpha3_device_allocation_result.c @@ -572,9 +581,17 @@ set(SRCS model/v1alpha3_device_class_list.c model/v1alpha3_device_class_spec.c model/v1alpha3_device_constraint.c + model/v1alpha3_device_counter_consumption.c model/v1alpha3_device_request.c model/v1alpha3_device_request_allocation_result.c model/v1alpha3_device_selector.c + model/v1alpha3_device_sub_request.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/v1alpha3_device_toleration.c model/v1alpha3_network_device_data.c model/v1alpha3_opaque_device_configuration.c model/v1alpha3_resource_claim.c @@ -594,6 +611,11 @@ set(SRCS model/v1beta1_audit_annotation.c model/v1beta1_basic_device.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 @@ -606,13 +628,20 @@ set(SRCS 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_expression_warning.c model/v1beta1_ip_address.c model/v1beta1_ip_address_list.c model/v1beta1_ip_address_spec.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_named_rule_with_operations.c @@ -633,8 +662,6 @@ set(SRCS model/v1beta1_resource_slice.c model/v1beta1_resource_slice_list.c model/v1beta1_resource_slice_spec.c - model/v1beta1_self_subject_review.c - model/v1beta1_self_subject_review_status.c model/v1beta1_service_cidr.c model/v1beta1_service_cidr_list.c model/v1beta1_service_cidr_spec.c @@ -651,6 +678,45 @@ set(SRCS model/v1beta1_variable.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_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 @@ -689,7 +755,6 @@ set(SRCS api/AppsV1API.c api/AuthenticationAPI.c api/AuthenticationV1API.c - api/AuthenticationV1beta1API.c api/AuthorizationAPI.c api/AuthorizationV1API.c api/AutoscalingAPI.c @@ -700,9 +765,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 @@ -728,6 +795,7 @@ set(SRCS api/ResourceAPI.c api/ResourceV1alpha3API.c api/ResourceV1beta1API.c + api/ResourceV1beta2API.c api/SchedulingAPI.c api/SchedulingV1API.c api/StorageAPI.c @@ -904,6 +972,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 @@ -939,6 +1008,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 @@ -1008,6 +1080,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 @@ -1019,6 +1092,7 @@ set(HDRS 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 @@ -1144,6 +1218,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 @@ -1259,6 +1337,8 @@ set(HDRS model/v1alpha3_allocation_result.h model/v1alpha3_basic_device.h model/v1alpha3_cel_device_selector.h + model/v1alpha3_counter.h + model/v1alpha3_counter_set.h model/v1alpha3_device.h model/v1alpha3_device_allocation_configuration.h model/v1alpha3_device_allocation_result.h @@ -1270,9 +1350,17 @@ set(HDRS model/v1alpha3_device_class_list.h model/v1alpha3_device_class_spec.h model/v1alpha3_device_constraint.h + model/v1alpha3_device_counter_consumption.h model/v1alpha3_device_request.h model/v1alpha3_device_request_allocation_result.h model/v1alpha3_device_selector.h + model/v1alpha3_device_sub_request.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/v1alpha3_device_toleration.h model/v1alpha3_network_device_data.h model/v1alpha3_opaque_device_configuration.h model/v1alpha3_resource_claim.h @@ -1292,6 +1380,11 @@ set(HDRS model/v1beta1_audit_annotation.h model/v1beta1_basic_device.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 @@ -1304,13 +1397,20 @@ set(HDRS 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_expression_warning.h model/v1beta1_ip_address.h model/v1beta1_ip_address_list.h model/v1beta1_ip_address_spec.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_named_rule_with_operations.h @@ -1331,8 +1431,6 @@ set(HDRS model/v1beta1_resource_slice.h model/v1beta1_resource_slice_list.h model/v1beta1_resource_slice_spec.h - model/v1beta1_self_subject_review.h - model/v1beta1_self_subject_review_status.h model/v1beta1_service_cidr.h model/v1beta1_service_cidr_list.h model/v1beta1_service_cidr_spec.h @@ -1349,6 +1447,45 @@ set(HDRS model/v1beta1_variable.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_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 @@ -1387,7 +1524,6 @@ set(HDRS api/AppsV1API.h api/AuthenticationAPI.h api/AuthenticationV1API.h - api/AuthenticationV1beta1API.h api/AuthorizationAPI.h api/AuthorizationV1API.h api/AutoscalingAPI.h @@ -1398,9 +1534,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 @@ -1426,6 +1564,7 @@ set(HDRS api/ResourceAPI.h api/ResourceV1alpha3API.h api/ResourceV1beta1API.h + api/ResourceV1beta2API.h api/SchedulingAPI.h api/SchedulingV1API.h api/StorageAPI.h @@ -1530,7 +1669,6 @@ set(HDRS "") # unit-tests/manual-AppsV1API.c # unit-tests/manual-AuthenticationAPI.c # unit-tests/manual-AuthenticationV1API.c -# unit-tests/manual-AuthenticationV1beta1API.c # unit-tests/manual-AuthorizationAPI.c # unit-tests/manual-AuthorizationV1API.c # unit-tests/manual-AutoscalingAPI.c @@ -1541,9 +1679,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 @@ -1569,6 +1709,7 @@ set(HDRS "") # unit-tests/manual-ResourceAPI.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 diff --git a/kubernetes/PreTarget.cmake b/kubernetes/PreTarget.cmake index baad293c..e8fa741d 100644 --- a/kubernetes/PreTarget.cmake +++ b/kubernetes/PreTarget.cmake @@ -1,5 +1,5 @@ set(PROJECT_VERSION_MAJOR 0) -set(PROJECT_VERSION_MINOR 910) +set(PROJECT_VERSION_MINOR 1310) 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 75877297..dadaee51 100644 --- a/kubernetes/README.md +++ b/kubernetes/README.md @@ -3,9 +3,9 @@ ## 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.32 +- API version: release-1.33 - Package version: -- Generator version: 7.12.0-SNAPSHOT +- Generator version: 7.14.0-SNAPSHOT - Build package: org.openapitools.codegen.languages.CLibcurlClientCodegen ## Installation @@ -223,8 +223,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/ | -*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 | @@ -303,6 +301,14 @@ Category | Method | HTTP request | Description *CertificatesV1alpha1API* | [**CertificatesV1alpha1API_patchClusterTrustBundle**](docs/CertificatesV1alpha1API.md#CertificatesV1alpha1API_patchClusterTrustBundle) | **PATCH** /apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name} | *CertificatesV1alpha1API* | [**CertificatesV1alpha1API_readClusterTrustBundle**](docs/CertificatesV1alpha1API.md#CertificatesV1alpha1API_readClusterTrustBundle) | **GET** /apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name} | *CertificatesV1alpha1API* | [**CertificatesV1alpha1API_replaceClusterTrustBundle**](docs/CertificatesV1alpha1API.md#CertificatesV1alpha1API_replaceClusterTrustBundle) | **PUT** /apis/certificates.k8s.io/v1alpha1/clustertrustbundles/{name} | +*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 | @@ -322,6 +328,15 @@ Category | Method | HTTP request | Description *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} | @@ -543,7 +558,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}/{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 | @@ -614,33 +629,50 @@ 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} | +*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 | @@ -716,35 +748,42 @@ Category | Method | HTTP request | Description *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/ | *ResourceV1alpha3API* | [**ResourceV1alpha3API_createDeviceClass**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_createDeviceClass) | **POST** /apis/resource.k8s.io/v1alpha3/deviceclasses | +*ResourceV1alpha3API* | [**ResourceV1alpha3API_createDeviceTaintRule**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_createDeviceTaintRule) | **POST** /apis/resource.k8s.io/v1alpha3/devicetaintrules | *ResourceV1alpha3API* | [**ResourceV1alpha3API_createNamespacedResourceClaim**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_createNamespacedResourceClaim) | **POST** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims | *ResourceV1alpha3API* | [**ResourceV1alpha3API_createNamespacedResourceClaimTemplate**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_createNamespacedResourceClaimTemplate) | **POST** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaimtemplates | *ResourceV1alpha3API* | [**ResourceV1alpha3API_createResourceSlice**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_createResourceSlice) | **POST** /apis/resource.k8s.io/v1alpha3/resourceslices | *ResourceV1alpha3API* | [**ResourceV1alpha3API_deleteCollectionDeviceClass**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_deleteCollectionDeviceClass) | **DELETE** /apis/resource.k8s.io/v1alpha3/deviceclasses | +*ResourceV1alpha3API* | [**ResourceV1alpha3API_deleteCollectionDeviceTaintRule**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_deleteCollectionDeviceTaintRule) | **DELETE** /apis/resource.k8s.io/v1alpha3/devicetaintrules | *ResourceV1alpha3API* | [**ResourceV1alpha3API_deleteCollectionNamespacedResourceClaim**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_deleteCollectionNamespacedResourceClaim) | **DELETE** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims | *ResourceV1alpha3API* | [**ResourceV1alpha3API_deleteCollectionNamespacedResourceClaimTemplate**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_deleteCollectionNamespacedResourceClaimTemplate) | **DELETE** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaimtemplates | *ResourceV1alpha3API* | [**ResourceV1alpha3API_deleteCollectionResourceSlice**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_deleteCollectionResourceSlice) | **DELETE** /apis/resource.k8s.io/v1alpha3/resourceslices | *ResourceV1alpha3API* | [**ResourceV1alpha3API_deleteDeviceClass**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_deleteDeviceClass) | **DELETE** /apis/resource.k8s.io/v1alpha3/deviceclasses/{name} | +*ResourceV1alpha3API* | [**ResourceV1alpha3API_deleteDeviceTaintRule**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_deleteDeviceTaintRule) | **DELETE** /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name} | *ResourceV1alpha3API* | [**ResourceV1alpha3API_deleteNamespacedResourceClaim**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_deleteNamespacedResourceClaim) | **DELETE** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims/{name} | *ResourceV1alpha3API* | [**ResourceV1alpha3API_deleteNamespacedResourceClaimTemplate**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_deleteNamespacedResourceClaimTemplate) | **DELETE** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaimtemplates/{name} | *ResourceV1alpha3API* | [**ResourceV1alpha3API_deleteResourceSlice**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_deleteResourceSlice) | **DELETE** /apis/resource.k8s.io/v1alpha3/resourceslices/{name} | *ResourceV1alpha3API* | [**ResourceV1alpha3API_getAPIResources**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_getAPIResources) | **GET** /apis/resource.k8s.io/v1alpha3/ | *ResourceV1alpha3API* | [**ResourceV1alpha3API_listDeviceClass**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_listDeviceClass) | **GET** /apis/resource.k8s.io/v1alpha3/deviceclasses | +*ResourceV1alpha3API* | [**ResourceV1alpha3API_listDeviceTaintRule**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_listDeviceTaintRule) | **GET** /apis/resource.k8s.io/v1alpha3/devicetaintrules | *ResourceV1alpha3API* | [**ResourceV1alpha3API_listNamespacedResourceClaim**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_listNamespacedResourceClaim) | **GET** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims | *ResourceV1alpha3API* | [**ResourceV1alpha3API_listNamespacedResourceClaimTemplate**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_listNamespacedResourceClaimTemplate) | **GET** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaimtemplates | *ResourceV1alpha3API* | [**ResourceV1alpha3API_listResourceClaimForAllNamespaces**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_listResourceClaimForAllNamespaces) | **GET** /apis/resource.k8s.io/v1alpha3/resourceclaims | *ResourceV1alpha3API* | [**ResourceV1alpha3API_listResourceClaimTemplateForAllNamespaces**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_listResourceClaimTemplateForAllNamespaces) | **GET** /apis/resource.k8s.io/v1alpha3/resourceclaimtemplates | *ResourceV1alpha3API* | [**ResourceV1alpha3API_listResourceSlice**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_listResourceSlice) | **GET** /apis/resource.k8s.io/v1alpha3/resourceslices | *ResourceV1alpha3API* | [**ResourceV1alpha3API_patchDeviceClass**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_patchDeviceClass) | **PATCH** /apis/resource.k8s.io/v1alpha3/deviceclasses/{name} | +*ResourceV1alpha3API* | [**ResourceV1alpha3API_patchDeviceTaintRule**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_patchDeviceTaintRule) | **PATCH** /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name} | *ResourceV1alpha3API* | [**ResourceV1alpha3API_patchNamespacedResourceClaim**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_patchNamespacedResourceClaim) | **PATCH** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims/{name} | *ResourceV1alpha3API* | [**ResourceV1alpha3API_patchNamespacedResourceClaimStatus**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_patchNamespacedResourceClaimStatus) | **PATCH** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims/{name}/status | *ResourceV1alpha3API* | [**ResourceV1alpha3API_patchNamespacedResourceClaimTemplate**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_patchNamespacedResourceClaimTemplate) | **PATCH** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaimtemplates/{name} | *ResourceV1alpha3API* | [**ResourceV1alpha3API_patchResourceSlice**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_patchResourceSlice) | **PATCH** /apis/resource.k8s.io/v1alpha3/resourceslices/{name} | *ResourceV1alpha3API* | [**ResourceV1alpha3API_readDeviceClass**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_readDeviceClass) | **GET** /apis/resource.k8s.io/v1alpha3/deviceclasses/{name} | +*ResourceV1alpha3API* | [**ResourceV1alpha3API_readDeviceTaintRule**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_readDeviceTaintRule) | **GET** /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name} | *ResourceV1alpha3API* | [**ResourceV1alpha3API_readNamespacedResourceClaim**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_readNamespacedResourceClaim) | **GET** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims/{name} | *ResourceV1alpha3API* | [**ResourceV1alpha3API_readNamespacedResourceClaimStatus**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_readNamespacedResourceClaimStatus) | **GET** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims/{name}/status | *ResourceV1alpha3API* | [**ResourceV1alpha3API_readNamespacedResourceClaimTemplate**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_readNamespacedResourceClaimTemplate) | **GET** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaimtemplates/{name} | *ResourceV1alpha3API* | [**ResourceV1alpha3API_readResourceSlice**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_readResourceSlice) | **GET** /apis/resource.k8s.io/v1alpha3/resourceslices/{name} | *ResourceV1alpha3API* | [**ResourceV1alpha3API_replaceDeviceClass**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_replaceDeviceClass) | **PUT** /apis/resource.k8s.io/v1alpha3/deviceclasses/{name} | +*ResourceV1alpha3API* | [**ResourceV1alpha3API_replaceDeviceTaintRule**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_replaceDeviceTaintRule) | **PUT** /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name} | *ResourceV1alpha3API* | [**ResourceV1alpha3API_replaceNamespacedResourceClaim**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_replaceNamespacedResourceClaim) | **PUT** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims/{name} | *ResourceV1alpha3API* | [**ResourceV1alpha3API_replaceNamespacedResourceClaimStatus**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_replaceNamespacedResourceClaimStatus) | **PUT** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims/{name}/status | *ResourceV1alpha3API* | [**ResourceV1alpha3API_replaceNamespacedResourceClaimTemplate**](docs/ResourceV1alpha3API.md#ResourceV1alpha3API_replaceNamespacedResourceClaimTemplate) | **PUT** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaimtemplates/{name} | @@ -783,6 +822,40 @@ Category | Method | HTTP request | Description *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 | @@ -1022,6 +1095,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) @@ -1057,6 +1131,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) @@ -1126,6 +1203,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) @@ -1137,6 +1215,7 @@ Category | Method | HTTP request | Description - [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) @@ -1262,6 +1341,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) @@ -1377,6 +1460,8 @@ Category | Method | HTTP request | Description - [v1alpha3_allocation_result_t](docs/v1alpha3_allocation_result.md) - [v1alpha3_basic_device_t](docs/v1alpha3_basic_device.md) - [v1alpha3_cel_device_selector_t](docs/v1alpha3_cel_device_selector.md) + - [v1alpha3_counter_t](docs/v1alpha3_counter.md) + - [v1alpha3_counter_set_t](docs/v1alpha3_counter_set.md) - [v1alpha3_device_t](docs/v1alpha3_device.md) - [v1alpha3_device_allocation_configuration_t](docs/v1alpha3_device_allocation_configuration.md) - [v1alpha3_device_allocation_result_t](docs/v1alpha3_device_allocation_result.md) @@ -1388,9 +1473,17 @@ Category | Method | HTTP request | Description - [v1alpha3_device_class_list_t](docs/v1alpha3_device_class_list.md) - [v1alpha3_device_class_spec_t](docs/v1alpha3_device_class_spec.md) - [v1alpha3_device_constraint_t](docs/v1alpha3_device_constraint.md) + - [v1alpha3_device_counter_consumption_t](docs/v1alpha3_device_counter_consumption.md) - [v1alpha3_device_request_t](docs/v1alpha3_device_request.md) - [v1alpha3_device_request_allocation_result_t](docs/v1alpha3_device_request_allocation_result.md) - [v1alpha3_device_selector_t](docs/v1alpha3_device_selector.md) + - [v1alpha3_device_sub_request_t](docs/v1alpha3_device_sub_request.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) + - [v1alpha3_device_toleration_t](docs/v1alpha3_device_toleration.md) - [v1alpha3_network_device_data_t](docs/v1alpha3_network_device_data.md) - [v1alpha3_opaque_device_configuration_t](docs/v1alpha3_opaque_device_configuration.md) - [v1alpha3_resource_claim_t](docs/v1alpha3_resource_claim.md) @@ -1410,6 +1503,11 @@ Category | Method | HTTP request | Description - [v1beta1_audit_annotation_t](docs/v1beta1_audit_annotation.md) - [v1beta1_basic_device_t](docs/v1beta1_basic_device.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) @@ -1422,13 +1520,20 @@ Category | Method | HTTP request | Description - [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_expression_warning_t](docs/v1beta1_expression_warning.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_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_named_rule_with_operations_t](docs/v1beta1_named_rule_with_operations.md) @@ -1449,8 +1554,6 @@ Category | Method | HTTP request | Description - [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_self_subject_review_t](docs/v1beta1_self_subject_review.md) - - [v1beta1_self_subject_review_status_t](docs/v1beta1_self_subject_review_status.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) @@ -1467,6 +1570,45 @@ Category | Method | HTTP request | Description - [v1beta1_variable_t](docs/v1beta1_variable.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_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/AuthenticationV1beta1API.c b/kubernetes/api/AuthenticationV1beta1API.c deleted file mode 100644 index d0eb8e62..00000000 --- a/kubernetes/api/AuthenticationV1beta1API.c +++ /dev/null @@ -1,278 +0,0 @@ -#include -#include -#include -#include "AuthenticationV1beta1API.h" - -#define MAX_NUMBER_LENGTH 16 -#define MAX_BUFFER_LENGTH 4096 - - -// 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; - size_t localVarBodyLength = 0; - - // clear the error code from the previous api call - apiClient->response_code = 0; - - // create the path - char *localVarPath = strdup("/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) - { - //not string, not binary - localVarSingleItemJSON_body = v1beta1_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, - 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_self_subject_review_t *elementToReturn = NULL; - if(apiClient->response_code >= 200 && apiClient->response_code < 300) { - cJSON *AuthenticationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - 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; - size_t localVarBodyLength = 0; - - // clear the error code from the previous api call - apiClient->response_code = 0; - - // create the path - char *localVarPath = strdup("/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 - 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 *AuthenticationV1beta1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - 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/CertificatesV1beta1API.c b/kubernetes/api/CertificatesV1beta1API.c new file mode 100644 index 00000000..b19d3ae2 --- /dev/null +++ b/kubernetes/api/CertificatesV1beta1API.c @@ -0,0 +1,1859 @@ +#include +#include +#include +#include "CertificatesV1beta1API.h" + +#define MAX_NUMBER_LENGTH 16 +#define MAX_BUFFER_LENGTH 4096 + + +// 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/CoordinationV1beta1API.c b/kubernetes/api/CoordinationV1beta1API.c new file mode 100644 index 00000000..0d9e0f8b --- /dev/null +++ b/kubernetes/api/CoordinationV1beta1API.c @@ -0,0 +1,2297 @@ +#include +#include +#include +#include "CoordinationV1beta1API.h" + +#define MAX_NUMBER_LENGTH 16 +#define MAX_BUFFER_LENGTH 4096 + + +// 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/CustomObjectsAPI.c b/kubernetes/api/CustomObjectsAPI.c index 9df40f45..1fa3ac4f 100644 --- a/kubernetes/api/CustomObjectsAPI.c +++ b/kubernetes/api/CustomObjectsAPI.c @@ -2780,7 +2780,7 @@ CustomObjectsAPI_listClusterCustomObject(apiClient_t *apiClient, char *group, ch // list or watch namespace scoped custom objects // object_t* -CustomObjectsAPI_listCustomObjectForAllNamespaces(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; @@ -2794,18 +2794,18 @@ CustomObjectsAPI_listCustomObjectForAllNamespaces(apiClient_t *apiClient, char * apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/{group}/{version}/{plural}#‎"); + char *localVarPath = strdup("/apis/{group}/{version}/{resource_plural}"); if(!group) goto end; if(!version) goto end; - if(!plural) + if(!resource_plural) goto end; // Path Params - long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + sizeof("{ group }") - 1; + long sizeOfPathParams_group = strlen(group)+3 + strlen(version)+3 + strlen(resource_plural)+3 + sizeof("{ group }") - 1; if(group == NULL) { goto end; } @@ -2815,7 +2815,7 @@ CustomObjectsAPI_listCustomObjectForAllNamespaces(apiClient_t *apiClient, char * localVarPath = strReplace(localVarPath, localVarToReplace_group, group); // Path Params - long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(plural)+3 + sizeof("{ version }") - 1; + long sizeOfPathParams_version = strlen(group)+3 + strlen(version)+3 + strlen(resource_plural)+3 + sizeof("{ version }") - 1; if(version == NULL) { goto end; } @@ -2825,14 +2825,14 @@ CustomObjectsAPI_listCustomObjectForAllNamespaces(apiClient_t *apiClient, char * 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) { + 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); @@ -3005,7 +3005,7 @@ CustomObjectsAPI_listCustomObjectForAllNamespaces(apiClient_t *apiClient, char * free(localVarPath); free(localVarToReplace_group); free(localVarToReplace_version); - free(localVarToReplace_plural); + free(localVarToReplace_resource_plural); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; diff --git a/kubernetes/api/CustomObjectsAPI.h b/kubernetes/api/CustomObjectsAPI.h index 3777a799..93baa92a 100644 --- a/kubernetes/api/CustomObjectsAPI.h +++ b/kubernetes/api/CustomObjectsAPI.h @@ -97,7 +97,7 @@ CustomObjectsAPI_listClusterCustomObject(apiClient_t *apiClient, char *group, ch // list or watch namespace scoped custom objects // object_t* -CustomObjectsAPI_listCustomObjectForAllNamespaces(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 or watch namespace scoped custom objects diff --git a/kubernetes/api/NetworkingV1API.c b/kubernetes/api/NetworkingV1API.c index a4152eb9..2b7b973a 100644 --- a/kubernetes/api/NetworkingV1API.c +++ b/kubernetes/api/NetworkingV1API.c @@ -7,10 +7,10 @@ #define MAX_BUFFER_LENGTH 4096 -// 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; @@ -24,7 +24,7 @@ NetworkingV1API_createIngressClass(apiClient_t *apiClient, v1_ingress_class_t *b apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/networking.k8s.io/v1/ingressclasses"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/ipaddresses"); @@ -83,7 +83,7 @@ NetworkingV1API_createIngressClass(apiClient_t *apiClient, v1_ingress_class_t *b if (body != NULL) { //not string, not binary - localVarSingleItemJSON_body = v1_ingress_class_convertToJSON(body); + localVarSingleItemJSON_body = v1_ip_address_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); localVarBodyLength = strlen(localVarBodyParameters); } @@ -119,10 +119,10 @@ NetworkingV1API_createIngressClass(apiClient_t *apiClient, v1_ingress_class_t *b // printf("%s\n","Unauthorized"); //} //nonprimitive not container - v1_ingress_class_t *elementToReturn = NULL; + v1_ip_address_t *elementToReturn = NULL; if(apiClient->response_code >= 200 && apiClient->response_code < 300) { cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - elementToReturn = v1_ingress_class_parseFromJSON(NetworkingV1APIlocalVarJSON); + elementToReturn = v1_ip_address_parseFromJSON(NetworkingV1APIlocalVarJSON); cJSON_Delete(NetworkingV1APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -201,10 +201,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; @@ -218,21 +218,9 @@ NetworkingV1API_createNamespacedIngress(apiClient_t *apiClient, char *_namespace apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses"); - - if(!_namespace) - goto end; - + char *localVarPath = strdup("/apis/networking.k8s.io/v1/ingressclasses"); - // 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); @@ -289,7 +277,7 @@ NetworkingV1API_createNamespacedIngress(apiClient_t *apiClient, char *_namespace if (body != NULL) { //not string, not binary - localVarSingleItemJSON_body = v1_ingress_convertToJSON(body); + localVarSingleItemJSON_body = v1_ingress_class_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); localVarBodyLength = strlen(localVarBodyParameters); } @@ -325,10 +313,10 @@ NetworkingV1API_createNamespacedIngress(apiClient_t *apiClient, char *_namespace // printf("%s\n","Unauthorized"); //} //nonprimitive not container - v1_ingress_t *elementToReturn = NULL; + v1_ingress_class_t *elementToReturn = NULL; if(apiClient->response_code >= 200 && apiClient->response_code < 300) { cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - elementToReturn = v1_ingress_parseFromJSON(NetworkingV1APIlocalVarJSON); + elementToReturn = v1_ingress_class_parseFromJSON(NetworkingV1APIlocalVarJSON); cJSON_Delete(NetworkingV1APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -347,7 +335,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; @@ -408,10 +395,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; @@ -425,7 +412,7 @@ NetworkingV1API_createNamespacedNetworkPolicy(apiClient_t *apiClient, char *_nam apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses"); if(!_namespace) goto end; @@ -496,7 +483,7 @@ NetworkingV1API_createNamespacedNetworkPolicy(apiClient_t *apiClient, char *_nam if (body != NULL) { //not string, not binary - localVarSingleItemJSON_body = v1_network_policy_convertToJSON(body); + localVarSingleItemJSON_body = v1_ingress_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); localVarBodyLength = strlen(localVarBodyParameters); } @@ -532,10 +519,10 @@ NetworkingV1API_createNamespacedNetworkPolicy(apiClient_t *apiClient, char *_nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - v1_network_policy_t *elementToReturn = NULL; + v1_ingress_t *elementToReturn = NULL; if(apiClient->response_code >= 200 && apiClient->response_code < 300) { cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - elementToReturn = v1_network_policy_parseFromJSON(NetworkingV1APIlocalVarJSON); + elementToReturn = v1_ingress_parseFromJSON(NetworkingV1APIlocalVarJSON); cJSON_Delete(NetworkingV1APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -615,10 +602,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, int *ignoreStoreReadErrorWithClusterBreakingPotential, 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; @@ -632,9 +619,21 @@ NetworkingV1API_deleteCollectionIngressClass(apiClient_t *apiClient, char *prett apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/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); @@ -650,18 +649,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; @@ -675,141 +662,27 @@ 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_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) + 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 @@ -817,7 +690,7 @@ NetworkingV1API_deleteCollectionIngressClass(apiClient_t *apiClient, char *prett if (body != NULL) { //not string, not binary - localVarSingleItemJSON_body = v1_delete_options_convertToJSON(body); + localVarSingleItemJSON_body = v1_network_policy_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); localVarBodyLength = strlen(localVarBodyParameters); } @@ -834,21 +707,29 @@ NetworkingV1API_deleteCollectionIngressClass(apiClient_t *apiClient, char *prett localVarContentType, localVarBodyParameters, localVarBodyLength, - "DELETE"); + "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_status_t *elementToReturn = NULL; + v1_network_policy_t *elementToReturn = NULL; if(apiClient->response_code >= 200 && apiClient->response_code < 300) { cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - elementToReturn = v1_status_parseFromJSON(NetworkingV1APIlocalVarJSON); + elementToReturn = v1_network_policy_parseFromJSON(NetworkingV1APIlocalVarJSON); cJSON_Delete(NetworkingV1APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -867,6 +748,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; @@ -884,18 +766,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; @@ -908,137 +778,29 @@ NetworkingV1API_deleteCollectionIngressClass(apiClient_t *apiClient, char *prett 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(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: @@ -1047,10 +809,10 @@ NetworkingV1API_deleteCollectionIngressClass(apiClient_t *apiClient, char *prett } -// delete collection of Ingress +// create a ServiceCIDR // -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) +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; @@ -1064,21 +826,9 @@ NetworkingV1API_deleteCollectionNamespacedIngress(apiClient_t *apiClient, char * apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses"); - - if(!_namespace) - goto end; + char *localVarPath = strdup("/apis/networking.k8s.io/v1/servicecidrs"); - // 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); @@ -1094,18 +844,6 @@ NetworkingV1API_deleteCollectionNamespacedIngress(apiClient_t *apiClient, char * 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; @@ -1119,65 +857,271 @@ NetworkingV1API_deleteCollectionNamespacedIngress(apiClient_t *apiClient, char * } // 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) + char *keyQuery_fieldManager = NULL; + char * valueQuery_fieldManager = NULL; + keyValuePair_t *keyPairQuery_fieldManager = 0; + if (fieldManager) { - 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); + 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_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; - char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; - keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; - if (ignoreStoreReadErrorWithClusterBreakingPotential) + char *keyQuery_fieldValidation = NULL; + char * valueQuery_fieldValidation = NULL; + keyValuePair_t *keyPairQuery_fieldValidation = 0; + if (fieldValidation) { - 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); + 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_labelSelector = NULL; - char * valueQuery_labelSelector = NULL; - keyValuePair_t *keyPairQuery_labelSelector = 0; - if (labelSelector) + // Body Param + cJSON *localVarSingleItemJSON_body = NULL; + if (body != NULL) { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + //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, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + localVarBodyLength, + "POST"); - // 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); + // uncomment below to 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; + } + } + + //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* +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; + 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__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); } @@ -1311,7 +1255,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; @@ -1492,10 +1435,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, int *ignoreStoreReadErrorWithClusterBreakingPotential, 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; @@ -1509,21 +1452,9 @@ NetworkingV1API_deleteCollectionNamespacedNetworkPolicy(apiClient_t *apiClient, apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies"); - - if(!_namespace) - goto end; - + char *localVarPath = strdup("/apis/networking.k8s.io/v1/ingressclasses"); - // 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); @@ -1756,7 +1687,6 @@ NetworkingV1API_deleteCollectionNamespacedNetworkPolicy(apiClient_t *apiClient, list_freeList(localVarHeaderType); free(localVarPath); - free(localVarToReplace__namespace); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); localVarSingleItemJSON_body = NULL; @@ -1937,10 +1867,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 *ignoreStoreReadErrorWithClusterBreakingPotential, 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; @@ -1954,21 +1884,21 @@ NetworkingV1API_deleteIngressClass(apiClient_t *apiClient, char *name, char *pre apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/networking.k8s.io/v1/ingressclasses/{name}"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses"); - if(!name) + if(!_namespace) goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; - 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); @@ -1985,17 +1915,41 @@ NetworkingV1API_deleteIngressClass(apiClient_t *apiClient, char *name, char *pre } // 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__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; @@ -2022,6 +1976,31 @@ NetworkingV1API_deleteIngressClass(apiClient_t *apiClient, char *name, char *pre 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; @@ -2047,6 +2026,56 @@ 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) @@ -2076,10 +2105,6 @@ 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"); //} @@ -2106,7 +2131,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; @@ -2124,6 +2149,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; @@ -2136,6 +2173,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; @@ -2160,6 +2209,30 @@ NetworkingV1API_deleteIngressClass(apiClient_t *apiClient, char *name, char *pre 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; @@ -2184,6 +2257,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); @@ -2191,10 +2312,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 *ignoreStoreReadErrorWithClusterBreakingPotential, 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; @@ -2208,26 +2329,14 @@ NetworkingV1API_deleteNamespacedIngress(apiClient_t *apiClient, char *name, char apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies"); - 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; + long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; if(_namespace == NULL) { goto end; } @@ -2250,6 +2359,18 @@ NetworkingV1API_deleteNamespacedIngress(apiClient_t *apiClient, char *name, char 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; @@ -2262,6 +2383,18 @@ NetworkingV1API_deleteNamespacedIngress(apiClient_t *apiClient, char *name, char 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; @@ -2289,12 +2422,37 @@ NetworkingV1API_deleteNamespacedIngress(apiClient_t *apiClient, char *name, char } // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) - { - keyQuery_orphanDependents = strdup("orphanDependents"); + 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); @@ -2313,6 +2471,56 @@ 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) @@ -2342,10 +2550,6 @@ 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"); //} @@ -2372,7 +2576,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); @@ -2391,6 +2594,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; @@ -2403,6 +2618,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; @@ -2427,6 +2654,30 @@ NetworkingV1API_deleteNamespacedIngress(apiClient_t *apiClient, char *name, char 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; @@ -2451,6 +2702,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); @@ -2458,10 +2757,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 *ignoreStoreReadErrorWithClusterBreakingPotential, 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; @@ -2475,33 +2774,9 @@ NetworkingV1API_deleteNamespacedNetworkPolicy(apiClient_t *apiClient, char *name 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); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/servicecidrs"); - // 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); @@ -2517,6 +2792,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; @@ -2529,6 +2816,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; @@ -2556,30 +2855,105 @@ NetworkingV1API_deleteNamespacedNetworkPolicy(apiClient_t *apiClient, char *name } // query parameters - char *keyQuery_orphanDependents = NULL; - char * valueQuery_orphanDependents = NULL; - keyValuePair_t *keyPairQuery_orphanDependents = 0; - if (orphanDependents) + char *keyQuery_labelSelector = NULL; + char * valueQuery_labelSelector = NULL; + keyValuePair_t *keyPairQuery_labelSelector = 0; + if (labelSelector) { - 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); + 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_propagationPolicy = NULL; - char * valueQuery_propagationPolicy = NULL; - keyValuePair_t *keyPairQuery_propagationPolicy = 0; - if (propagationPolicy) - { - keyQuery_propagationPolicy = strdup("propagationPolicy"); + 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) @@ -2609,10 +2983,6 @@ 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"); //} @@ -2639,8 +3009,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; @@ -2658,6 +3026,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; @@ -2670,6 +3050,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; @@ -2694,6 +3086,30 @@ NetworkingV1API_deleteNamespacedNetworkPolicy(apiClient_t *apiClient, char *name 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; @@ -2718,6 +3134,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); @@ -2725,12 +3189,12 @@ 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(); @@ -2742,84 +3206,21 @@ NetworkingV1API_getAPIResources(apiClient_t *apiClient) apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/networking.k8s.io/v1/"); - - + char *localVarPath = strdup("/apis/networking.k8s.io/v1/ipaddresses/{name}"); + if(!name) + goto end; - list_addElement(localVarHeaderType,"application/json"); //produces - list_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; - } + // 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"); - //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 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"); - - + localVarPath = strReplace(localVarPath, localVarToReplace_name, name); @@ -2836,136 +3237,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/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, @@ -2975,21 +3321,25 @@ NetworkingV1API_listIngressClass(apiClient_t *apiClient, char *pretty, int *allo localVarContentType, localVarBodyParameters, localVarBodyLength, - "GET"); + "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_ingress_class_list_t *elementToReturn = NULL; + v1_status_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); + elementToReturn = v1_status_parseFromJSON(NetworkingV1APIlocalVarJSON); cJSON_Delete(NetworkingV1APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -3008,6 +3358,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; @@ -3020,125 +3376,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(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; } - if(valueQuery_allowWatchBookmarks){ - free(valueQuery_allowWatchBookmarks); - valueQuery_allowWatchBookmarks = NULL; + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; } - if(keyPairQuery_allowWatchBookmarks){ - keyValuePair_free(keyPairQuery_allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = NULL; + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = 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(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; } return elementToReturn; end: @@ -3147,10 +3443,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; @@ -3164,73 +3460,23 @@ NetworkingV1API_listIngressForAllNamespaces(apiClient_t *apiClient, int *allowWa apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/networking.k8s.io/v1/ingresses"); - - - + 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; @@ -3245,74 +3491,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/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, @@ -3322,21 +3575,25 @@ NetworkingV1API_listIngressForAllNamespaces(apiClient_t *apiClient, int *allowWa localVarContentType, localVarBodyParameters, localVarBodyLength, - "GET"); + "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_ingress_list_t *elementToReturn = NULL; + v1_status_t *elementToReturn = NULL; if(apiClient->response_code >= 200 && apiClient->response_code < 300) { cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - elementToReturn = v1_ingress_list_parseFromJSON(NetworkingV1APIlocalVarJSON); + elementToReturn = v1_status_parseFromJSON(NetworkingV1APIlocalVarJSON); cJSON_Delete(NetworkingV1APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -3355,66 +3612,12 @@ NetworkingV1API_listIngressForAllNamespaces(apiClient_t *apiClient, int *allowWa 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 (localVarSingleItemJSON_body) { + cJSON_Delete(localVarSingleItemJSON_body); + localVarSingleItemJSON_body = NULL; } + free(localVarBodyParameters); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -3427,65 +3630,65 @@ NetworkingV1API_listIngressForAllNamespaces(apiClient_t *apiClient, int *allowWa keyValuePair_free(keyPairQuery_pretty); keyPairQuery_pretty = NULL; } - if(keyQuery_resourceVersion){ - free(keyQuery_resourceVersion); - keyQuery_resourceVersion = NULL; + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; } return elementToReturn; end: @@ -3494,10 +3697,10 @@ NetworkingV1API_listIngressForAllNamespaces(apiClient_t *apiClient, int *allowWa } -// list or watch objects of kind Ingress +// delete an 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) +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; @@ -3511,14 +3714,26 @@ NetworkingV1API_listNamespacedIngress(apiClient_t *apiClient, char *_namespace, apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}"); + if(!name) + goto end; if(!_namespace) goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + 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; } @@ -3542,136 +3757,81 @@ NetworkingV1API_listNamespacedIngress(apiClient_t *apiClient, char *_namespace, } // query parameters - char *keyQuery_allowWatchBookmarks = NULL; - char * valueQuery_allowWatchBookmarks = NULL; - keyValuePair_t *keyPairQuery_allowWatchBookmarks = 0; - if (allowWatchBookmarks) + char *keyQuery_dryRun = NULL; + char * valueQuery_dryRun = NULL; + keyValuePair_t *keyPairQuery_dryRun = 0; + if (dryRun) { - 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); + 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__continue = NULL; - char * valueQuery__continue = NULL; - keyValuePair_t *keyPairQuery__continue = 0; - if (_continue) + char *keyQuery_gracePeriodSeconds = NULL; + char * valueQuery_gracePeriodSeconds = NULL; + keyValuePair_t *keyPairQuery_gracePeriodSeconds = 0; + if (gracePeriodSeconds) { - keyQuery__continue = strdup("continue"); - valueQuery__continue = strdup((_continue)); - keyPairQuery__continue = keyValuePair_create(keyQuery__continue, valueQuery__continue); - list_addElement(localVarQueryParameters,keyPairQuery__continue); + 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_fieldSelector = NULL; - char * valueQuery_fieldSelector = NULL; - keyValuePair_t *keyPairQuery_fieldSelector = 0; - if (fieldSelector) + char *keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + char * valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; + keyValuePair_t *keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = 0; + if (ignoreStoreReadErrorWithClusterBreakingPotential) { - keyQuery_fieldSelector = strdup("fieldSelector"); - valueQuery_fieldSelector = strdup((fieldSelector)); - keyPairQuery_fieldSelector = keyValuePair_create(keyQuery_fieldSelector, valueQuery_fieldSelector); - list_addElement(localVarQueryParameters,keyPairQuery_fieldSelector); + 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) + char *keyQuery_orphanDependents = NULL; + char * valueQuery_orphanDependents = NULL; + keyValuePair_t *keyPairQuery_orphanDependents = 0; + if (orphanDependents) { - keyQuery_labelSelector = strdup("labelSelector"); - valueQuery_labelSelector = strdup((labelSelector)); - keyPairQuery_labelSelector = keyValuePair_create(keyQuery_labelSelector, valueQuery_labelSelector); - list_addElement(localVarQueryParameters,keyPairQuery_labelSelector); + 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_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) + 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/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, @@ -3681,21 +3841,25 @@ NetworkingV1API_listNamespacedIngress(apiClient_t *apiClient, char *_namespace, localVarContentType, localVarBodyParameters, localVarBodyLength, - "GET"); + "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_ingress_list_t *elementToReturn = NULL; + v1_status_t *elementToReturn = NULL; if(apiClient->response_code >= 200 && apiClient->response_code < 300) { cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - elementToReturn = v1_ingress_list_parseFromJSON(NetworkingV1APIlocalVarJSON); + elementToReturn = v1_status_parseFromJSON(NetworkingV1APIlocalVarJSON); cJSON_Delete(NetworkingV1APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -3714,7 +3878,13 @@ NetworkingV1API_listNamespacedIngress(apiClient_t *apiClient, char *_namespace, 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; @@ -3727,125 +3897,65 @@ 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(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_resourceVersion = NULL; + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; } - if(keyPairQuery_resourceVersion){ - keyValuePair_free(keyPairQuery_resourceVersion); - keyPairQuery_resourceVersion = NULL; + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; } - if(keyQuery_resourceVersionMatch){ - free(keyQuery_resourceVersionMatch); - keyQuery_resourceVersionMatch = NULL; + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; } - if(valueQuery_resourceVersionMatch){ - free(valueQuery_resourceVersionMatch); - valueQuery_resourceVersionMatch = NULL; + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; } - if(keyPairQuery_resourceVersionMatch){ - keyValuePair_free(keyPairQuery_resourceVersionMatch); - keyPairQuery_resourceVersionMatch = NULL; + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; } - if(keyQuery_sendInitialEvents){ - free(keyQuery_sendInitialEvents); - keyQuery_sendInitialEvents = NULL; + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; } - if(valueQuery_sendInitialEvents){ - free(valueQuery_sendInitialEvents); - valueQuery_sendInitialEvents = NULL; + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; } - if(keyPairQuery_sendInitialEvents){ - keyValuePair_free(keyPairQuery_sendInitialEvents); - keyPairQuery_sendInitialEvents = NULL; + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; } - if(keyQuery_timeoutSeconds){ - free(keyQuery_timeoutSeconds); - keyQuery_timeoutSeconds = NULL; + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; } - if(valueQuery_timeoutSeconds){ - free(valueQuery_timeoutSeconds); - valueQuery_timeoutSeconds = NULL; + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = NULL; } - if(keyPairQuery_timeoutSeconds){ - keyValuePair_free(keyPairQuery_timeoutSeconds); - keyPairQuery_timeoutSeconds = NULL; + if(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; } return elementToReturn; end: @@ -3854,11 +3964,11 @@ NetworkingV1API_listNamespacedIngress(apiClient_t *apiClient, char *_namespace, } -// list or watch objects of kind NetworkPolicy +// delete a 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) -{ +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; @@ -3871,14 +3981,26 @@ NetworkingV1API_listNamespacedNetworkPolicy(apiClient_t *apiClient, char *_names apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}"); + if(!name) + goto end; if(!_namespace) goto end; // Path Params - long sizeOfPathParams__namespace = strlen(_namespace)+3 + sizeof("{ namespace }") - 1; + 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; } @@ -3902,136 +4024,81 @@ NetworkingV1API_listNamespacedNetworkPolicy(apiClient_t *apiClient, char *_names } // 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/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, @@ -4041,21 +4108,25 @@ NetworkingV1API_listNamespacedNetworkPolicy(apiClient_t *apiClient, char *_names localVarContentType, localVarBodyParameters, localVarBodyLength, - "GET"); + "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_network_policy_list_t *elementToReturn = NULL; + v1_status_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); + elementToReturn = v1_status_parseFromJSON(NetworkingV1APIlocalVarJSON); cJSON_Delete(NetworkingV1APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -4074,7 +4145,13 @@ NetworkingV1API_listNamespacedNetworkPolicy(apiClient_t *apiClient, char *_names 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; @@ -4087,125 +4164,65 @@ NetworkingV1API_listNamespacedNetworkPolicy(apiClient_t *apiClient, char *_names keyValuePair_free(keyPairQuery_pretty); keyPairQuery_pretty = NULL; } - if(keyQuery_allowWatchBookmarks){ - free(keyQuery_allowWatchBookmarks); - keyQuery_allowWatchBookmarks = NULL; + if(keyQuery_dryRun){ + free(keyQuery_dryRun); + keyQuery_dryRun = NULL; } - if(valueQuery_allowWatchBookmarks){ - free(valueQuery_allowWatchBookmarks); - valueQuery_allowWatchBookmarks = NULL; + if(valueQuery_dryRun){ + free(valueQuery_dryRun); + valueQuery_dryRun = NULL; } - if(keyPairQuery_allowWatchBookmarks){ - keyValuePair_free(keyPairQuery_allowWatchBookmarks); - keyPairQuery_allowWatchBookmarks = NULL; + if(keyPairQuery_dryRun){ + keyValuePair_free(keyPairQuery_dryRun); + keyPairQuery_dryRun = NULL; } - if(keyQuery__continue){ - free(keyQuery__continue); - keyQuery__continue = NULL; + if(keyQuery_gracePeriodSeconds){ + free(keyQuery_gracePeriodSeconds); + keyQuery_gracePeriodSeconds = NULL; } - if(valueQuery__continue){ - free(valueQuery__continue); - valueQuery__continue = NULL; + if(valueQuery_gracePeriodSeconds){ + free(valueQuery_gracePeriodSeconds); + valueQuery_gracePeriodSeconds = NULL; } - if(keyPairQuery__continue){ - keyValuePair_free(keyPairQuery__continue); - keyPairQuery__continue = NULL; + if(keyPairQuery_gracePeriodSeconds){ + keyValuePair_free(keyPairQuery_gracePeriodSeconds); + keyPairQuery_gracePeriodSeconds = NULL; } - if(keyQuery_fieldSelector){ - free(keyQuery_fieldSelector); - keyQuery_fieldSelector = NULL; + if(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; } - if(valueQuery_fieldSelector){ - free(valueQuery_fieldSelector); - valueQuery_fieldSelector = NULL; + if(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + free(valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + valueQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; } - if(keyPairQuery_fieldSelector){ - keyValuePair_free(keyPairQuery_fieldSelector); - keyPairQuery_fieldSelector = NULL; + if(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential){ + keyValuePair_free(keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential); + keyPairQuery_ignoreStoreReadErrorWithClusterBreakingPotential = NULL; } - if(keyQuery_labelSelector){ - free(keyQuery_labelSelector); - keyQuery_labelSelector = NULL; + if(keyQuery_orphanDependents){ + free(keyQuery_orphanDependents); + keyQuery_orphanDependents = NULL; } - if(valueQuery_labelSelector){ - free(valueQuery_labelSelector); - valueQuery_labelSelector = NULL; + if(valueQuery_orphanDependents){ + free(valueQuery_orphanDependents); + valueQuery_orphanDependents = 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(keyPairQuery_orphanDependents){ + keyValuePair_free(keyPairQuery_orphanDependents); + keyPairQuery_orphanDependents = NULL; } - if(keyQuery_watch){ - free(keyQuery_watch); - keyQuery_watch = NULL; + if(keyQuery_propagationPolicy){ + free(keyQuery_propagationPolicy); + keyQuery_propagationPolicy = NULL; } - if(valueQuery_watch){ - free(valueQuery_watch); - valueQuery_watch = NULL; + if(valueQuery_propagationPolicy){ + free(valueQuery_propagationPolicy); + valueQuery_propagationPolicy = NULL; } - if(keyPairQuery_watch){ - keyValuePair_free(keyPairQuery_watch); - keyPairQuery_watch = NULL; + if(keyPairQuery_propagationPolicy){ + keyValuePair_free(keyPairQuery_propagationPolicy); + keyPairQuery_propagationPolicy = NULL; } return elementToReturn; end: @@ -4214,10 +4231,10 @@ NetworkingV1API_listNamespacedNetworkPolicy(apiClient_t *apiClient, char *_names } -// list or watch objects of kind NetworkPolicy +// delete a ServiceCIDR // -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_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; @@ -4231,73 +4248,23 @@ NetworkingV1API_listNetworkPolicyForAllNamespaces(apiClient_t *apiClient, int *a apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/networking.k8s.io/v1/networkpolicies"); - - - + char *localVarPath = strdup("/apis/networking.k8s.io/v1/servicecidrs/{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; @@ -4312,74 +4279,4462 @@ NetworkingV1API_listNetworkPolicyForAllNamespaces(apiClient_t *apiClient, int *a } // 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/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(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; + } + 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 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; + } + } + + //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 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) +{ + 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/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 + 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 + 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 +// +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 = 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/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 + 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 + 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 +// +v1_ip_address_t* +NetworkingV1API_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/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); } list_addElement(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, @@ -4400,10 +8755,10 @@ NetworkingV1API_listNetworkPolicyForAllNamespaces(apiClient_t *apiClient, int *a // printf("%s\n","Unauthorized"); //} //nonprimitive not container - v1_network_policy_list_t *elementToReturn = NULL; + v1_ip_address_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); + elementToReturn = v1_ip_address_parseFromJSON(NetworkingV1APIlocalVarJSON); cJSON_Delete(NetworkingV1APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -4422,66 +8777,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; @@ -4494,66 +8790,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); @@ -4561,16 +8797,16 @@ 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; @@ -4607,74 +8843,134 @@ NetworkingV1API_patchIngressClass(apiClient_t *apiClient, char *name, object_t * 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_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; + } } - // 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; + } + 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; - // 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); +} + +// read the specified Ingress +// +v1_ingress_t* +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 = 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); - // 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); + // 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"); - // Body Param - cJSON *localVarSingleItemJSON_body = NULL; - if (body != NULL) + localVarPath = strReplace(localVarPath, localVarToReplace__namespace, _namespace); + + + + // query parameters + char *keyQuery_pretty = NULL; + char * valueQuery_pretty = NULL; + keyValuePair_t *keyPairQuery_pretty = 0; + if (pretty) { - //not string, not binary - localVarSingleItemJSON_body = object_convertToJSON(body); - localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); - localVarBodyLength = strlen(localVarBodyParameters); + 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 - 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, @@ -4684,25 +8980,21 @@ NetworkingV1API_patchIngressClass(apiClient_t *apiClient, char *name, object_t * localVarContentType, localVarBodyParameters, localVarBodyLength, - "PATCH"); + "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 - v1_ingress_class_t *elementToReturn = NULL; + v1_ingress_t *elementToReturn = NULL; if(apiClient->response_code >= 200 && apiClient->response_code < 300) { cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - elementToReturn = v1_ingress_class_parseFromJSON(NetworkingV1APIlocalVarJSON); + elementToReturn = v1_ingress_parseFromJSON(NetworkingV1APIlocalVarJSON); cJSON_Delete(NetworkingV1APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -4719,14 +9011,10 @@ 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); + free(localVarToReplace__namespace); if(keyQuery_pretty){ free(keyQuery_pretty); keyQuery_pretty = NULL; @@ -4739,54 +9027,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); @@ -4794,16 +9034,16 @@ NetworkingV1API_patchIngressClass(apiClient_t *apiClient, char *name, object_t * } -// partially update the specified Ingress +// read status of 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_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; @@ -4811,7 +9051,7 @@ NetworkingV1API_patchNamespacedIngress(apiClient_t *apiClient, char *name, char apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status"); if(!name) goto end; @@ -4852,74 +9092,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) - { - //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, @@ -4929,17 +9105,13 @@ NetworkingV1API_patchNamespacedIngress(apiClient_t *apiClient, char *name, char localVarContentType, localVarBodyParameters, localVarBodyLength, - "PATCH"); + "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"); //} @@ -4951,87 +9123,34 @@ NetworkingV1API_patchNamespacedIngress(apiClient_t *apiClient, char *name, char 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; + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + apiClient->dataReceived = NULL; + apiClient->dataReceivedLen = 0; } - if(valueQuery_force){ - free(valueQuery_force); - valueQuery_force = 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(keyPairQuery_force){ - keyValuePair_free(keyPairQuery_force); - keyPairQuery_force = NULL; + if(valueQuery_pretty){ + free(valueQuery_pretty); + valueQuery_pretty = NULL; + } + if(keyPairQuery_pretty){ + keyValuePair_free(keyPairQuery_pretty); + keyPairQuery_pretty = NULL; } return elementToReturn; end: @@ -5040,16 +9159,16 @@ NetworkingV1API_patchNamespacedIngress(apiClient_t *apiClient, char *name, char } -// partially update status of the specified Ingress +// read the specified NetworkPolicy // -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) +v1_network_policy_t* +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; @@ -5057,7 +9176,7 @@ NetworkingV1API_patchNamespacedIngressStatus(apiClient_t *apiClient, char *name, apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}"); if(!name) goto end; @@ -5098,74 +9217,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) - { - //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, @@ -5175,25 +9230,21 @@ NetworkingV1API_patchNamespacedIngressStatus(apiClient_t *apiClient, char *name, localVarContentType, localVarBodyParameters, localVarBodyLength, - "PATCH"); + "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 - v1_ingress_t *elementToReturn = NULL; + v1_network_policy_t *elementToReturn = NULL; if(apiClient->response_code >= 200 && apiClient->response_code < 300) { cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - elementToReturn = v1_ingress_parseFromJSON(NetworkingV1APIlocalVarJSON); + elementToReturn = v1_network_policy_parseFromJSON(NetworkingV1APIlocalVarJSON); cJSON_Delete(NetworkingV1APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -5210,15 +9261,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; @@ -5231,54 +9277,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); @@ -5286,16 +9284,16 @@ NetworkingV1API_patchNamespacedIngressStatus(apiClient_t *apiClient, char *name, } -// partially update the specified NetworkPolicy +// read the specified ServiceCIDR // -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) +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 = list_createList(); + list_t *localVarContentType = NULL; char *localVarBodyParameters = NULL; size_t localVarBodyLength = 0; @@ -5303,16 +9301,14 @@ NetworkingV1API_patchNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/servicecidrs/{name}"); if(!name) goto end; - if(!_namespace) - goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5321,16 +9317,6 @@ NetworkingV1API_patchNamespacedNetworkPolicy(apiClient_t *apiClient, char *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 @@ -5339,79 +9325,15 @@ NetworkingV1API_patchNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, keyValuePair_t *keyPairQuery_pretty = 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); + 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 - 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, @@ -5421,25 +9343,21 @@ NetworkingV1API_patchNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, localVarContentType, localVarBodyParameters, localVarBodyLength, - "PATCH"); + "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 - v1_network_policy_t *elementToReturn = NULL; + v1_service_cidr_t *elementToReturn = NULL; if(apiClient->response_code >= 200 && apiClient->response_code < 300) { cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - elementToReturn = v1_network_policy_parseFromJSON(NetworkingV1APIlocalVarJSON); + elementToReturn = v1_service_cidr_parseFromJSON(NetworkingV1APIlocalVarJSON); cJSON_Delete(NetworkingV1APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -5456,15 +9374,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; @@ -5477,54 +9389,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); @@ -5532,10 +9396,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; @@ -5549,7 +9413,7 @@ NetworkingV1API_readIngressClass(apiClient_t *apiClient, char *name, char *prett apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/networking.k8s.io/v1/ingressclasses/{name}"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/servicecidrs/{name}/status"); if(!name) goto end; @@ -5602,10 +9466,10 @@ NetworkingV1API_readIngressClass(apiClient_t *apiClient, char *name, char *prett // printf("%s\n","Unauthorized"); //} //nonprimitive not container - v1_ingress_class_t *elementToReturn = NULL; + v1_service_cidr_t *elementToReturn = NULL; if(apiClient->response_code >= 200 && apiClient->response_code < 300) { cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - elementToReturn = v1_ingress_class_parseFromJSON(NetworkingV1APIlocalVarJSON); + elementToReturn = v1_service_cidr_parseFromJSON(NetworkingV1APIlocalVarJSON); cJSON_Delete(NetworkingV1APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -5644,10 +9508,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; @@ -5661,16 +9525,14 @@ NetworkingV1API_readNamespacedIngress(apiClient_t *apiClient, char *name, char * apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/ipaddresses/{name}"); if(!name) goto end; - if(!_namespace) - goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5679,16 +9541,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 + 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 @@ -5702,6 +9554,52 @@ 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 @@ -5715,21 +9613,25 @@ NetworkingV1API_readNamespacedIngress(apiClient_t *apiClient, char *name, char * localVarContentType, localVarBodyParameters, localVarBodyLength, - "GET"); + "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_ingress_t *elementToReturn = NULL; + v1_ip_address_t *elementToReturn = NULL; if(apiClient->response_code >= 200 && apiClient->response_code < 300) { cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - elementToReturn = v1_ingress_parseFromJSON(NetworkingV1APIlocalVarJSON); + elementToReturn = v1_ip_address_parseFromJSON(NetworkingV1APIlocalVarJSON); cJSON_Delete(NetworkingV1APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -5749,7 +9651,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; @@ -5762,6 +9668,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); @@ -5769,10 +9711,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; @@ -5786,16 +9728,14 @@ NetworkingV1API_readNamespacedIngressStatus(apiClient_t *apiClient, char *name, apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/ingressclasses/{name}"); if(!name) goto end; - if(!_namespace) - goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -5804,16 +9744,6 @@ NetworkingV1API_readNamespacedIngressStatus(apiClient_t *apiClient, char *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 @@ -5822,10 +9752,56 @@ NetworkingV1API_readNamespacedIngressStatus(apiClient_t *apiClient, char *name, keyValuePair_t *keyPairQuery_pretty = 0; if (pretty) { - keyQuery_pretty = strdup("pretty"); - valueQuery_pretty = strdup((pretty)); - keyPairQuery_pretty = keyValuePair_create(keyQuery_pretty, valueQuery_pretty); - list_addElement(localVarQueryParameters,keyPairQuery_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_ingress_class_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + localVarBodyLength = strlen(localVarBodyParameters); } list_addElement(localVarHeaderType,"application/json"); //produces list_addElement(localVarHeaderType,"application/yaml"); //produces @@ -5840,21 +9816,25 @@ NetworkingV1API_readNamespacedIngressStatus(apiClient_t *apiClient, char *name, localVarContentType, localVarBodyParameters, localVarBodyLength, - "GET"); + "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_ingress_t *elementToReturn = NULL; + v1_ingress_class_t *elementToReturn = NULL; if(apiClient->response_code >= 200 && apiClient->response_code < 300) { cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - elementToReturn = v1_ingress_parseFromJSON(NetworkingV1APIlocalVarJSON); + elementToReturn = v1_ingress_class_parseFromJSON(NetworkingV1APIlocalVarJSON); cJSON_Delete(NetworkingV1APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -5874,7 +9854,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; @@ -5887,6 +9871,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); @@ -5894,10 +9914,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; @@ -5911,7 +9931,7 @@ NetworkingV1API_readNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/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; @@ -5952,6 +9972,52 @@ 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 @@ -5965,21 +10031,25 @@ NetworkingV1API_readNamespacedNetworkPolicy(apiClient_t *apiClient, char *name, localVarContentType, localVarBodyParameters, localVarBodyLength, - "GET"); + "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_network_policy_t *elementToReturn = NULL; + v1_ingress_t *elementToReturn = NULL; if(apiClient->response_code >= 200 && apiClient->response_code < 300) { cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - elementToReturn = v1_network_policy_parseFromJSON(NetworkingV1APIlocalVarJSON); + elementToReturn = v1_ingress_parseFromJSON(NetworkingV1APIlocalVarJSON); cJSON_Delete(NetworkingV1APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -6000,6 +10070,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; @@ -6012,6 +10087,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); @@ -6019,10 +10130,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; @@ -6036,14 +10147,16 @@ NetworkingV1API_replaceIngressClass(apiClient_t *apiClient, char *name, v1_ingre apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/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 + sizeof("{ name }") - 1; + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -6052,6 +10165,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 @@ -6107,7 +10230,7 @@ NetworkingV1API_replaceIngressClass(apiClient_t *apiClient, char *name, v1_ingre if (body != NULL) { //not string, not binary - localVarSingleItemJSON_body = v1_ingress_class_convertToJSON(body); + localVarSingleItemJSON_body = v1_ingress_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); localVarBodyLength = strlen(localVarBodyParameters); } @@ -6139,10 +10262,10 @@ NetworkingV1API_replaceIngressClass(apiClient_t *apiClient, char *name, v1_ingre // printf("%s\n","Unauthorized"); //} //nonprimitive not container - v1_ingress_class_t *elementToReturn = NULL; + v1_ingress_t *elementToReturn = NULL; if(apiClient->response_code >= 200 && apiClient->response_code < 300) { cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - elementToReturn = v1_ingress_class_parseFromJSON(NetworkingV1APIlocalVarJSON); + elementToReturn = v1_ingress_parseFromJSON(NetworkingV1APIlocalVarJSON); cJSON_Delete(NetworkingV1APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -6162,6 +10285,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; @@ -6222,10 +10346,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; @@ -6239,7 +10363,7 @@ NetworkingV1API_replaceNamespacedIngress(apiClient_t *apiClient, char *name, cha apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/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; @@ -6322,7 +10446,7 @@ NetworkingV1API_replaceNamespacedIngress(apiClient_t *apiClient, char *name, cha if (body != NULL) { //not string, not binary - localVarSingleItemJSON_body = v1_ingress_convertToJSON(body); + localVarSingleItemJSON_body = v1_network_policy_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); localVarBodyLength = strlen(localVarBodyParameters); } @@ -6354,10 +10478,10 @@ NetworkingV1API_replaceNamespacedIngress(apiClient_t *apiClient, char *name, cha // printf("%s\n","Unauthorized"); //} //nonprimitive not container - v1_ingress_t *elementToReturn = NULL; + v1_network_policy_t *elementToReturn = NULL; if(apiClient->response_code >= 200 && apiClient->response_code < 300) { cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - elementToReturn = v1_ingress_parseFromJSON(NetworkingV1APIlocalVarJSON); + elementToReturn = v1_network_policy_parseFromJSON(NetworkingV1APIlocalVarJSON); cJSON_Delete(NetworkingV1APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -6438,10 +10562,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; @@ -6455,16 +10579,14 @@ NetworkingV1API_replaceNamespacedIngressStatus(apiClient_t *apiClient, char *nam apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/servicecidrs/{name}"); if(!name) goto end; - if(!_namespace) - goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -6473,16 +10595,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 + 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 @@ -6538,7 +10650,7 @@ NetworkingV1API_replaceNamespacedIngressStatus(apiClient_t *apiClient, char *nam if (body != NULL) { //not string, not binary - localVarSingleItemJSON_body = v1_ingress_convertToJSON(body); + localVarSingleItemJSON_body = v1_service_cidr_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); localVarBodyLength = strlen(localVarBodyParameters); } @@ -6570,10 +10682,10 @@ NetworkingV1API_replaceNamespacedIngressStatus(apiClient_t *apiClient, char *nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - v1_ingress_t *elementToReturn = NULL; + v1_service_cidr_t *elementToReturn = NULL; if(apiClient->response_code >= 200 && apiClient->response_code < 300) { cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - elementToReturn = v1_ingress_parseFromJSON(NetworkingV1APIlocalVarJSON); + elementToReturn = v1_service_cidr_parseFromJSON(NetworkingV1APIlocalVarJSON); cJSON_Delete(NetworkingV1APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -6593,7 +10705,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; @@ -6654,10 +10765,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; @@ -6671,16 +10782,14 @@ NetworkingV1API_replaceNamespacedNetworkPolicy(apiClient_t *apiClient, char *nam apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}"); + char *localVarPath = strdup("/apis/networking.k8s.io/v1/servicecidrs/{name}/status"); if(!name) goto end; - if(!_namespace) - goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -6689,16 +10798,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 + 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 @@ -6754,7 +10853,7 @@ NetworkingV1API_replaceNamespacedNetworkPolicy(apiClient_t *apiClient, char *nam if (body != NULL) { //not string, not binary - localVarSingleItemJSON_body = v1_network_policy_convertToJSON(body); + localVarSingleItemJSON_body = v1_service_cidr_convertToJSON(body); localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); localVarBodyLength = strlen(localVarBodyParameters); } @@ -6786,10 +10885,10 @@ NetworkingV1API_replaceNamespacedNetworkPolicy(apiClient_t *apiClient, char *nam // printf("%s\n","Unauthorized"); //} //nonprimitive not container - v1_network_policy_t *elementToReturn = NULL; + v1_service_cidr_t *elementToReturn = NULL; if(apiClient->response_code >= 200 && apiClient->response_code < 300) { cJSON *NetworkingV1APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - elementToReturn = v1_network_policy_parseFromJSON(NetworkingV1APIlocalVarJSON); + elementToReturn = v1_service_cidr_parseFromJSON(NetworkingV1APIlocalVarJSON); cJSON_Delete(NetworkingV1APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -6809,7 +10908,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 ceaf7f2c..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,6 +45,18 @@ 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* @@ -53,6 +75,18 @@ 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); +// 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* @@ -71,12 +105,24 @@ 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); +// 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 // 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/ResourceV1alpha3API.c b/kubernetes/api/ResourceV1alpha3API.c index d7bec28b..1ebdc26e 100644 --- a/kubernetes/api/ResourceV1alpha3API.c +++ b/kubernetes/api/ResourceV1alpha3API.c @@ -201,6 +201,200 @@ ResourceV1alpha3API_createDeviceClass(apiClient_t *apiClient, v1alpha3_device_cl } +// 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; + +} + // create a ResourceClaim // v1alpha3_resource_claim_t* @@ -1241,10 +1435,10 @@ ResourceV1alpha3API_deleteCollectionDeviceClass(apiClient_t *apiClient, char *pr } -// delete collection of ResourceClaim +// delete collection of DeviceTaintRule // v1_status_t* -ResourceV1alpha3API_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) +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; @@ -1258,21 +1452,9 @@ ResourceV1alpha3API_deleteCollectionNamespacedResourceClaim(apiClient_t *apiClie apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims"); - - if(!_namespace) - goto end; - + char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/devicetaintrules"); - // 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); @@ -1505,7 +1687,6 @@ ResourceV1alpha3API_deleteCollectionNamespacedResourceClaim(apiClient_t *apiClie list_freeList(localVarHeaderType); free(localVarPath); - free(localVarToReplace__namespace); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); localVarSingleItemJSON_body = NULL; @@ -1686,10 +1867,10 @@ ResourceV1alpha3API_deleteCollectionNamespacedResourceClaim(apiClient_t *apiClie } -// delete collection of ResourceClaimTemplate +// delete collection of ResourceClaim // v1_status_t* -ResourceV1alpha3API_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) +ResourceV1alpha3API_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; @@ -1703,7 +1884,7 @@ ResourceV1alpha3API_deleteCollectionNamespacedResourceClaimTemplate(apiClient_t apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaimtemplates"); + char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims"); if(!_namespace) goto end; @@ -2131,10 +2312,10 @@ ResourceV1alpha3API_deleteCollectionNamespacedResourceClaimTemplate(apiClient_t } -// delete collection of ResourceSlice +// delete collection of ResourceClaimTemplate // v1_status_t* -ResourceV1alpha3API_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) +ResourceV1alpha3API_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; @@ -2148,9 +2329,21 @@ ResourceV1alpha3API_deleteCollectionResourceSlice(apiClient_t *apiClient, char * apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/resourceslices"); + char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/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); @@ -2383,6 +2576,7 @@ ResourceV1alpha3API_deleteCollectionResourceSlice(apiClient_t *apiClient, char * list_freeList(localVarHeaderType); free(localVarPath); + free(localVarToReplace__namespace); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); localVarSingleItemJSON_body = NULL; @@ -2563,10 +2757,10 @@ ResourceV1alpha3API_deleteCollectionResourceSlice(apiClient_t *apiClient, char * } -// delete a DeviceClass +// delete collection of ResourceSlice // -v1alpha3_device_class_t* -ResourceV1alpha3API_deleteDeviceClass(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +v1_status_t* +ResourceV1alpha3API_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; @@ -2580,21 +2774,9 @@ ResourceV1alpha3API_deleteDeviceClass(apiClient_t *apiClient, char *name, char * apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/deviceclasses/{name}"); - - if(!name) - goto end; - + char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/resourceslices"); - // 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); @@ -2611,10 +2793,22 @@ ResourceV1alpha3API_deleteDeviceClass(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__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)); @@ -2622,6 +2816,18 @@ ResourceV1alpha3API_deleteDeviceClass(apiClient_t *apiClient, char *name, char * 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; @@ -2648,6 +2854,31 @@ ResourceV1alpha3API_deleteDeviceClass(apiClient_t *apiClient, char *name, char * 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; @@ -2673,6 +2904,56 @@ ResourceV1alpha3API_deleteDeviceClass(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) @@ -2702,18 +2983,14 @@ ResourceV1alpha3API_deleteDeviceClass(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 - v1alpha3_device_class_t *elementToReturn = NULL; + v1_status_t *elementToReturn = NULL; if(apiClient->response_code >= 200 && apiClient->response_code < 300) { cJSON *ResourceV1alpha3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - elementToReturn = v1alpha3_device_class_parseFromJSON(ResourceV1alpha3APIlocalVarJSON); + elementToReturn = v1_status_parseFromJSON(ResourceV1alpha3APIlocalVarJSON); cJSON_Delete(ResourceV1alpha3APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -2732,7 +3009,6 @@ ResourceV1alpha3API_deleteDeviceClass(apiClient_t *apiClient, char *name, char * list_freeList(localVarHeaderType); free(localVarPath); - free(localVarToReplace_name); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); localVarSingleItemJSON_body = NULL; @@ -2750,6 +3026,18 @@ ResourceV1alpha3API_deleteDeviceClass(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; @@ -2762,6 +3050,18 @@ ResourceV1alpha3API_deleteDeviceClass(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; @@ -2786,6 +3086,30 @@ ResourceV1alpha3API_deleteDeviceClass(apiClient_t *apiClient, char *name, char * 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; @@ -2810,6 +3134,54 @@ ResourceV1alpha3API_deleteDeviceClass(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); @@ -2817,10 +3189,10 @@ ResourceV1alpha3API_deleteDeviceClass(apiClient_t *apiClient, char *name, char * } -// delete a ResourceClaim +// delete a DeviceClass // -v1alpha3_resource_claim_t* -ResourceV1alpha3API_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) +v1alpha3_device_class_t* +ResourceV1alpha3API_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; @@ -2834,16 +3206,14 @@ ResourceV1alpha3API_deleteNamespacedResourceClaim(apiClient_t *apiClient, char * apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims/{name}"); + char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/deviceclasses/{name}"); if(!name) goto end; - if(!_namespace) - goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -2852,16 +3222,6 @@ ResourceV1alpha3API_deleteNamespacedResourceClaim(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 @@ -2976,10 +3336,10 @@ ResourceV1alpha3API_deleteNamespacedResourceClaim(apiClient_t *apiClient, char * // printf("%s\n","Unauthorized"); //} //nonprimitive not container - v1alpha3_resource_claim_t *elementToReturn = NULL; + v1alpha3_device_class_t *elementToReturn = NULL; if(apiClient->response_code >= 200 && apiClient->response_code < 300) { cJSON *ResourceV1alpha3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - elementToReturn = v1alpha3_resource_claim_parseFromJSON(ResourceV1alpha3APIlocalVarJSON); + elementToReturn = v1alpha3_device_class_parseFromJSON(ResourceV1alpha3APIlocalVarJSON); cJSON_Delete(ResourceV1alpha3APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -2999,7 +3359,6 @@ ResourceV1alpha3API_deleteNamespacedResourceClaim(apiClient_t *apiClient, char * free(localVarPath); free(localVarToReplace_name); - free(localVarToReplace__namespace); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); localVarSingleItemJSON_body = NULL; @@ -3084,10 +3443,10 @@ ResourceV1alpha3API_deleteNamespacedResourceClaim(apiClient_t *apiClient, char * } -// delete a ResourceClaimTemplate +// delete a DeviceTaintRule // -v1alpha3_resource_claim_template_t* -ResourceV1alpha3API_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) +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; @@ -3101,16 +3460,14 @@ ResourceV1alpha3API_deleteNamespacedResourceClaimTemplate(apiClient_t *apiClient apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaimtemplates/{name}"); + char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}"); if(!name) goto end; - if(!_namespace) - goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; + long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3119,16 +3476,6 @@ ResourceV1alpha3API_deleteNamespacedResourceClaimTemplate(apiClient_t *apiClient 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 @@ -3243,10 +3590,10 @@ ResourceV1alpha3API_deleteNamespacedResourceClaimTemplate(apiClient_t *apiClient // printf("%s\n","Unauthorized"); //} //nonprimitive not container - v1alpha3_resource_claim_template_t *elementToReturn = NULL; + v1alpha3_device_taint_rule_t *elementToReturn = NULL; if(apiClient->response_code >= 200 && apiClient->response_code < 300) { cJSON *ResourceV1alpha3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - elementToReturn = v1alpha3_resource_claim_template_parseFromJSON(ResourceV1alpha3APIlocalVarJSON); + elementToReturn = v1alpha3_device_taint_rule_parseFromJSON(ResourceV1alpha3APIlocalVarJSON); cJSON_Delete(ResourceV1alpha3APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -3266,7 +3613,6 @@ ResourceV1alpha3API_deleteNamespacedResourceClaimTemplate(apiClient_t *apiClient free(localVarPath); free(localVarToReplace_name); - free(localVarToReplace__namespace); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); localVarSingleItemJSON_body = NULL; @@ -3351,10 +3697,10 @@ ResourceV1alpha3API_deleteNamespacedResourceClaimTemplate(apiClient_t *apiClient } -// delete a ResourceSlice +// delete a ResourceClaim // -v1alpha3_resource_slice_t* -ResourceV1alpha3API_deleteResourceSlice(apiClient_t *apiClient, char *name, char *pretty, char *dryRun, int *gracePeriodSeconds, int *ignoreStoreReadErrorWithClusterBreakingPotential, int *orphanDependents, char *propagationPolicy, v1_delete_options_t *body) +v1alpha3_resource_claim_t* +ResourceV1alpha3API_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; @@ -3368,14 +3714,16 @@ ResourceV1alpha3API_deleteResourceSlice(apiClient_t *apiClient, char *name, char apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/resourceslices/{name}"); + char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims/{name}"); if(!name) goto end; + if(!_namespace) + goto end; // Path Params - long sizeOfPathParams_name = strlen(name)+3 + sizeof("{ name }") - 1; + long sizeOfPathParams_name = strlen(name)+3 + strlen(_namespace)+3 + sizeof("{ name }") - 1; if(name == NULL) { goto end; } @@ -3384,6 +3732,16 @@ ResourceV1alpha3API_deleteResourceSlice(apiClient_t *apiClient, char *name, 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 @@ -3498,10 +3856,10 @@ ResourceV1alpha3API_deleteResourceSlice(apiClient_t *apiClient, char *name, char // printf("%s\n","Unauthorized"); //} //nonprimitive not container - v1alpha3_resource_slice_t *elementToReturn = NULL; + v1alpha3_resource_claim_t *elementToReturn = NULL; if(apiClient->response_code >= 200 && apiClient->response_code < 300) { cJSON *ResourceV1alpha3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - elementToReturn = v1alpha3_resource_slice_parseFromJSON(ResourceV1alpha3APIlocalVarJSON); + elementToReturn = v1alpha3_resource_claim_parseFromJSON(ResourceV1alpha3APIlocalVarJSON); cJSON_Delete(ResourceV1alpha3APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -3521,6 +3879,7 @@ ResourceV1alpha3API_deleteResourceSlice(apiClient_t *apiClient, char *name, char free(localVarPath); free(localVarToReplace_name); + free(localVarToReplace__namespace); if (localVarSingleItemJSON_body) { cJSON_Delete(localVarSingleItemJSON_body); localVarSingleItemJSON_body = NULL; @@ -3605,12 +3964,12 @@ ResourceV1alpha3API_deleteResourceSlice(apiClient_t *apiClient, char *name, char } -// get available resources +// delete a ResourceClaimTemplate // -v1_api_resource_list_t* -ResourceV1alpha3API_getAPIResources(apiClient_t *apiClient) +v1alpha3_resource_claim_template_t* +ResourceV1alpha3API_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 = NULL; + list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; list_t *localVarFormParameters = NULL; list_t *localVarHeaderType = list_createList(); @@ -3622,11 +3981,120 @@ ResourceV1alpha3API_getAPIResources(apiClient_t *apiClient) apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/"); + char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/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 @@ -3640,39 +4108,798 @@ ResourceV1alpha3API_getAPIResources(apiClient_t *apiClient) localVarContentType, localVarBodyParameters, localVarBodyLength, - "GET"); + "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_api_resource_list_t *elementToReturn = NULL; + v1alpha3_resource_claim_template_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); + elementToReturn = v1alpha3_resource_claim_template_parseFromJSON(ResourceV1alpha3APIlocalVarJSON); cJSON_Delete(ResourceV1alpha3APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; } } - - //return type - if (apiClient->dataReceived) { - free(apiClient->dataReceived); - apiClient->dataReceived = NULL; - apiClient->dataReceivedLen = 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 +// +v1alpha3_resource_slice_t* +ResourceV1alpha3API_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/v1alpha3/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 + v1alpha3_resource_slice_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1alpha3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha3_resource_slice_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 DeviceClass +// +v1alpha3_device_class_list_t* +ResourceV1alpha3API_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/v1alpha3/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 + v1alpha3_device_class_list_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1alpha3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha3_device_class_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; } - - - - list_freeList(localVarHeaderType); - - free(localVarPath); return elementToReturn; end: free(localVarPath); @@ -3680,10 +4907,10 @@ ResourceV1alpha3API_getAPIResources(apiClient_t *apiClient) } -// list or watch objects of kind DeviceClass +// list or watch objects of kind DeviceTaintRule // -v1alpha3_device_class_list_t* -ResourceV1alpha3API_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) +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; @@ -3697,7 +4924,7 @@ ResourceV1alpha3API_listDeviceClass(apiClient_t *apiClient, char *pretty, int *a apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/deviceclasses"); + char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/devicetaintrules"); @@ -3866,10 +5093,10 @@ ResourceV1alpha3API_listDeviceClass(apiClient_t *apiClient, char *pretty, int *a // printf("%s\n","Unauthorized"); //} //nonprimitive not container - v1alpha3_device_class_list_t *elementToReturn = NULL; + 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_class_list_parseFromJSON(ResourceV1alpha3APIlocalVarJSON); + elementToReturn = v1alpha3_device_taint_rule_list_parseFromJSON(ResourceV1alpha3APIlocalVarJSON); cJSON_Delete(ResourceV1alpha3APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -5725,61 +6952,294 @@ ResourceV1alpha3API_listResourceSlice(apiClient_t *apiClient, char *pretty, int free(keyQuery_resourceVersion); keyQuery_resourceVersion = NULL; } - if(valueQuery_resourceVersion){ - free(valueQuery_resourceVersion); - valueQuery_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 +// +v1alpha3_device_class_t* +ResourceV1alpha3API_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/v1alpha3/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 + v1alpha3_device_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1alpha3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha3_device_class_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_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; } - 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: @@ -5788,10 +7248,10 @@ ResourceV1alpha3API_listResourceSlice(apiClient_t *apiClient, char *pretty, int } -// partially update the specified DeviceClass +// partially update the specified DeviceTaintRule // -v1alpha3_device_class_t* -ResourceV1alpha3API_patchDeviceClass(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force) +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; @@ -5805,7 +7265,7 @@ ResourceV1alpha3API_patchDeviceClass(apiClient_t *apiClient, char *name, object_ apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/deviceclasses/{name}"); + char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}"); if(!name) goto end; @@ -5926,10 +7386,10 @@ ResourceV1alpha3API_patchDeviceClass(apiClient_t *apiClient, char *name, object_ // printf("%s\n","Unauthorized"); //} //nonprimitive not container - v1alpha3_device_class_t *elementToReturn = NULL; + 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_class_parseFromJSON(ResourceV1alpha3APIlocalVarJSON); + elementToReturn = v1alpha3_device_taint_rule_parseFromJSON(ResourceV1alpha3APIlocalVarJSON); cJSON_Delete(ResourceV1alpha3APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -6920,11 +8380,171 @@ ResourceV1alpha3API_patchResourceSlice(apiClient_t *apiClient, char *name, objec list_freeList(localVarContentType); 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; + } + 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 +// +v1alpha3_device_class_t* +ResourceV1alpha3API_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/v1alpha3/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 + v1alpha3_device_class_t *elementToReturn = NULL; + if(apiClient->response_code >= 200 && apiClient->response_code < 300) { + cJSON *ResourceV1alpha3APIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + elementToReturn = v1alpha3_device_class_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; @@ -6937,54 +8557,6 @@ ResourceV1alpha3API_patchResourceSlice(apiClient_t *apiClient, char *name, objec 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); @@ -6992,10 +8564,10 @@ ResourceV1alpha3API_patchResourceSlice(apiClient_t *apiClient, char *name, objec } -// read the specified DeviceClass +// read the specified DeviceTaintRule // -v1alpha3_device_class_t* -ResourceV1alpha3API_readDeviceClass(apiClient_t *apiClient, char *name, char *pretty) +v1alpha3_device_taint_rule_t* +ResourceV1alpha3API_readDeviceTaintRule(apiClient_t *apiClient, char *name, char *pretty) { list_t *localVarQueryParameters = list_createList(); list_t *localVarHeaderParameters = NULL; @@ -7009,7 +8581,7 @@ ResourceV1alpha3API_readDeviceClass(apiClient_t *apiClient, char *name, char *pr apiClient->response_code = 0; // create the path - char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/deviceclasses/{name}"); + char *localVarPath = strdup("/apis/resource.k8s.io/v1alpha3/devicetaintrules/{name}"); if(!name) goto end; @@ -7062,10 +8634,10 @@ ResourceV1alpha3API_readDeviceClass(apiClient_t *apiClient, char *name, char *pr // printf("%s\n","Unauthorized"); //} //nonprimitive not container - v1alpha3_device_class_t *elementToReturn = NULL; + 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_class_parseFromJSON(ResourceV1alpha3APIlocalVarJSON); + elementToReturn = v1alpha3_device_taint_rule_parseFromJSON(ResourceV1alpha3APIlocalVarJSON); cJSON_Delete(ResourceV1alpha3APIlocalVarJSON); if(elementToReturn == NULL) { // return 0; @@ -7794,6 +9366,209 @@ ResourceV1alpha3API_replaceDeviceClass(apiClient_t *apiClient, char *name, v1alp } +// 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; + +} + // replace the specified ResourceClaim // v1alpha3_resource_claim_t* diff --git a/kubernetes/api/ResourceV1alpha3API.h b/kubernetes/api/ResourceV1alpha3API.h index affe1f2b..95b17376 100644 --- a/kubernetes/api/ResourceV1alpha3API.h +++ b/kubernetes/api/ResourceV1alpha3API.h @@ -11,6 +11,8 @@ #include "../model/v1_status.h" #include "../model/v1alpha3_device_class.h" #include "../model/v1alpha3_device_class_list.h" +#include "../model/v1alpha3_device_taint_rule.h" +#include "../model/v1alpha3_device_taint_rule_list.h" #include "../model/v1alpha3_resource_claim.h" #include "../model/v1alpha3_resource_claim_list.h" #include "../model/v1alpha3_resource_claim_template.h" @@ -25,6 +27,12 @@ v1alpha3_device_class_t* ResourceV1alpha3API_createDeviceClass(apiClient_t *apiClient, v1alpha3_device_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +// 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); + + // create a ResourceClaim // v1alpha3_resource_claim_t* @@ -49,6 +57,12 @@ v1_status_t* ResourceV1alpha3API_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 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 collection of ResourceClaim // v1_status_t* @@ -73,6 +87,12 @@ v1alpha3_device_class_t* ResourceV1alpha3API_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 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); + + // delete a ResourceClaim // v1alpha3_resource_claim_t* @@ -103,6 +123,12 @@ v1alpha3_device_class_list_t* ResourceV1alpha3API_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 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 or watch objects of kind ResourceClaim // v1alpha3_resource_claim_list_t* @@ -139,6 +165,12 @@ v1alpha3_device_class_t* ResourceV1alpha3API_patchDeviceClass(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +// 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); + + // partially update the specified ResourceClaim // v1alpha3_resource_claim_t* @@ -169,6 +201,12 @@ v1alpha3_device_class_t* ResourceV1alpha3API_readDeviceClass(apiClient_t *apiClient, char *name, char *pretty); +// read the specified DeviceTaintRule +// +v1alpha3_device_taint_rule_t* +ResourceV1alpha3API_readDeviceTaintRule(apiClient_t *apiClient, char *name, char *pretty); + + // read the specified ResourceClaim // v1alpha3_resource_claim_t* @@ -199,6 +237,12 @@ v1alpha3_device_class_t* ResourceV1alpha3API_replaceDeviceClass(apiClient_t *apiClient, char *name, v1alpha3_device_class_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation); +// 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); + + // replace the specified ResourceClaim // v1alpha3_resource_claim_t* diff --git a/kubernetes/api/ResourceV1beta2API.c b/kubernetes/api/ResourceV1beta2API.c new file mode 100644 index 00000000..be1d06e2 --- /dev/null +++ b/kubernetes/api/ResourceV1beta2API.c @@ -0,0 +1,8647 @@ +#include +#include +#include +#include "ResourceV1beta2API.h" + +#define MAX_NUMBER_LENGTH 16 +#define MAX_BUFFER_LENGTH 4096 + + +// 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/VersionAPI.c b/kubernetes/api/VersionAPI.c index 0f4fbca1..98babb71 100644 --- a/kubernetes/api/VersionAPI.c +++ b/kubernetes/api/VersionAPI.c @@ -7,7 +7,7 @@ #define MAX_BUFFER_LENGTH 4096 -// get the code version +// get the version information for this server // version_info_t* VersionAPI_getCode(apiClient_t *apiClient) 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/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/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/CustomObjectsAPI.md b/kubernetes/docs/CustomObjectsAPI.md index 587cdbd0..83956792 100644 --- a/kubernetes/docs/CustomObjectsAPI.md +++ b/kubernetes/docs/CustomObjectsAPI.md @@ -18,7 +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}/{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 | @@ -530,7 +530,7 @@ Name | Type | Description | Notes ```c // list or watch namespace scoped custom objects // -object_t* CustomObjectsAPI_listCustomObjectForAllNamespaces(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); +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 @@ -539,7 +539,7 @@ 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 | -**plural** | **char \*** | The custom resource's plural name. For TPRs this would be lowercase plural kind. | +**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] diff --git a/kubernetes/docs/NetworkingV1API.md b/kubernetes/docs/NetworkingV1API.md index d19c28ae..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 @@ -123,6 +173,82 @@ Name | Type | Description | Notes [v1_network_policy_t](v1_network_policy.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_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) @@ -254,6 +380,85 @@ Name | Type | Description | Notes [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] +**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_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) @@ -364,6 +569,42 @@ Name | Type | Description | Notes [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] + +### Return type + +[v1_status_t](v1_status.md) * + + ### Authorization [BearerToken](../README.md#BearerToken) @@ -403,6 +644,45 @@ 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) +# **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) + # **NetworkingV1API_listIngressClass** ```c // list or watch objects of kind IngressClass @@ -600,28 +880,32 @@ 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) -# **NetworkingV1API_patchIngressClass** +# **NetworkingV1API_listServiceCIDR** ```c -// partially update the specified IngressClass +// list or watch objects of kind ServiceCIDR // -v1_ingress_class_t* NetworkingV1API_patchIngressClass(apiClient_t *apiClient, char *name, object_t *body, char *pretty, char *dryRun, char *fieldManager, char *fieldValidation, int *force); +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 | -**name** | **char \*** | name of the IngressClass | -**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] +**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_ingress_class_t](v1_ingress_class.md) * +[v1_service_cidr_list_t](v1_service_cidr_list.md) * ### Authorization @@ -630,7 +914,77 @@ 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, application/apply-patch+cbor + - **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) + +# **NetworkingV1API_patchIngressClass** +```c +// 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); +``` + +### Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**apiClient** | **apiClient_t \*** | context containing the client configuration | +**name** | **char \*** | name of the IngressClass | +**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_ingress_class_t](v1_ingress_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) @@ -743,6 +1097,106 @@ 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) +# **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) + # **NetworkingV1API_readIngressClass** ```c // read the specified IngressClass @@ -855,6 +1309,100 @@ Name | Type | Description | Notes [v1_network_policy_t](v1_network_policy.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_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) @@ -1005,3 +1553,71 @@ 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) +# **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/ResourceV1alpha3API.md b/kubernetes/docs/ResourceV1alpha3API.md index 5129f544..151160a7 100644 --- a/kubernetes/docs/ResourceV1alpha3API.md +++ b/kubernetes/docs/ResourceV1alpha3API.md @@ -5,35 +5,42 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- [**ResourceV1alpha3API_createDeviceClass**](ResourceV1alpha3API.md#ResourceV1alpha3API_createDeviceClass) | **POST** /apis/resource.k8s.io/v1alpha3/deviceclasses | +[**ResourceV1alpha3API_createDeviceTaintRule**](ResourceV1alpha3API.md#ResourceV1alpha3API_createDeviceTaintRule) | **POST** /apis/resource.k8s.io/v1alpha3/devicetaintrules | [**ResourceV1alpha3API_createNamespacedResourceClaim**](ResourceV1alpha3API.md#ResourceV1alpha3API_createNamespacedResourceClaim) | **POST** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims | [**ResourceV1alpha3API_createNamespacedResourceClaimTemplate**](ResourceV1alpha3API.md#ResourceV1alpha3API_createNamespacedResourceClaimTemplate) | **POST** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaimtemplates | [**ResourceV1alpha3API_createResourceSlice**](ResourceV1alpha3API.md#ResourceV1alpha3API_createResourceSlice) | **POST** /apis/resource.k8s.io/v1alpha3/resourceslices | [**ResourceV1alpha3API_deleteCollectionDeviceClass**](ResourceV1alpha3API.md#ResourceV1alpha3API_deleteCollectionDeviceClass) | **DELETE** /apis/resource.k8s.io/v1alpha3/deviceclasses | +[**ResourceV1alpha3API_deleteCollectionDeviceTaintRule**](ResourceV1alpha3API.md#ResourceV1alpha3API_deleteCollectionDeviceTaintRule) | **DELETE** /apis/resource.k8s.io/v1alpha3/devicetaintrules | [**ResourceV1alpha3API_deleteCollectionNamespacedResourceClaim**](ResourceV1alpha3API.md#ResourceV1alpha3API_deleteCollectionNamespacedResourceClaim) | **DELETE** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims | [**ResourceV1alpha3API_deleteCollectionNamespacedResourceClaimTemplate**](ResourceV1alpha3API.md#ResourceV1alpha3API_deleteCollectionNamespacedResourceClaimTemplate) | **DELETE** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaimtemplates | [**ResourceV1alpha3API_deleteCollectionResourceSlice**](ResourceV1alpha3API.md#ResourceV1alpha3API_deleteCollectionResourceSlice) | **DELETE** /apis/resource.k8s.io/v1alpha3/resourceslices | [**ResourceV1alpha3API_deleteDeviceClass**](ResourceV1alpha3API.md#ResourceV1alpha3API_deleteDeviceClass) | **DELETE** /apis/resource.k8s.io/v1alpha3/deviceclasses/{name} | +[**ResourceV1alpha3API_deleteDeviceTaintRule**](ResourceV1alpha3API.md#ResourceV1alpha3API_deleteDeviceTaintRule) | **DELETE** /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name} | [**ResourceV1alpha3API_deleteNamespacedResourceClaim**](ResourceV1alpha3API.md#ResourceV1alpha3API_deleteNamespacedResourceClaim) | **DELETE** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims/{name} | [**ResourceV1alpha3API_deleteNamespacedResourceClaimTemplate**](ResourceV1alpha3API.md#ResourceV1alpha3API_deleteNamespacedResourceClaimTemplate) | **DELETE** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaimtemplates/{name} | [**ResourceV1alpha3API_deleteResourceSlice**](ResourceV1alpha3API.md#ResourceV1alpha3API_deleteResourceSlice) | **DELETE** /apis/resource.k8s.io/v1alpha3/resourceslices/{name} | [**ResourceV1alpha3API_getAPIResources**](ResourceV1alpha3API.md#ResourceV1alpha3API_getAPIResources) | **GET** /apis/resource.k8s.io/v1alpha3/ | [**ResourceV1alpha3API_listDeviceClass**](ResourceV1alpha3API.md#ResourceV1alpha3API_listDeviceClass) | **GET** /apis/resource.k8s.io/v1alpha3/deviceclasses | +[**ResourceV1alpha3API_listDeviceTaintRule**](ResourceV1alpha3API.md#ResourceV1alpha3API_listDeviceTaintRule) | **GET** /apis/resource.k8s.io/v1alpha3/devicetaintrules | [**ResourceV1alpha3API_listNamespacedResourceClaim**](ResourceV1alpha3API.md#ResourceV1alpha3API_listNamespacedResourceClaim) | **GET** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims | [**ResourceV1alpha3API_listNamespacedResourceClaimTemplate**](ResourceV1alpha3API.md#ResourceV1alpha3API_listNamespacedResourceClaimTemplate) | **GET** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaimtemplates | [**ResourceV1alpha3API_listResourceClaimForAllNamespaces**](ResourceV1alpha3API.md#ResourceV1alpha3API_listResourceClaimForAllNamespaces) | **GET** /apis/resource.k8s.io/v1alpha3/resourceclaims | [**ResourceV1alpha3API_listResourceClaimTemplateForAllNamespaces**](ResourceV1alpha3API.md#ResourceV1alpha3API_listResourceClaimTemplateForAllNamespaces) | **GET** /apis/resource.k8s.io/v1alpha3/resourceclaimtemplates | [**ResourceV1alpha3API_listResourceSlice**](ResourceV1alpha3API.md#ResourceV1alpha3API_listResourceSlice) | **GET** /apis/resource.k8s.io/v1alpha3/resourceslices | [**ResourceV1alpha3API_patchDeviceClass**](ResourceV1alpha3API.md#ResourceV1alpha3API_patchDeviceClass) | **PATCH** /apis/resource.k8s.io/v1alpha3/deviceclasses/{name} | +[**ResourceV1alpha3API_patchDeviceTaintRule**](ResourceV1alpha3API.md#ResourceV1alpha3API_patchDeviceTaintRule) | **PATCH** /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name} | [**ResourceV1alpha3API_patchNamespacedResourceClaim**](ResourceV1alpha3API.md#ResourceV1alpha3API_patchNamespacedResourceClaim) | **PATCH** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims/{name} | [**ResourceV1alpha3API_patchNamespacedResourceClaimStatus**](ResourceV1alpha3API.md#ResourceV1alpha3API_patchNamespacedResourceClaimStatus) | **PATCH** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims/{name}/status | [**ResourceV1alpha3API_patchNamespacedResourceClaimTemplate**](ResourceV1alpha3API.md#ResourceV1alpha3API_patchNamespacedResourceClaimTemplate) | **PATCH** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaimtemplates/{name} | [**ResourceV1alpha3API_patchResourceSlice**](ResourceV1alpha3API.md#ResourceV1alpha3API_patchResourceSlice) | **PATCH** /apis/resource.k8s.io/v1alpha3/resourceslices/{name} | [**ResourceV1alpha3API_readDeviceClass**](ResourceV1alpha3API.md#ResourceV1alpha3API_readDeviceClass) | **GET** /apis/resource.k8s.io/v1alpha3/deviceclasses/{name} | +[**ResourceV1alpha3API_readDeviceTaintRule**](ResourceV1alpha3API.md#ResourceV1alpha3API_readDeviceTaintRule) | **GET** /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name} | [**ResourceV1alpha3API_readNamespacedResourceClaim**](ResourceV1alpha3API.md#ResourceV1alpha3API_readNamespacedResourceClaim) | **GET** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims/{name} | [**ResourceV1alpha3API_readNamespacedResourceClaimStatus**](ResourceV1alpha3API.md#ResourceV1alpha3API_readNamespacedResourceClaimStatus) | **GET** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims/{name}/status | [**ResourceV1alpha3API_readNamespacedResourceClaimTemplate**](ResourceV1alpha3API.md#ResourceV1alpha3API_readNamespacedResourceClaimTemplate) | **GET** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaimtemplates/{name} | [**ResourceV1alpha3API_readResourceSlice**](ResourceV1alpha3API.md#ResourceV1alpha3API_readResourceSlice) | **GET** /apis/resource.k8s.io/v1alpha3/resourceslices/{name} | [**ResourceV1alpha3API_replaceDeviceClass**](ResourceV1alpha3API.md#ResourceV1alpha3API_replaceDeviceClass) | **PUT** /apis/resource.k8s.io/v1alpha3/deviceclasses/{name} | +[**ResourceV1alpha3API_replaceDeviceTaintRule**](ResourceV1alpha3API.md#ResourceV1alpha3API_replaceDeviceTaintRule) | **PUT** /apis/resource.k8s.io/v1alpha3/devicetaintrules/{name} | [**ResourceV1alpha3API_replaceNamespacedResourceClaim**](ResourceV1alpha3API.md#ResourceV1alpha3API_replaceNamespacedResourceClaim) | **PUT** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims/{name} | [**ResourceV1alpha3API_replaceNamespacedResourceClaimStatus**](ResourceV1alpha3API.md#ResourceV1alpha3API_replaceNamespacedResourceClaimStatus) | **PUT** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaims/{name}/status | [**ResourceV1alpha3API_replaceNamespacedResourceClaimTemplate**](ResourceV1alpha3API.md#ResourceV1alpha3API_replaceNamespacedResourceClaimTemplate) | **PUT** /apis/resource.k8s.io/v1alpha3/namespaces/{namespace}/resourceclaimtemplates/{name} | @@ -62,6 +69,39 @@ Name | Type | Description | Notes [v1alpha3_device_class_t](v1alpha3_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) + +# **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) @@ -206,6 +246,49 @@ Name | Type | Description | Notes [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_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) @@ -373,6 +456,42 @@ Name | Type | Description | Notes [v1alpha3_device_class_t](v1alpha3_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) + +# **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) @@ -550,6 +669,45 @@ Name | Type | Description | Notes [v1alpha3_device_class_list_t](v1alpha3_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) + +# **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) @@ -782,6 +940,41 @@ Name | Type | Description | Notes [v1alpha3_device_class_t](v1alpha3_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) + +# **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) @@ -955,6 +1148,36 @@ Name | Type | Description | Notes [v1alpha3_device_class_t](v1alpha3_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) + +# **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) @@ -1112,6 +1335,40 @@ Name | Type | Description | Notes [v1alpha3_device_class_t](v1alpha3_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) + +# **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) 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/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/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/v1_container_status.md b/kubernetes/docs/v1_container_status.md index 66cf7b50..4e174b4e 100644 --- a/kubernetes/docs/v1_container_status.md +++ b/kubernetes/docs/v1_container_status.md @@ -15,6 +15,7 @@ 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] diff --git a/kubernetes/docs/v1_csi_driver_spec.md b/kubernetes/docs/v1_csi_driver_spec.md index 8fd88070..cb3567e3 100644 --- a/kubernetes/docs/v1_csi_driver_spec.md +++ b/kubernetes/docs/v1_csi_driver_spec.md @@ -5,6 +5,7 @@ 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] **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 an alpha 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_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_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..48257ee8 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. Must be a C_IDENTIFIER. | [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_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_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 31955f8f..84c63029 100644 --- a/kubernetes/docs/v1_job_spec.md +++ b/kubernetes/docs/v1_job_spec.md @@ -5,12 +5,12 @@ 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_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 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] diff --git a/kubernetes/docs/v1_job_status.md b/kubernetes/docs/v1_job_status.md index 19e82125..9945ce7a 100644 --- a/kubernetes/docs/v1_job_status.md +++ b/kubernetes/docs/v1_job_status.md @@ -8,7 +8,7 @@ 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] +**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] 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_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 d9e5fd2c..5052109d 100644 --- a/kubernetes/docs/v1_node_system_info.md +++ b/kubernetes/docs/v1_node_system_info.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **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_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_pod_affinity_term.md b/kubernetes/docs/v1_pod_affinity_term.md index 0b7cb22d..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 a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). | [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 a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default). | [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_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_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_spec.md b/kubernetes/docs/v1_pod_spec.md index fea8b220..0b8c0280 100644 --- a/kubernetes/docs/v1_pod_spec.md +++ b/kubernetes/docs/v1_pod_spec.md @@ -18,7 +18,7 @@ Name | Type | Description | Notes **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] **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] +**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] diff --git a/kubernetes/docs/v1_pod_status.md b/kubernetes/docs/v1_pod_status.md index 8e498b6f..da2d5503 100644 --- a/kubernetes/docs/v1_pod_status.md +++ b/kubernetes/docs/v1_pod_status.md @@ -11,12 +11,13 @@ Name | Type | Description | Notes **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_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_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 8c74ffb5..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 a beta 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_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_volume_error.md b/kubernetes/docs/v1_volume_error.md index 5ffd8a5a..fd66629f 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, alpha 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/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/v1alpha2_lease_candidate_spec.md b/kubernetes/docs/v1alpha2_lease_candidate_spec.md index 47149792..0ee1759a 100644 --- a/kubernetes/docs/v1alpha2_lease_candidate_spec.md +++ b/kubernetes/docs/v1alpha2_lease_candidate_spec.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **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. (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled. | +**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 index 64081579..b7f79001 100644 --- a/kubernetes/docs/v1alpha3_allocated_device_status.md +++ b/kubernetes/docs/v1alpha3_allocated_device_status.md @@ -3,7 +3,7 @@ ## 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. | [optional] +**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. | diff --git a/kubernetes/docs/v1alpha3_basic_device.md b/kubernetes/docs/v1alpha3_basic_device.md index 2ec5c89d..bf46a12d 100644 --- a/kubernetes/docs/v1alpha3_basic_device.md +++ b/kubernetes/docs/v1alpha3_basic_device.md @@ -3,8 +3,13 @@ ## 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_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_allocation_configuration.md b/kubernetes/docs/v1alpha3_device_allocation_configuration.md index fc753b2a..446a0b92 100644 --- a/kubernetes/docs/v1alpha3_device_allocation_configuration.md +++ b/kubernetes/docs/v1alpha3_device_allocation_configuration.md @@ -4,7 +4,7 @@ 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. | [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_claim_configuration.md b/kubernetes/docs/v1alpha3_device_claim_configuration.md index a71a3821..c99eb19f 100644 --- a/kubernetes/docs/v1alpha3_device_claim_configuration.md +++ b/kubernetes/docs/v1alpha3_device_claim_configuration.md @@ -4,7 +4,7 @@ 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. | [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_constraint.md b/kubernetes/docs/v1alpha3_device_constraint.md index 23e888fa..0ec4c917 100644 --- a/kubernetes/docs/v1alpha3_device_constraint.md +++ b/kubernetes/docs/v1alpha3_device_constraint.md @@ -4,7 +4,7 @@ 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. | [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 index 9cb6e24c..152d4d4e 100644 --- a/kubernetes/docs/v1alpha3_device_request.md +++ b/kubernetes/docs/v1alpha3_device_request.md @@ -3,12 +3,14 @@ ## 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. Allocation will fail if some devices are already allocated, unless adminAccess is requested. If AlloctionMode 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 request. 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. | +**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. | [optional] +**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 index 50fd4435..9db195c8 100644 --- a/kubernetes/docs/v1alpha3_device_request_allocation_result.md +++ b/kubernetes/docs/v1alpha3_device_request_allocation_result.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes **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. Multiple devices may have been allocated per request. | +**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_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 index 11d86129..efd68d48 100644 --- a/kubernetes/docs/v1alpha3_network_device_data.md +++ b/kubernetes/docs/v1alpha3_network_device_data.md @@ -5,7 +5,7 @@ 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] +**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_resource_slice_spec.md b/kubernetes/docs/v1alpha3_resource_slice_spec.md index 24b60664..b9c14b63 100644 --- a/kubernetes/docs/v1alpha3_resource_slice_spec.md +++ b/kubernetes/docs/v1alpha3_resource_slice_spec.md @@ -3,12 +3,14 @@ ## 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 and AllNodes must be set. | [optional] +**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 and AllNodes must be set. This field is immutable. | [optional] +**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 index ca90a77a..5d79fb84 100644 --- a/kubernetes/docs/v1beta1_allocated_device_status.md +++ b/kubernetes/docs/v1beta1_allocated_device_status.md @@ -3,7 +3,7 @@ ## 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. | [optional] +**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. | diff --git a/kubernetes/docs/v1beta1_basic_device.md b/kubernetes/docs/v1beta1_basic_device.md index dd513c33..24ee95c2 100644 --- a/kubernetes/docs/v1beta1_basic_device.md +++ b/kubernetes/docs/v1beta1_basic_device.md @@ -3,8 +3,13 @@ ## 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**](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_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_allocation_configuration.md b/kubernetes/docs/v1beta1_device_allocation_configuration.md index 590bd7e4..96eee1cf 100644 --- a/kubernetes/docs/v1beta1_device_allocation_configuration.md +++ b/kubernetes/docs/v1beta1_device_allocation_configuration.md @@ -4,7 +4,7 @@ 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. | [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_claim_configuration.md b/kubernetes/docs/v1beta1_device_claim_configuration.md index 800905fe..ec5680cc 100644 --- a/kubernetes/docs/v1beta1_device_claim_configuration.md +++ b/kubernetes/docs/v1beta1_device_claim_configuration.md @@ -4,7 +4,7 @@ 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. | [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_constraint.md b/kubernetes/docs/v1beta1_device_constraint.md index 0a795138..63d8d348 100644 --- a/kubernetes/docs/v1beta1_device_constraint.md +++ b/kubernetes/docs/v1beta1_device_constraint.md @@ -4,7 +4,7 @@ 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. | [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 index cdeec33f..61ee416b 100644 --- a/kubernetes/docs/v1beta1_device_request.md +++ b/kubernetes/docs/v1beta1_device_request.md @@ -3,12 +3,14 @@ ## 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. Allocation will fail if some devices are already allocated, unless adminAccess is requested. If AlloctionMode 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 request. 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 request in a pod.spec.containers[].resources.claims entry and in a constraint of the claim. 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 request. All selectors must be satisfied for a device to be considered. | [optional] +**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**](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 index cda28c35..e1cee8f3 100644 --- a/kubernetes/docs/v1beta1_device_request_allocation_result.md +++ b/kubernetes/docs/v1beta1_device_request_allocation_result.md @@ -7,7 +7,8 @@ Name | Type | Description | Notes **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. Multiple devices may have been allocated per request. | +**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**](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_sub_request.md b/kubernetes/docs/v1beta1_device_sub_request.md new file mode 100644 index 00000000..91a4c443 --- /dev/null +++ b/kubernetes/docs/v1beta1_device_sub_request.md @@ -0,0 +1,15 @@ +# 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] +**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_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_network_device_data.md b/kubernetes/docs/v1beta1_network_device_data.md index 221758b1..7968e1f1 100644 --- a/kubernetes/docs/v1beta1_network_device_data.md +++ b/kubernetes/docs/v1beta1_network_device_data.md @@ -5,7 +5,7 @@ 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] +**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_resource_slice_spec.md b/kubernetes/docs/v1beta1_resource_slice_spec.md index 4b9cc8bd..a16410c7 100644 --- a/kubernetes/docs/v1beta1_resource_slice_spec.md +++ b/kubernetes/docs/v1beta1_resource_slice_spec.md @@ -3,12 +3,14 @@ ## 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 and AllNodes must be set. | [optional] +**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 and AllNodes must be set. This field is immutable. | [optional] +**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/v1beta2_allocated_device_status.md b/kubernetes/docs/v1beta2_allocated_device_status.md new file mode 100644 index 00000000..73f28bd3 --- /dev/null +++ b/kubernetes/docs/v1beta2_allocated_device_status.md @@ -0,0 +1,15 @@ +# 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. | + +[[Back to Model list]](../README.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..745a3fb9 --- /dev/null +++ b/kubernetes/docs/v1beta2_allocation_result.md @@ -0,0 +1,11 @@ +# v1beta2_allocation_result_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**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_cel_device_selector.md b/kubernetes/docs/v1beta2_cel_device_selector.md new file mode 100644 index 00000000..d06af04a --- /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. 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..8362edc3 --- /dev/null +++ b/kubernetes/docs/v1beta2_device.md @@ -0,0 +1,17 @@ +# 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] +**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**](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..7035fea1 --- /dev/null +++ b/kubernetes/docs/v1beta2_device_capacity.md @@ -0,0 +1,10 @@ +# v1beta2_device_capacity_t + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **char \*** | Value defines how much of a certain device capacity 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_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..cb7c8c42 --- /dev/null +++ b/kubernetes/docs/v1beta2_device_class_spec.md @@ -0,0 +1,11 @@ +# 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] +**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..e7e2889f --- /dev/null +++ b/kubernetes/docs/v1beta2_device_constraint.md @@ -0,0 +1,11 @@ +# v1beta2_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/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..31bdd8ce --- /dev/null +++ b/kubernetes/docs/v1beta2_device_request_allocation_result.md @@ -0,0 +1,15 @@ +# 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] +**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**](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..a4351c15 --- /dev/null +++ b/kubernetes/docs/v1beta2_device_sub_request.md @@ -0,0 +1,15 @@ +# 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] +**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..4e2ccdcf --- /dev/null +++ b/kubernetes/docs/v1beta2_exact_device_request.md @@ -0,0 +1,15 @@ +# 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] +**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/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/model/core_v1_endpoint_port.h b/kubernetes/model/core_v1_endpoint_port.h index fb56dcd1..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_ diff --git a/kubernetes/model/v1_container_status.c b/kubernetes/model/v1_container_status.c index 9a05f7cd..a5148b4b 100644 --- a/kubernetes/model/v1_container_status.c +++ b/kubernetes/model/v1_container_status.c @@ -18,6 +18,7 @@ static v1_container_status_t *v1_container_status_create_internal( int restart_count, int started, v1_container_state_t *state, + char *stop_signal, v1_container_user_t *user, list_t *volume_mounts ) { @@ -37,6 +38,7 @@ static v1_container_status_t *v1_container_status_create_internal( 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; @@ -57,6 +59,7 @@ __attribute__((deprecated)) 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 ) { @@ -73,6 +76,7 @@ __attribute__((deprecated)) v1_container_status_t *v1_container_status_create( restart_count, started, state, + stop_signal, user, volume_mounts ); @@ -132,6 +136,10 @@ 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; @@ -289,6 +297,14 @@ 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); @@ -532,6 +548,18 @@ v1_container_status_t *v1_container_status_parseFromJSON(cJSON *v1_container_sta 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)) { @@ -579,6 +607,7 @@ 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 ); diff --git a/kubernetes/model/v1_container_status.h b/kubernetes/model/v1_container_status.h index 63c9fb7d..cb804eb1 100644 --- a/kubernetes/model/v1_container_status.h +++ b/kubernetes/model/v1_container_status.h @@ -36,6 +36,7 @@ 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 @@ -55,6 +56,7 @@ __attribute__((deprecated)) 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_csi_driver_spec.c b/kubernetes/model/v1_csi_driver_spec.c index 8f460a35..eabf01fe 100644 --- a/kubernetes/model/v1_csi_driver_spec.c +++ b/kubernetes/model/v1_csi_driver_spec.c @@ -8,6 +8,7 @@ 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 @@ static v1_csi_driver_spec_t *v1_csi_driver_spec_create_internal( } 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; @@ -35,6 +37,7 @@ static v1_csi_driver_spec_t *v1_csi_driver_spec_create_internal( __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, @@ -45,6 +48,7 @@ __attribute__((deprecated)) v1_csi_driver_spec_t *v1_csi_driver_spec_create( 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, @@ -103,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) { @@ -213,6 +225,18 @@ 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)) { @@ -311,6 +335,7 @@ 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_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 12d802af..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 @@ -35,6 +36,7 @@ typedef struct v1_csi_driver_spec_t { __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_deployment_status.c b/kubernetes/model/v1_deployment_status.c index 8947301e..75276cce 100644 --- a/kubernetes/model/v1_deployment_status.c +++ b/kubernetes/model/v1_deployment_status.c @@ -12,6 +12,7 @@ static v1_deployment_status_t *v1_deployment_status_create_internal( long observed_generation, int ready_replicas, int replicas, + int terminating_replicas, int unavailable_replicas, int updated_replicas ) { @@ -25,6 +26,7 @@ static v1_deployment_status_t *v1_deployment_status_create_internal( 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; @@ -39,6 +41,7 @@ __attribute__((deprecated)) v1_deployment_status_t *v1_deployment_status_create( long observed_generation, int ready_replicas, int replicas, + int terminating_replicas, int unavailable_replicas, int updated_replicas ) { @@ -49,6 +52,7 @@ __attribute__((deprecated)) v1_deployment_status_t *v1_deployment_status_create( observed_generation, ready_replicas, replicas, + terminating_replicas, unavailable_replicas, updated_replicas ); @@ -136,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) { @@ -250,6 +262,18 @@ 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)) { @@ -282,6 +306,7 @@ v1_deployment_status_t *v1_deployment_status_parseFromJSON(cJSON *v1_deployment_ 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 26af0f3a..b69aa432 100644 --- a/kubernetes/model/v1_deployment_status.h +++ b/kubernetes/model/v1_deployment_status.h @@ -26,6 +26,7 @@ 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 @@ -39,6 +40,7 @@ __attribute__((deprecated)) v1_deployment_status_t *v1_deployment_status_create( long observed_generation, int ready_replicas, int replicas, + int terminating_replicas, int unavailable_replicas, int updated_replicas ); diff --git a/kubernetes/model/v1_endpoint_address.h b/kubernetes/model/v1_endpoint_address.h index 46be0e2b..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_ diff --git a/kubernetes/model/v1_endpoint_hints.c b/kubernetes/model/v1_endpoint_hints.c index d1f67f8b..8e74e470 100644 --- a/kubernetes/model/v1_endpoint_hints.c +++ b/kubernetes/model/v1_endpoint_hints.c @@ -6,12 +6,14 @@ 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; @@ -19,9 +21,11 @@ static v1_endpoint_hints_t *v1_endpoint_hints_create_internal( } __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 ); } @@ -35,6 +39,13 @@ void v1_endpoint_hints_free(v1_endpoint_hints_t *v1_endpoint_hints) { 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); @@ -48,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"); @@ -79,9 +110,36 @@ 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)) { @@ -108,11 +166,21 @@ v1_endpoint_hints_t *v1_endpoint_hints_parseFromJSON(cJSON *v1_endpoint_hintsJSO 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 3257d15d..3c3e0f86 100644 --- a/kubernetes/model/v1_endpoint_hints.h +++ b/kubernetes/model/v1_endpoint_hints.h @@ -15,17 +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; __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.h b/kubernetes/model/v1_endpoint_slice.h index 84230481..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_ diff --git a/kubernetes/model/v1_endpoint_subset.h b/kubernetes/model/v1_endpoint_subset.h index 34db774a..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_ diff --git a/kubernetes/model/v1_endpoints.h b/kubernetes/model/v1_endpoints.h index d767961e..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_ diff --git a/kubernetes/model/v1_endpoints_list.h b/kubernetes/model/v1_endpoints_list.h index 4dc41eea..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_ diff --git a/kubernetes/model/v1_env_from_source.h b/kubernetes/model/v1_env_from_source.h index 4e8f997e..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_ 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_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_lifecycle.c b/kubernetes/model/v1_lifecycle.c index 10f4c9aa..20229dad 100644 --- a/kubernetes/model/v1_lifecycle.c +++ b/kubernetes/model/v1_lifecycle.c @@ -7,7 +7,8 @@ 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,6 +16,7 @@ static v1_lifecycle_t *v1_lifecycle_create_internal( } 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; @@ -22,11 +24,13 @@ static v1_lifecycle_t *v1_lifecycle_create_internal( __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 ) { return v1_lifecycle_create_internal ( post_start, - pre_stop + pre_stop, + stop_signal ); } @@ -47,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); } @@ -78,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) { @@ -114,10 +130,23 @@ v1_lifecycle_t *v1_lifecycle_parseFromJSON(cJSON *v1_lifecycleJSON){ 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_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 eae19e76..6dc4d015 100644 --- a/kubernetes/model/v1_lifecycle.h +++ b/kubernetes/model/v1_lifecycle.h @@ -22,13 +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; __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_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 d046c1b7..38ae322c 100644 --- a/kubernetes/model/v1_node_system_info.c +++ b/kubernetes/model/v1_node_system_info.c @@ -15,6 +15,7 @@ static v1_node_system_info_t *v1_node_system_info_create_internal( 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,6 +31,7 @@ static v1_node_system_info_t *v1_node_system_info_create_internal( 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; @@ -46,6 +48,7 @@ __attribute__((deprecated)) 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 ) { return v1_node_system_info_create_internal ( @@ -58,6 +61,7 @@ __attribute__((deprecated)) v1_node_system_info_t *v1_node_system_info_create( machine_id, operating_system, os_image, + swap, system_uuid ); } @@ -107,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; @@ -198,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; @@ -218,6 +239,9 @@ 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)) { @@ -353,6 +377,15 @@ 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)) { @@ -379,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 ca610318..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,6 +29,7 @@ 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? @@ -43,6 +45,7 @@ __attribute__((deprecated)) 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_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_pod_condition.c b/kubernetes/model/v1_pod_condition.c index de553078..5438b8da 100644 --- a/kubernetes/model/v1_pod_condition.c +++ b/kubernetes/model/v1_pod_condition.c @@ -9,6 +9,7 @@ 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,6 +21,7 @@ static v1_pod_condition_t *v1_pod_condition_create_internal( 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; @@ -32,6 +34,7 @@ __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 @@ -40,6 +43,7 @@ __attribute__((deprecated)) v1_pod_condition_t *v1_pod_condition_create( last_probe_time, last_transition_time, message, + observed_generation, reason, status, type @@ -109,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) { @@ -182,6 +194,18 @@ 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)) { @@ -229,6 +253,7 @@ v1_pod_condition_t *v1_pod_condition_parseFromJSON(cJSON *v1_pod_conditionJSON){ 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 6c07891f..573e687b 100644 --- a/kubernetes/model/v1_pod_condition.h +++ b/kubernetes/model/v1_pod_condition.h @@ -22,6 +22,7 @@ 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 @@ -33,6 +34,7 @@ __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_status.c b/kubernetes/model/v1_pod_status.c index e1694ce2..84716653 100644 --- a/kubernetes/model/v1_pod_status.c +++ b/kubernetes/model/v1_pod_status.c @@ -14,6 +14,7 @@ static v1_pod_status_t *v1_pod_status_create_internal( list_t *init_container_statuses, char *message, char *nominated_node_name, + long observed_generation, char *phase, char *pod_ip, list_t *pod_ips, @@ -35,6 +36,7 @@ static v1_pod_status_t *v1_pod_status_create_internal( 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; @@ -57,6 +59,7 @@ __attribute__((deprecated)) v1_pod_status_t *v1_pod_status_create( list_t *init_container_statuses, char *message, char *nominated_node_name, + long observed_generation, char *phase, char *pod_ip, list_t *pod_ips, @@ -75,6 +78,7 @@ __attribute__((deprecated)) v1_pod_status_t *v1_pod_status_create( init_container_statuses, message, nominated_node_name, + observed_generation, phase, pod_ip, pod_ips, @@ -310,6 +314,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) { @@ -586,6 +598,18 @@ 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)) { @@ -716,6 +740,7 @@ v1_pod_status_t *v1_pod_status_parseFromJSON(cJSON *v1_pod_statusJSON){ 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, diff --git a/kubernetes/model/v1_pod_status.h b/kubernetes/model/v1_pod_status.h index 55526ed8..1260fc6b 100644 --- a/kubernetes/model/v1_pod_status.h +++ b/kubernetes/model/v1_pod_status.h @@ -32,6 +32,7 @@ typedef struct v1_pod_status_t { 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 @@ -53,6 +54,7 @@ __attribute__((deprecated)) v1_pod_status_t *v1_pod_status_create( 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_replica_set_status.c b/kubernetes/model/v1_replica_set_status.c index 772a390d..503880fb 100644 --- a/kubernetes/model/v1_replica_set_status.c +++ b/kubernetes/model/v1_replica_set_status.c @@ -11,7 +11,8 @@ static v1_replica_set_status_t *v1_replica_set_status_create_internal( 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,6 +24,7 @@ static v1_replica_set_status_t *v1_replica_set_status_create_internal( 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; @@ -34,7 +36,8 @@ __attribute__((deprecated)) v1_replica_set_status_t *v1_replica_set_status_creat int fully_labeled_replicas, long observed_generation, int ready_replicas, - int replicas + int replicas, + int terminating_replicas ) { return v1_replica_set_status_create_internal ( available_replicas, @@ -42,7 +45,8 @@ __attribute__((deprecated)) v1_replica_set_status_t *v1_replica_set_status_creat fully_labeled_replicas, observed_generation, ready_replicas, - replicas + replicas, + terminating_replicas ); } @@ -128,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) { @@ -230,6 +242,18 @@ 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_internal ( available_replicas ? available_replicas->valuedouble : 0, @@ -237,7 +261,8 @@ v1_replica_set_status_t *v1_replica_set_status_parseFromJSON(cJSON *v1_replica_s 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 8f7cb388..61bd585e 100644 --- a/kubernetes/model/v1_replica_set_status.h +++ b/kubernetes/model/v1_replica_set_status.h @@ -26,6 +26,7 @@ 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; @@ -36,7 +37,8 @@ __attribute__((deprecated)) v1_replica_set_status_t *v1_replica_set_status_creat 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_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_stateful_set_spec.c b/kubernetes/model/v1_stateful_set_spec.c index 05c683de..c3152f6c 100644 --- a/kubernetes/model/v1_stateful_set_spec.c +++ b/kubernetes/model/v1_stateful_set_spec.c @@ -189,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 @@ -356,15 +355,12 @@ v1_stateful_set_spec_t *v1_stateful_set_spec_parseFromJSON(cJSON *v1_stateful_se if (cJSON_IsNull(service_name)) { service_name = NULL; } - if (!service_name) { - goto end; - } - - - 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"); @@ -420,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_volume_error.c b/kubernetes/model/v1_volume_error.c index 60f2b5b9..d50cba25 100644 --- a/kubernetes/model/v1_volume_error.c +++ b/kubernetes/model/v1_volume_error.c @@ -6,6 +6,7 @@ static v1_volume_error_t *v1_volume_error_create_internal( + int error_code, char *message, char *time ) { @@ -13,6 +14,7 @@ static v1_volume_error_t *v1_volume_error_create_internal( 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; @@ -21,10 +23,12 @@ static v1_volume_error_t *v1_volume_error_create_internal( } __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 ); @@ -53,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) { @@ -80,6 +92,18 @@ 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)) { @@ -106,6 +130,7 @@ v1_volume_error_t *v1_volume_error_parseFromJSON(cJSON *v1_volume_errorJSON){ 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 24037aba..b4210a8c 100644 --- a/kubernetes/model/v1_volume_error.h +++ b/kubernetes/model/v1_volume_error.h @@ -19,6 +19,7 @@ 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 @@ -26,6 +27,7 @@ typedef struct v1_volume_error_t { } v1_volume_error_t; __attribute__((deprecated)) v1_volume_error_t *v1_volume_error_create( + int error_code, char *message, char *time ); diff --git a/kubernetes/model/v1alpha3_basic_device.c b/kubernetes/model/v1alpha3_basic_device.c index b32372ed..5919f649 100644 --- a/kubernetes/model/v1alpha3_basic_device.c +++ b/kubernetes/model/v1alpha3_basic_device.c @@ -6,27 +6,47 @@ static v1alpha3_basic_device_t *v1alpha3_basic_device_create_internal( + int all_nodes, list_t* attributes, - list_t* capacity + list_t* capacity, + list_t *consumes_counters, + char *node_name, + v1_node_selector_t *node_selector, + list_t *taints ) { v1alpha3_basic_device_t *v1alpha3_basic_device_local_var = malloc(sizeof(v1alpha3_basic_device_t)); if (!v1alpha3_basic_device_local_var) { return NULL; } + v1alpha3_basic_device_local_var->all_nodes = all_nodes; v1alpha3_basic_device_local_var->attributes = attributes; v1alpha3_basic_device_local_var->capacity = capacity; + v1alpha3_basic_device_local_var->consumes_counters = consumes_counters; + v1alpha3_basic_device_local_var->node_name = node_name; + v1alpha3_basic_device_local_var->node_selector = node_selector; + v1alpha3_basic_device_local_var->taints = taints; v1alpha3_basic_device_local_var->_library_owned = 1; return v1alpha3_basic_device_local_var; } __attribute__((deprecated)) v1alpha3_basic_device_t *v1alpha3_basic_device_create( + int all_nodes, list_t* attributes, - list_t* capacity + list_t* capacity, + list_t *consumes_counters, + char *node_name, + v1_node_selector_t *node_selector, + list_t *taints ) { return v1alpha3_basic_device_create_internal ( + all_nodes, attributes, - capacity + capacity, + consumes_counters, + node_name, + node_selector, + taints ); } @@ -59,12 +79,42 @@ void v1alpha3_basic_device_free(v1alpha3_basic_device_t *v1alpha3_basic_device) list_freeList(v1alpha3_basic_device->capacity); v1alpha3_basic_device->capacity = NULL; } + if (v1alpha3_basic_device->consumes_counters) { + list_ForEach(listEntry, v1alpha3_basic_device->consumes_counters) { + v1alpha3_device_counter_consumption_free(listEntry->data); + } + list_freeList(v1alpha3_basic_device->consumes_counters); + v1alpha3_basic_device->consumes_counters = NULL; + } + if (v1alpha3_basic_device->node_name) { + free(v1alpha3_basic_device->node_name); + v1alpha3_basic_device->node_name = NULL; + } + if (v1alpha3_basic_device->node_selector) { + v1_node_selector_free(v1alpha3_basic_device->node_selector); + v1alpha3_basic_device->node_selector = NULL; + } + if (v1alpha3_basic_device->taints) { + list_ForEach(listEntry, v1alpha3_basic_device->taints) { + v1alpha3_device_taint_free(listEntry->data); + } + list_freeList(v1alpha3_basic_device->taints); + v1alpha3_basic_device->taints = NULL; + } free(v1alpha3_basic_device); } cJSON *v1alpha3_basic_device_convertToJSON(v1alpha3_basic_device_t *v1alpha3_basic_device) { cJSON *item = cJSON_CreateObject(); + // v1alpha3_basic_device->all_nodes + if(v1alpha3_basic_device->all_nodes) { + if(cJSON_AddBoolToObject(item, "allNodes", v1alpha3_basic_device->all_nodes) == NULL) { + goto fail; //Bool + } + } + + // v1alpha3_basic_device->attributes if(v1alpha3_basic_device->attributes) { cJSON *attributes = cJSON_AddObjectToObject(item, "attributes"); @@ -100,6 +150,67 @@ cJSON *v1alpha3_basic_device_convertToJSON(v1alpha3_basic_device_t *v1alpha3_bas } } + + // v1alpha3_basic_device->consumes_counters + if(v1alpha3_basic_device->consumes_counters) { + cJSON *consumes_counters = cJSON_AddArrayToObject(item, "consumesCounters"); + if(consumes_counters == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *consumes_countersListEntry; + if (v1alpha3_basic_device->consumes_counters) { + list_ForEach(consumes_countersListEntry, v1alpha3_basic_device->consumes_counters) { + cJSON *itemLocal = v1alpha3_device_counter_consumption_convertToJSON(consumes_countersListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(consumes_counters, itemLocal); + } + } + } + + + // v1alpha3_basic_device->node_name + if(v1alpha3_basic_device->node_name) { + if(cJSON_AddStringToObject(item, "nodeName", v1alpha3_basic_device->node_name) == NULL) { + goto fail; //String + } + } + + + // v1alpha3_basic_device->node_selector + if(v1alpha3_basic_device->node_selector) { + cJSON *node_selector_local_JSON = v1_node_selector_convertToJSON(v1alpha3_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; + } + } + + + // v1alpha3_basic_device->taints + if(v1alpha3_basic_device->taints) { + cJSON *taints = cJSON_AddArrayToObject(item, "taints"); + if(taints == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *taintsListEntry; + if (v1alpha3_basic_device->taints) { + list_ForEach(taintsListEntry, v1alpha3_basic_device->taints) { + cJSON *itemLocal = v1alpha3_device_taint_convertToJSON(taintsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(taints, itemLocal); + } + } + } + return item; fail: if (item) { @@ -118,6 +229,27 @@ v1alpha3_basic_device_t *v1alpha3_basic_device_parseFromJSON(cJSON *v1alpha3_bas // define the local map for v1alpha3_basic_device->capacity list_t *capacityList = NULL; + // define the local list for v1alpha3_basic_device->consumes_counters + list_t *consumes_countersList = NULL; + + // define the local variable for v1alpha3_basic_device->node_selector + v1_node_selector_t *node_selector_local_nonprim = NULL; + + // define the local list for v1alpha3_basic_device->taints + list_t *taintsList = NULL; + + // v1alpha3_basic_device->all_nodes + cJSON *all_nodes = cJSON_GetObjectItemCaseSensitive(v1alpha3_basic_deviceJSON, "allNodes"); + if (cJSON_IsNull(all_nodes)) { + all_nodes = NULL; + } + if (all_nodes) { + if(!cJSON_IsBool(all_nodes)) + { + goto end; //Bool + } + } + // v1alpha3_basic_device->attributes cJSON *attributes = cJSON_GetObjectItemCaseSensitive(v1alpha3_basic_deviceJSON, "attributes"); if (cJSON_IsNull(attributes)) { @@ -157,10 +289,84 @@ v1alpha3_basic_device_t *v1alpha3_basic_device_parseFromJSON(cJSON *v1alpha3_bas } } + // v1alpha3_basic_device->consumes_counters + cJSON *consumes_counters = cJSON_GetObjectItemCaseSensitive(v1alpha3_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; + } + v1alpha3_device_counter_consumption_t *consumes_countersItem = v1alpha3_device_counter_consumption_parseFromJSON(consumes_counters_local_nonprimitive); + + list_addElement(consumes_countersList, consumes_countersItem); + } + } + + // v1alpha3_basic_device->node_name + cJSON *node_name = cJSON_GetObjectItemCaseSensitive(v1alpha3_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 + } + } + + // v1alpha3_basic_device->node_selector + cJSON *node_selector = cJSON_GetObjectItemCaseSensitive(v1alpha3_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 + } + + // v1alpha3_basic_device->taints + cJSON *taints = cJSON_GetObjectItemCaseSensitive(v1alpha3_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; + } + v1alpha3_device_taint_t *taintsItem = v1alpha3_device_taint_parseFromJSON(taints_local_nonprimitive); + + list_addElement(taintsList, taintsItem); + } + } + v1alpha3_basic_device_local_var = v1alpha3_basic_device_create_internal ( + all_nodes ? all_nodes->valueint : 0, attributes ? attributesList : NULL, - capacity ? capacityList : NULL + 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 v1alpha3_basic_device_local_var; @@ -182,6 +388,28 @@ v1alpha3_basic_device_t *v1alpha3_basic_device_parseFromJSON(cJSON *v1alpha3_bas list_freeList(capacityList); capacityList = NULL; } + if (consumes_countersList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, consumes_countersList) { + v1alpha3_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) { + v1alpha3_device_taint_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(taintsList); + taintsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1alpha3_basic_device.h b/kubernetes/model/v1alpha3_basic_device.h index 1b59c0c6..299ee594 100644 --- a/kubernetes/model/v1alpha3_basic_device.h +++ b/kubernetes/model/v1alpha3_basic_device.h @@ -15,20 +15,33 @@ typedef struct v1alpha3_basic_device_t v1alpha3_basic_device_t; +#include "v1_node_selector.h" #include "v1alpha3_device_attribute.h" +#include "v1alpha3_device_counter_consumption.h" +#include "v1alpha3_device_taint.h" typedef struct v1alpha3_basic_device_t { + int all_nodes; //boolean list_t* attributes; //map 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? } v1alpha3_basic_device_t; __attribute__((deprecated)) v1alpha3_basic_device_t *v1alpha3_basic_device_create( + int all_nodes, list_t* attributes, - list_t* capacity + list_t* capacity, + list_t *consumes_counters, + char *node_name, + v1_node_selector_t *node_selector, + list_t *taints ); void v1alpha3_basic_device_free(v1alpha3_basic_device_t *v1alpha3_basic_device); diff --git a/kubernetes/model/v1alpha3_counter.c b/kubernetes/model/v1alpha3_counter.c new file mode 100644 index 00000000..465f8ca0 --- /dev/null +++ b/kubernetes/model/v1alpha3_counter.c @@ -0,0 +1,92 @@ +#include +#include +#include +#include "v1alpha3_counter.h" + + + +static v1alpha3_counter_t *v1alpha3_counter_create_internal( + char *value + ) { + v1alpha3_counter_t *v1alpha3_counter_local_var = malloc(sizeof(v1alpha3_counter_t)); + if (!v1alpha3_counter_local_var) { + return NULL; + } + v1alpha3_counter_local_var->value = value; + + v1alpha3_counter_local_var->_library_owned = 1; + return v1alpha3_counter_local_var; +} + +__attribute__((deprecated)) v1alpha3_counter_t *v1alpha3_counter_create( + char *value + ) { + return v1alpha3_counter_create_internal ( + value + ); +} + +void v1alpha3_counter_free(v1alpha3_counter_t *v1alpha3_counter) { + if(NULL == v1alpha3_counter){ + return ; + } + if(v1alpha3_counter->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha3_counter_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha3_counter->value) { + free(v1alpha3_counter->value); + v1alpha3_counter->value = NULL; + } + free(v1alpha3_counter); +} + +cJSON *v1alpha3_counter_convertToJSON(v1alpha3_counter_t *v1alpha3_counter) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha3_counter->value + if (!v1alpha3_counter->value) { + goto fail; + } + if(cJSON_AddStringToObject(item, "value", v1alpha3_counter->value) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha3_counter_t *v1alpha3_counter_parseFromJSON(cJSON *v1alpha3_counterJSON){ + + v1alpha3_counter_t *v1alpha3_counter_local_var = NULL; + + // v1alpha3_counter->value + cJSON *value = cJSON_GetObjectItemCaseSensitive(v1alpha3_counterJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } + if (!value) { + goto end; + } + + + if(!cJSON_IsString(value)) + { + goto end; //String + } + + + v1alpha3_counter_local_var = v1alpha3_counter_create_internal ( + strdup(value->valuestring) + ); + + return v1alpha3_counter_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1alpha3_counter.h b/kubernetes/model/v1alpha3_counter.h new file mode 100644 index 00000000..28ce7dea --- /dev/null +++ b/kubernetes/model/v1alpha3_counter.h @@ -0,0 +1,38 @@ +/* + * v1alpha3_counter.h + * + * Counter describes a quantity associated with a device. + */ + +#ifndef _v1alpha3_counter_H_ +#define _v1alpha3_counter_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha3_counter_t v1alpha3_counter_t; + + + + +typedef struct v1alpha3_counter_t { + char *value; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha3_counter_t; + +__attribute__((deprecated)) v1alpha3_counter_t *v1alpha3_counter_create( + char *value +); + +void v1alpha3_counter_free(v1alpha3_counter_t *v1alpha3_counter); + +v1alpha3_counter_t *v1alpha3_counter_parseFromJSON(cJSON *v1alpha3_counterJSON); + +cJSON *v1alpha3_counter_convertToJSON(v1alpha3_counter_t *v1alpha3_counter); + +#endif /* _v1alpha3_counter_H_ */ + diff --git a/kubernetes/model/v1alpha3_counter_set.c b/kubernetes/model/v1alpha3_counter_set.c new file mode 100644 index 00000000..d5bb9caf --- /dev/null +++ b/kubernetes/model/v1alpha3_counter_set.c @@ -0,0 +1,144 @@ +#include +#include +#include +#include "v1alpha3_counter_set.h" + + + +static v1alpha3_counter_set_t *v1alpha3_counter_set_create_internal( + list_t* counters, + char *name + ) { + v1alpha3_counter_set_t *v1alpha3_counter_set_local_var = malloc(sizeof(v1alpha3_counter_set_t)); + if (!v1alpha3_counter_set_local_var) { + return NULL; + } + v1alpha3_counter_set_local_var->counters = counters; + v1alpha3_counter_set_local_var->name = name; + + v1alpha3_counter_set_local_var->_library_owned = 1; + return v1alpha3_counter_set_local_var; +} + +__attribute__((deprecated)) v1alpha3_counter_set_t *v1alpha3_counter_set_create( + list_t* counters, + char *name + ) { + return v1alpha3_counter_set_create_internal ( + counters, + name + ); +} + +void v1alpha3_counter_set_free(v1alpha3_counter_set_t *v1alpha3_counter_set) { + if(NULL == v1alpha3_counter_set){ + return ; + } + if(v1alpha3_counter_set->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha3_counter_set_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha3_counter_set->counters) { + list_ForEach(listEntry, v1alpha3_counter_set->counters) { + keyValuePair_t *localKeyValue = listEntry->data; + free (localKeyValue->key); + free (localKeyValue->value); + keyValuePair_free(localKeyValue); + } + list_freeList(v1alpha3_counter_set->counters); + v1alpha3_counter_set->counters = NULL; + } + if (v1alpha3_counter_set->name) { + free(v1alpha3_counter_set->name); + v1alpha3_counter_set->name = NULL; + } + free(v1alpha3_counter_set); +} + +cJSON *v1alpha3_counter_set_convertToJSON(v1alpha3_counter_set_t *v1alpha3_counter_set) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha3_counter_set->counters + if (!v1alpha3_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 (v1alpha3_counter_set->counters) { + list_ForEach(countersListEntry, v1alpha3_counter_set->counters) { + keyValuePair_t *localKeyValue = countersListEntry->data; + } + } + + + // v1alpha3_counter_set->name + if (!v1alpha3_counter_set->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", v1alpha3_counter_set->name) == NULL) { + goto fail; //String + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha3_counter_set_t *v1alpha3_counter_set_parseFromJSON(cJSON *v1alpha3_counter_setJSON){ + + v1alpha3_counter_set_t *v1alpha3_counter_set_local_var = NULL; + + // define the local map for v1alpha3_counter_set->counters + list_t *countersList = NULL; + + // v1alpha3_counter_set->counters + cJSON *counters = cJSON_GetObjectItemCaseSensitive(v1alpha3_counter_setJSON, "counters"); + if (cJSON_IsNull(counters)) { + counters = NULL; + } + if (!counters) { + goto end; + } + + + + // The data type of the elements in v1alpha3_counter_set->counters is currently not supported. + + + // v1alpha3_counter_set->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(v1alpha3_counter_setJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + + v1alpha3_counter_set_local_var = v1alpha3_counter_set_create_internal ( + countersList, + strdup(name->valuestring) + ); + + return v1alpha3_counter_set_local_var; +end: + + // The data type of the elements in v1alpha3_counter_set->counters is currently not supported. + + return NULL; + +} diff --git a/kubernetes/model/v1alpha3_counter_set.h b/kubernetes/model/v1alpha3_counter_set.h new file mode 100644 index 00000000..a764d936 --- /dev/null +++ b/kubernetes/model/v1alpha3_counter_set.h @@ -0,0 +1,41 @@ +/* + * v1alpha3_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 _v1alpha3_counter_set_H_ +#define _v1alpha3_counter_set_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha3_counter_set_t v1alpha3_counter_set_t; + +#include "v1alpha3_counter.h" + + + +typedef struct v1alpha3_counter_set_t { + list_t* counters; //map + char *name; // string + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha3_counter_set_t; + +__attribute__((deprecated)) v1alpha3_counter_set_t *v1alpha3_counter_set_create( + list_t* counters, + char *name +); + +void v1alpha3_counter_set_free(v1alpha3_counter_set_t *v1alpha3_counter_set); + +v1alpha3_counter_set_t *v1alpha3_counter_set_parseFromJSON(cJSON *v1alpha3_counter_setJSON); + +cJSON *v1alpha3_counter_set_convertToJSON(v1alpha3_counter_set_t *v1alpha3_counter_set); + +#endif /* _v1alpha3_counter_set_H_ */ + diff --git a/kubernetes/model/v1alpha3_device_counter_consumption.c b/kubernetes/model/v1alpha3_device_counter_consumption.c new file mode 100644 index 00000000..243b951f --- /dev/null +++ b/kubernetes/model/v1alpha3_device_counter_consumption.c @@ -0,0 +1,144 @@ +#include +#include +#include +#include "v1alpha3_device_counter_consumption.h" + + + +static v1alpha3_device_counter_consumption_t *v1alpha3_device_counter_consumption_create_internal( + char *counter_set, + list_t* counters + ) { + v1alpha3_device_counter_consumption_t *v1alpha3_device_counter_consumption_local_var = malloc(sizeof(v1alpha3_device_counter_consumption_t)); + if (!v1alpha3_device_counter_consumption_local_var) { + return NULL; + } + v1alpha3_device_counter_consumption_local_var->counter_set = counter_set; + v1alpha3_device_counter_consumption_local_var->counters = counters; + + v1alpha3_device_counter_consumption_local_var->_library_owned = 1; + return v1alpha3_device_counter_consumption_local_var; +} + +__attribute__((deprecated)) v1alpha3_device_counter_consumption_t *v1alpha3_device_counter_consumption_create( + char *counter_set, + list_t* counters + ) { + return v1alpha3_device_counter_consumption_create_internal ( + counter_set, + counters + ); +} + +void v1alpha3_device_counter_consumption_free(v1alpha3_device_counter_consumption_t *v1alpha3_device_counter_consumption) { + if(NULL == v1alpha3_device_counter_consumption){ + return ; + } + if(v1alpha3_device_counter_consumption->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha3_device_counter_consumption_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha3_device_counter_consumption->counter_set) { + free(v1alpha3_device_counter_consumption->counter_set); + v1alpha3_device_counter_consumption->counter_set = NULL; + } + if (v1alpha3_device_counter_consumption->counters) { + list_ForEach(listEntry, v1alpha3_device_counter_consumption->counters) { + keyValuePair_t *localKeyValue = listEntry->data; + free (localKeyValue->key); + free (localKeyValue->value); + keyValuePair_free(localKeyValue); + } + list_freeList(v1alpha3_device_counter_consumption->counters); + v1alpha3_device_counter_consumption->counters = NULL; + } + free(v1alpha3_device_counter_consumption); +} + +cJSON *v1alpha3_device_counter_consumption_convertToJSON(v1alpha3_device_counter_consumption_t *v1alpha3_device_counter_consumption) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha3_device_counter_consumption->counter_set + if (!v1alpha3_device_counter_consumption->counter_set) { + goto fail; + } + if(cJSON_AddStringToObject(item, "counterSet", v1alpha3_device_counter_consumption->counter_set) == NULL) { + goto fail; //String + } + + + // v1alpha3_device_counter_consumption->counters + if (!v1alpha3_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 (v1alpha3_device_counter_consumption->counters) { + list_ForEach(countersListEntry, v1alpha3_device_counter_consumption->counters) { + keyValuePair_t *localKeyValue = countersListEntry->data; + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha3_device_counter_consumption_t *v1alpha3_device_counter_consumption_parseFromJSON(cJSON *v1alpha3_device_counter_consumptionJSON){ + + v1alpha3_device_counter_consumption_t *v1alpha3_device_counter_consumption_local_var = NULL; + + // define the local map for v1alpha3_device_counter_consumption->counters + list_t *countersList = NULL; + + // v1alpha3_device_counter_consumption->counter_set + cJSON *counter_set = cJSON_GetObjectItemCaseSensitive(v1alpha3_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 + } + + // v1alpha3_device_counter_consumption->counters + cJSON *counters = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_counter_consumptionJSON, "counters"); + if (cJSON_IsNull(counters)) { + counters = NULL; + } + if (!counters) { + goto end; + } + + + + // The data type of the elements in v1alpha3_device_counter_consumption->counters is currently not supported. + + + + v1alpha3_device_counter_consumption_local_var = v1alpha3_device_counter_consumption_create_internal ( + strdup(counter_set->valuestring), + countersList + ); + + return v1alpha3_device_counter_consumption_local_var; +end: + + // The data type of the elements in v1alpha3_device_counter_consumption->counters is currently not supported. + + return NULL; + +} diff --git a/kubernetes/model/v1alpha3_device_counter_consumption.h b/kubernetes/model/v1alpha3_device_counter_consumption.h new file mode 100644 index 00000000..a9092e36 --- /dev/null +++ b/kubernetes/model/v1alpha3_device_counter_consumption.h @@ -0,0 +1,41 @@ +/* + * v1alpha3_device_counter_consumption.h + * + * DeviceCounterConsumption defines a set of counters that a device will consume from a CounterSet. + */ + +#ifndef _v1alpha3_device_counter_consumption_H_ +#define _v1alpha3_device_counter_consumption_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha3_device_counter_consumption_t v1alpha3_device_counter_consumption_t; + +#include "v1alpha3_counter.h" + + + +typedef struct v1alpha3_device_counter_consumption_t { + char *counter_set; // string + list_t* counters; //map + + int _library_owned; // Is the library responsible for freeing this object? +} v1alpha3_device_counter_consumption_t; + +__attribute__((deprecated)) v1alpha3_device_counter_consumption_t *v1alpha3_device_counter_consumption_create( + char *counter_set, + list_t* counters +); + +void v1alpha3_device_counter_consumption_free(v1alpha3_device_counter_consumption_t *v1alpha3_device_counter_consumption); + +v1alpha3_device_counter_consumption_t *v1alpha3_device_counter_consumption_parseFromJSON(cJSON *v1alpha3_device_counter_consumptionJSON); + +cJSON *v1alpha3_device_counter_consumption_convertToJSON(v1alpha3_device_counter_consumption_t *v1alpha3_device_counter_consumption); + +#endif /* _v1alpha3_device_counter_consumption_H_ */ + diff --git a/kubernetes/model/v1alpha3_device_request.c b/kubernetes/model/v1alpha3_device_request.c index 28d611e1..a0ab588c 100644 --- a/kubernetes/model/v1alpha3_device_request.c +++ b/kubernetes/model/v1alpha3_device_request.c @@ -10,8 +10,10 @@ static v1alpha3_device_request_t *v1alpha3_device_request_create_internal( char *allocation_mode, long count, char *device_class_name, + list_t *first_available, char *name, - list_t *selectors + list_t *selectors, + list_t *tolerations ) { v1alpha3_device_request_t *v1alpha3_device_request_local_var = malloc(sizeof(v1alpha3_device_request_t)); if (!v1alpha3_device_request_local_var) { @@ -21,8 +23,10 @@ static v1alpha3_device_request_t *v1alpha3_device_request_create_internal( v1alpha3_device_request_local_var->allocation_mode = allocation_mode; v1alpha3_device_request_local_var->count = count; v1alpha3_device_request_local_var->device_class_name = device_class_name; + v1alpha3_device_request_local_var->first_available = first_available; v1alpha3_device_request_local_var->name = name; v1alpha3_device_request_local_var->selectors = selectors; + v1alpha3_device_request_local_var->tolerations = tolerations; v1alpha3_device_request_local_var->_library_owned = 1; return v1alpha3_device_request_local_var; @@ -33,16 +37,20 @@ __attribute__((deprecated)) v1alpha3_device_request_t *v1alpha3_device_request_c char *allocation_mode, long count, char *device_class_name, + list_t *first_available, char *name, - list_t *selectors + list_t *selectors, + list_t *tolerations ) { return v1alpha3_device_request_create_internal ( admin_access, allocation_mode, count, device_class_name, + first_available, name, - selectors + selectors, + tolerations ); } @@ -63,6 +71,13 @@ void v1alpha3_device_request_free(v1alpha3_device_request_t *v1alpha3_device_req free(v1alpha3_device_request->device_class_name); v1alpha3_device_request->device_class_name = NULL; } + if (v1alpha3_device_request->first_available) { + list_ForEach(listEntry, v1alpha3_device_request->first_available) { + v1alpha3_device_sub_request_free(listEntry->data); + } + list_freeList(v1alpha3_device_request->first_available); + v1alpha3_device_request->first_available = NULL; + } if (v1alpha3_device_request->name) { free(v1alpha3_device_request->name); v1alpha3_device_request->name = NULL; @@ -74,6 +89,13 @@ void v1alpha3_device_request_free(v1alpha3_device_request_t *v1alpha3_device_req list_freeList(v1alpha3_device_request->selectors); v1alpha3_device_request->selectors = NULL; } + if (v1alpha3_device_request->tolerations) { + list_ForEach(listEntry, v1alpha3_device_request->tolerations) { + v1alpha3_device_toleration_free(listEntry->data); + } + list_freeList(v1alpha3_device_request->tolerations); + v1alpha3_device_request->tolerations = NULL; + } free(v1alpha3_device_request); } @@ -105,12 +127,31 @@ cJSON *v1alpha3_device_request_convertToJSON(v1alpha3_device_request_t *v1alpha3 // v1alpha3_device_request->device_class_name - if (!v1alpha3_device_request->device_class_name) { - goto fail; - } + if(v1alpha3_device_request->device_class_name) { if(cJSON_AddStringToObject(item, "deviceClassName", v1alpha3_device_request->device_class_name) == NULL) { goto fail; //String } + } + + + // v1alpha3_device_request->first_available + if(v1alpha3_device_request->first_available) { + cJSON *first_available = cJSON_AddArrayToObject(item, "firstAvailable"); + if(first_available == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *first_availableListEntry; + if (v1alpha3_device_request->first_available) { + list_ForEach(first_availableListEntry, v1alpha3_device_request->first_available) { + cJSON *itemLocal = v1alpha3_device_sub_request_convertToJSON(first_availableListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(first_available, itemLocal); + } + } + } // v1alpha3_device_request->name @@ -141,6 +182,26 @@ cJSON *v1alpha3_device_request_convertToJSON(v1alpha3_device_request_t *v1alpha3 } } + + // v1alpha3_device_request->tolerations + if(v1alpha3_device_request->tolerations) { + cJSON *tolerations = cJSON_AddArrayToObject(item, "tolerations"); + if(tolerations == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *tolerationsListEntry; + if (v1alpha3_device_request->tolerations) { + list_ForEach(tolerationsListEntry, v1alpha3_device_request->tolerations) { + cJSON *itemLocal = v1alpha3_device_toleration_convertToJSON(tolerationsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(tolerations, itemLocal); + } + } + } + return item; fail: if (item) { @@ -153,9 +214,15 @@ v1alpha3_device_request_t *v1alpha3_device_request_parseFromJSON(cJSON *v1alpha3 v1alpha3_device_request_t *v1alpha3_device_request_local_var = NULL; + // define the local list for v1alpha3_device_request->first_available + list_t *first_availableList = NULL; + // define the local list for v1alpha3_device_request->selectors list_t *selectorsList = NULL; + // define the local list for v1alpha3_device_request->tolerations + list_t *tolerationsList = NULL; + // v1alpha3_device_request->admin_access cJSON *admin_access = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_requestJSON, "adminAccess"); if (cJSON_IsNull(admin_access)) { @@ -197,14 +264,35 @@ v1alpha3_device_request_t *v1alpha3_device_request_parseFromJSON(cJSON *v1alpha3 if (cJSON_IsNull(device_class_name)) { device_class_name = NULL; } - if (!device_class_name) { - goto end; + if (device_class_name) { + if(!cJSON_IsString(device_class_name) && !cJSON_IsNull(device_class_name)) + { + goto end; //String + } } - - if(!cJSON_IsString(device_class_name)) + // v1alpha3_device_request->first_available + cJSON *first_available = cJSON_GetObjectItemCaseSensitive(v1alpha3_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 ) { - goto end; //String + if(!cJSON_IsObject(first_available_local_nonprimitive)){ + goto end; + } + v1alpha3_device_sub_request_t *first_availableItem = v1alpha3_device_sub_request_parseFromJSON(first_available_local_nonprimitive); + + list_addElement(first_availableList, first_availableItem); + } } // v1alpha3_device_request->name @@ -246,18 +334,53 @@ v1alpha3_device_request_t *v1alpha3_device_request_parseFromJSON(cJSON *v1alpha3 } } + // v1alpha3_device_request->tolerations + cJSON *tolerations = cJSON_GetObjectItemCaseSensitive(v1alpha3_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; + } + v1alpha3_device_toleration_t *tolerationsItem = v1alpha3_device_toleration_parseFromJSON(tolerations_local_nonprimitive); + + list_addElement(tolerationsList, tolerationsItem); + } + } + v1alpha3_device_request_local_var = v1alpha3_device_request_create_internal ( admin_access ? admin_access->valueint : 0, allocation_mode && !cJSON_IsNull(allocation_mode) ? strdup(allocation_mode->valuestring) : NULL, count ? count->valuedouble : 0, - strdup(device_class_name->valuestring), + 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 + selectors ? selectorsList : NULL, + tolerations ? tolerationsList : NULL ); return v1alpha3_device_request_local_var; end: + if (first_availableList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, first_availableList) { + v1alpha3_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) { @@ -267,6 +390,15 @@ v1alpha3_device_request_t *v1alpha3_device_request_parseFromJSON(cJSON *v1alpha3 list_freeList(selectorsList); selectorsList = NULL; } + if (tolerationsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, tolerationsList) { + v1alpha3_device_toleration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(tolerationsList); + tolerationsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1alpha3_device_request.h b/kubernetes/model/v1alpha3_device_request.h index c3bbe67c..e7ce94e7 100644 --- a/kubernetes/model/v1alpha3_device_request.h +++ b/kubernetes/model/v1alpha3_device_request.h @@ -1,7 +1,7 @@ /* * v1alpha3_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. A DeviceClassName is currently required. Clients must check that it is indeed set. It's absence indicates that something changed in a way that is not supported by the client yet, in which case it must refuse to handle the request. + * 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 _v1alpha3_device_request_H_ @@ -16,6 +16,8 @@ typedef struct v1alpha3_device_request_t v1alpha3_device_request_t; #include "v1alpha3_device_selector.h" +#include "v1alpha3_device_sub_request.h" +#include "v1alpha3_device_toleration.h" @@ -24,8 +26,10 @@ typedef struct v1alpha3_device_request_t { char *allocation_mode; // string 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? } v1alpha3_device_request_t; @@ -35,8 +39,10 @@ __attribute__((deprecated)) v1alpha3_device_request_t *v1alpha3_device_request_c char *allocation_mode, long count, char *device_class_name, + list_t *first_available, char *name, - list_t *selectors + list_t *selectors, + list_t *tolerations ); void v1alpha3_device_request_free(v1alpha3_device_request_t *v1alpha3_device_request); diff --git a/kubernetes/model/v1alpha3_device_request_allocation_result.c b/kubernetes/model/v1alpha3_device_request_allocation_result.c index db6d60b1..8e27f0e3 100644 --- a/kubernetes/model/v1alpha3_device_request_allocation_result.c +++ b/kubernetes/model/v1alpha3_device_request_allocation_result.c @@ -10,7 +10,8 @@ static v1alpha3_device_request_allocation_result_t *v1alpha3_device_request_allo char *device, char *driver, char *pool, - char *request + char *request, + list_t *tolerations ) { v1alpha3_device_request_allocation_result_t *v1alpha3_device_request_allocation_result_local_var = malloc(sizeof(v1alpha3_device_request_allocation_result_t)); if (!v1alpha3_device_request_allocation_result_local_var) { @@ -21,6 +22,7 @@ static v1alpha3_device_request_allocation_result_t *v1alpha3_device_request_allo v1alpha3_device_request_allocation_result_local_var->driver = driver; v1alpha3_device_request_allocation_result_local_var->pool = pool; v1alpha3_device_request_allocation_result_local_var->request = request; + v1alpha3_device_request_allocation_result_local_var->tolerations = tolerations; v1alpha3_device_request_allocation_result_local_var->_library_owned = 1; return v1alpha3_device_request_allocation_result_local_var; @@ -31,14 +33,16 @@ __attribute__((deprecated)) v1alpha3_device_request_allocation_result_t *v1alpha char *device, char *driver, char *pool, - char *request + char *request, + list_t *tolerations ) { return v1alpha3_device_request_allocation_result_create_internal ( admin_access, device, driver, pool, - request + request, + tolerations ); } @@ -67,6 +71,13 @@ void v1alpha3_device_request_allocation_result_free(v1alpha3_device_request_allo free(v1alpha3_device_request_allocation_result->request); v1alpha3_device_request_allocation_result->request = NULL; } + if (v1alpha3_device_request_allocation_result->tolerations) { + list_ForEach(listEntry, v1alpha3_device_request_allocation_result->tolerations) { + v1alpha3_device_toleration_free(listEntry->data); + } + list_freeList(v1alpha3_device_request_allocation_result->tolerations); + v1alpha3_device_request_allocation_result->tolerations = NULL; + } free(v1alpha3_device_request_allocation_result); } @@ -116,6 +127,26 @@ cJSON *v1alpha3_device_request_allocation_result_convertToJSON(v1alpha3_device_r goto fail; //String } + + // v1alpha3_device_request_allocation_result->tolerations + if(v1alpha3_device_request_allocation_result->tolerations) { + cJSON *tolerations = cJSON_AddArrayToObject(item, "tolerations"); + if(tolerations == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *tolerationsListEntry; + if (v1alpha3_device_request_allocation_result->tolerations) { + list_ForEach(tolerationsListEntry, v1alpha3_device_request_allocation_result->tolerations) { + cJSON *itemLocal = v1alpha3_device_toleration_convertToJSON(tolerationsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(tolerations, itemLocal); + } + } + } + return item; fail: if (item) { @@ -128,6 +159,9 @@ v1alpha3_device_request_allocation_result_t *v1alpha3_device_request_allocation_ v1alpha3_device_request_allocation_result_t *v1alpha3_device_request_allocation_result_local_var = NULL; + // define the local list for v1alpha3_device_request_allocation_result->tolerations + list_t *tolerationsList = NULL; + // v1alpha3_device_request_allocation_result->admin_access cJSON *admin_access = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_request_allocation_resultJSON, "adminAccess"); if (cJSON_IsNull(admin_access)) { @@ -200,17 +234,51 @@ v1alpha3_device_request_allocation_result_t *v1alpha3_device_request_allocation_ goto end; //String } + // v1alpha3_device_request_allocation_result->tolerations + cJSON *tolerations = cJSON_GetObjectItemCaseSensitive(v1alpha3_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; + } + v1alpha3_device_toleration_t *tolerationsItem = v1alpha3_device_toleration_parseFromJSON(tolerations_local_nonprimitive); + + list_addElement(tolerationsList, tolerationsItem); + } + } + v1alpha3_device_request_allocation_result_local_var = v1alpha3_device_request_allocation_result_create_internal ( admin_access ? admin_access->valueint : 0, strdup(device->valuestring), strdup(driver->valuestring), strdup(pool->valuestring), - strdup(request->valuestring) + strdup(request->valuestring), + tolerations ? tolerationsList : NULL ); return v1alpha3_device_request_allocation_result_local_var; end: + if (tolerationsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, tolerationsList) { + v1alpha3_device_toleration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(tolerationsList); + tolerationsList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1alpha3_device_request_allocation_result.h b/kubernetes/model/v1alpha3_device_request_allocation_result.h index f7d316a8..6bf4bb96 100644 --- a/kubernetes/model/v1alpha3_device_request_allocation_result.h +++ b/kubernetes/model/v1alpha3_device_request_allocation_result.h @@ -15,6 +15,7 @@ typedef struct v1alpha3_device_request_allocation_result_t v1alpha3_device_request_allocation_result_t; +#include "v1alpha3_device_toleration.h" @@ -24,6 +25,7 @@ typedef struct v1alpha3_device_request_allocation_result_t { char *driver; // string char *pool; // string char *request; // string + list_t *tolerations; //nonprimitive container int _library_owned; // Is the library responsible for freeing this object? } v1alpha3_device_request_allocation_result_t; @@ -33,7 +35,8 @@ __attribute__((deprecated)) v1alpha3_device_request_allocation_result_t *v1alpha char *device, char *driver, char *pool, - char *request + char *request, + list_t *tolerations ); void v1alpha3_device_request_allocation_result_free(v1alpha3_device_request_allocation_result_t *v1alpha3_device_request_allocation_result); diff --git a/kubernetes/model/v1alpha3_device_sub_request.c b/kubernetes/model/v1alpha3_device_sub_request.c new file mode 100644 index 00000000..ff69f3c7 --- /dev/null +++ b/kubernetes/model/v1alpha3_device_sub_request.c @@ -0,0 +1,315 @@ +#include +#include +#include +#include "v1alpha3_device_sub_request.h" + + + +static v1alpha3_device_sub_request_t *v1alpha3_device_sub_request_create_internal( + char *allocation_mode, + long count, + char *device_class_name, + char *name, + list_t *selectors, + list_t *tolerations + ) { + v1alpha3_device_sub_request_t *v1alpha3_device_sub_request_local_var = malloc(sizeof(v1alpha3_device_sub_request_t)); + if (!v1alpha3_device_sub_request_local_var) { + return NULL; + } + v1alpha3_device_sub_request_local_var->allocation_mode = allocation_mode; + v1alpha3_device_sub_request_local_var->count = count; + v1alpha3_device_sub_request_local_var->device_class_name = device_class_name; + v1alpha3_device_sub_request_local_var->name = name; + v1alpha3_device_sub_request_local_var->selectors = selectors; + v1alpha3_device_sub_request_local_var->tolerations = tolerations; + + v1alpha3_device_sub_request_local_var->_library_owned = 1; + return v1alpha3_device_sub_request_local_var; +} + +__attribute__((deprecated)) v1alpha3_device_sub_request_t *v1alpha3_device_sub_request_create( + char *allocation_mode, + long count, + char *device_class_name, + char *name, + list_t *selectors, + list_t *tolerations + ) { + return v1alpha3_device_sub_request_create_internal ( + allocation_mode, + count, + device_class_name, + name, + selectors, + tolerations + ); +} + +void v1alpha3_device_sub_request_free(v1alpha3_device_sub_request_t *v1alpha3_device_sub_request) { + if(NULL == v1alpha3_device_sub_request){ + return ; + } + if(v1alpha3_device_sub_request->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha3_device_sub_request_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha3_device_sub_request->allocation_mode) { + free(v1alpha3_device_sub_request->allocation_mode); + v1alpha3_device_sub_request->allocation_mode = NULL; + } + if (v1alpha3_device_sub_request->device_class_name) { + free(v1alpha3_device_sub_request->device_class_name); + v1alpha3_device_sub_request->device_class_name = NULL; + } + if (v1alpha3_device_sub_request->name) { + free(v1alpha3_device_sub_request->name); + v1alpha3_device_sub_request->name = NULL; + } + if (v1alpha3_device_sub_request->selectors) { + list_ForEach(listEntry, v1alpha3_device_sub_request->selectors) { + v1alpha3_device_selector_free(listEntry->data); + } + list_freeList(v1alpha3_device_sub_request->selectors); + v1alpha3_device_sub_request->selectors = NULL; + } + if (v1alpha3_device_sub_request->tolerations) { + list_ForEach(listEntry, v1alpha3_device_sub_request->tolerations) { + v1alpha3_device_toleration_free(listEntry->data); + } + list_freeList(v1alpha3_device_sub_request->tolerations); + v1alpha3_device_sub_request->tolerations = NULL; + } + free(v1alpha3_device_sub_request); +} + +cJSON *v1alpha3_device_sub_request_convertToJSON(v1alpha3_device_sub_request_t *v1alpha3_device_sub_request) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha3_device_sub_request->allocation_mode + if(v1alpha3_device_sub_request->allocation_mode) { + if(cJSON_AddStringToObject(item, "allocationMode", v1alpha3_device_sub_request->allocation_mode) == NULL) { + goto fail; //String + } + } + + + // v1alpha3_device_sub_request->count + if(v1alpha3_device_sub_request->count) { + if(cJSON_AddNumberToObject(item, "count", v1alpha3_device_sub_request->count) == NULL) { + goto fail; //Numeric + } + } + + + // v1alpha3_device_sub_request->device_class_name + if (!v1alpha3_device_sub_request->device_class_name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "deviceClassName", v1alpha3_device_sub_request->device_class_name) == NULL) { + goto fail; //String + } + + + // v1alpha3_device_sub_request->name + if (!v1alpha3_device_sub_request->name) { + goto fail; + } + if(cJSON_AddStringToObject(item, "name", v1alpha3_device_sub_request->name) == NULL) { + goto fail; //String + } + + + // v1alpha3_device_sub_request->selectors + if(v1alpha3_device_sub_request->selectors) { + cJSON *selectors = cJSON_AddArrayToObject(item, "selectors"); + if(selectors == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *selectorsListEntry; + if (v1alpha3_device_sub_request->selectors) { + list_ForEach(selectorsListEntry, v1alpha3_device_sub_request->selectors) { + cJSON *itemLocal = v1alpha3_device_selector_convertToJSON(selectorsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(selectors, itemLocal); + } + } + } + + + // v1alpha3_device_sub_request->tolerations + if(v1alpha3_device_sub_request->tolerations) { + cJSON *tolerations = cJSON_AddArrayToObject(item, "tolerations"); + if(tolerations == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *tolerationsListEntry; + if (v1alpha3_device_sub_request->tolerations) { + list_ForEach(tolerationsListEntry, v1alpha3_device_sub_request->tolerations) { + cJSON *itemLocal = v1alpha3_device_toleration_convertToJSON(tolerationsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(tolerations, itemLocal); + } + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha3_device_sub_request_t *v1alpha3_device_sub_request_parseFromJSON(cJSON *v1alpha3_device_sub_requestJSON){ + + v1alpha3_device_sub_request_t *v1alpha3_device_sub_request_local_var = NULL; + + // define the local list for v1alpha3_device_sub_request->selectors + list_t *selectorsList = NULL; + + // define the local list for v1alpha3_device_sub_request->tolerations + list_t *tolerationsList = NULL; + + // v1alpha3_device_sub_request->allocation_mode + cJSON *allocation_mode = cJSON_GetObjectItemCaseSensitive(v1alpha3_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 + } + } + + // v1alpha3_device_sub_request->count + cJSON *count = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_sub_requestJSON, "count"); + if (cJSON_IsNull(count)) { + count = NULL; + } + if (count) { + if(!cJSON_IsNumber(count)) + { + goto end; //Numeric + } + } + + // v1alpha3_device_sub_request->device_class_name + cJSON *device_class_name = cJSON_GetObjectItemCaseSensitive(v1alpha3_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 + } + + // v1alpha3_device_sub_request->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_sub_requestJSON, "name"); + if (cJSON_IsNull(name)) { + name = NULL; + } + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + // v1alpha3_device_sub_request->selectors + cJSON *selectors = cJSON_GetObjectItemCaseSensitive(v1alpha3_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; + } + v1alpha3_device_selector_t *selectorsItem = v1alpha3_device_selector_parseFromJSON(selectors_local_nonprimitive); + + list_addElement(selectorsList, selectorsItem); + } + } + + // v1alpha3_device_sub_request->tolerations + cJSON *tolerations = cJSON_GetObjectItemCaseSensitive(v1alpha3_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; + } + v1alpha3_device_toleration_t *tolerationsItem = v1alpha3_device_toleration_parseFromJSON(tolerations_local_nonprimitive); + + list_addElement(tolerationsList, tolerationsItem); + } + } + + + v1alpha3_device_sub_request_local_var = v1alpha3_device_sub_request_create_internal ( + allocation_mode && !cJSON_IsNull(allocation_mode) ? strdup(allocation_mode->valuestring) : NULL, + count ? count->valuedouble : 0, + strdup(device_class_name->valuestring), + strdup(name->valuestring), + selectors ? selectorsList : NULL, + tolerations ? tolerationsList : NULL + ); + + return v1alpha3_device_sub_request_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; + } + if (tolerationsList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, tolerationsList) { + v1alpha3_device_toleration_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(tolerationsList); + tolerationsList = NULL; + } + return NULL; + +} diff --git a/kubernetes/model/v1alpha3_device_sub_request.h b/kubernetes/model/v1alpha3_device_sub_request.h new file mode 100644 index 00000000..39cd9915 --- /dev/null +++ b/kubernetes/model/v1alpha3_device_sub_request.h @@ -0,0 +1,50 @@ +/* + * v1alpha3_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 _v1alpha3_device_sub_request_H_ +#define _v1alpha3_device_sub_request_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha3_device_sub_request_t v1alpha3_device_sub_request_t; + +#include "v1alpha3_device_selector.h" +#include "v1alpha3_device_toleration.h" + + + +typedef struct v1alpha3_device_sub_request_t { + char *allocation_mode; // string + 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? +} v1alpha3_device_sub_request_t; + +__attribute__((deprecated)) v1alpha3_device_sub_request_t *v1alpha3_device_sub_request_create( + char *allocation_mode, + long count, + char *device_class_name, + char *name, + list_t *selectors, + list_t *tolerations +); + +void v1alpha3_device_sub_request_free(v1alpha3_device_sub_request_t *v1alpha3_device_sub_request); + +v1alpha3_device_sub_request_t *v1alpha3_device_sub_request_parseFromJSON(cJSON *v1alpha3_device_sub_requestJSON); + +cJSON *v1alpha3_device_sub_request_convertToJSON(v1alpha3_device_sub_request_t *v1alpha3_device_sub_request); + +#endif /* _v1alpha3_device_sub_request_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/v1alpha3_device_toleration.c b/kubernetes/model/v1alpha3_device_toleration.c new file mode 100644 index 00000000..a04eae8b --- /dev/null +++ b/kubernetes/model/v1alpha3_device_toleration.c @@ -0,0 +1,200 @@ +#include +#include +#include +#include "v1alpha3_device_toleration.h" + + + +static v1alpha3_device_toleration_t *v1alpha3_device_toleration_create_internal( + char *effect, + char *key, + char *_operator, + long toleration_seconds, + char *value + ) { + v1alpha3_device_toleration_t *v1alpha3_device_toleration_local_var = malloc(sizeof(v1alpha3_device_toleration_t)); + if (!v1alpha3_device_toleration_local_var) { + return NULL; + } + v1alpha3_device_toleration_local_var->effect = effect; + v1alpha3_device_toleration_local_var->key = key; + v1alpha3_device_toleration_local_var->_operator = _operator; + v1alpha3_device_toleration_local_var->toleration_seconds = toleration_seconds; + v1alpha3_device_toleration_local_var->value = value; + + v1alpha3_device_toleration_local_var->_library_owned = 1; + return v1alpha3_device_toleration_local_var; +} + +__attribute__((deprecated)) v1alpha3_device_toleration_t *v1alpha3_device_toleration_create( + char *effect, + char *key, + char *_operator, + long toleration_seconds, + char *value + ) { + return v1alpha3_device_toleration_create_internal ( + effect, + key, + _operator, + toleration_seconds, + value + ); +} + +void v1alpha3_device_toleration_free(v1alpha3_device_toleration_t *v1alpha3_device_toleration) { + if(NULL == v1alpha3_device_toleration){ + return ; + } + if(v1alpha3_device_toleration->_library_owned != 1){ + fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1alpha3_device_toleration_free"); + return ; + } + listEntry_t *listEntry; + if (v1alpha3_device_toleration->effect) { + free(v1alpha3_device_toleration->effect); + v1alpha3_device_toleration->effect = NULL; + } + if (v1alpha3_device_toleration->key) { + free(v1alpha3_device_toleration->key); + v1alpha3_device_toleration->key = NULL; + } + if (v1alpha3_device_toleration->_operator) { + free(v1alpha3_device_toleration->_operator); + v1alpha3_device_toleration->_operator = NULL; + } + if (v1alpha3_device_toleration->value) { + free(v1alpha3_device_toleration->value); + v1alpha3_device_toleration->value = NULL; + } + free(v1alpha3_device_toleration); +} + +cJSON *v1alpha3_device_toleration_convertToJSON(v1alpha3_device_toleration_t *v1alpha3_device_toleration) { + cJSON *item = cJSON_CreateObject(); + + // v1alpha3_device_toleration->effect + if(v1alpha3_device_toleration->effect) { + if(cJSON_AddStringToObject(item, "effect", v1alpha3_device_toleration->effect) == NULL) { + goto fail; //String + } + } + + + // v1alpha3_device_toleration->key + if(v1alpha3_device_toleration->key) { + if(cJSON_AddStringToObject(item, "key", v1alpha3_device_toleration->key) == NULL) { + goto fail; //String + } + } + + + // v1alpha3_device_toleration->_operator + if(v1alpha3_device_toleration->_operator) { + if(cJSON_AddStringToObject(item, "operator", v1alpha3_device_toleration->_operator) == NULL) { + goto fail; //String + } + } + + + // v1alpha3_device_toleration->toleration_seconds + if(v1alpha3_device_toleration->toleration_seconds) { + if(cJSON_AddNumberToObject(item, "tolerationSeconds", v1alpha3_device_toleration->toleration_seconds) == NULL) { + goto fail; //Numeric + } + } + + + // v1alpha3_device_toleration->value + if(v1alpha3_device_toleration->value) { + if(cJSON_AddStringToObject(item, "value", v1alpha3_device_toleration->value) == NULL) { + goto fail; //String + } + } + + return item; +fail: + if (item) { + cJSON_Delete(item); + } + return NULL; +} + +v1alpha3_device_toleration_t *v1alpha3_device_toleration_parseFromJSON(cJSON *v1alpha3_device_tolerationJSON){ + + v1alpha3_device_toleration_t *v1alpha3_device_toleration_local_var = NULL; + + // v1alpha3_device_toleration->effect + cJSON *effect = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_tolerationJSON, "effect"); + if (cJSON_IsNull(effect)) { + effect = NULL; + } + if (effect) { + if(!cJSON_IsString(effect) && !cJSON_IsNull(effect)) + { + goto end; //String + } + } + + // v1alpha3_device_toleration->key + cJSON *key = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_tolerationJSON, "key"); + if (cJSON_IsNull(key)) { + key = NULL; + } + if (key) { + if(!cJSON_IsString(key) && !cJSON_IsNull(key)) + { + goto end; //String + } + } + + // v1alpha3_device_toleration->_operator + cJSON *_operator = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_tolerationJSON, "operator"); + if (cJSON_IsNull(_operator)) { + _operator = NULL; + } + if (_operator) { + if(!cJSON_IsString(_operator) && !cJSON_IsNull(_operator)) + { + goto end; //String + } + } + + // v1alpha3_device_toleration->toleration_seconds + cJSON *toleration_seconds = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_tolerationJSON, "tolerationSeconds"); + if (cJSON_IsNull(toleration_seconds)) { + toleration_seconds = NULL; + } + if (toleration_seconds) { + if(!cJSON_IsNumber(toleration_seconds)) + { + goto end; //Numeric + } + } + + // v1alpha3_device_toleration->value + cJSON *value = cJSON_GetObjectItemCaseSensitive(v1alpha3_device_tolerationJSON, "value"); + if (cJSON_IsNull(value)) { + value = NULL; + } + if (value) { + if(!cJSON_IsString(value) && !cJSON_IsNull(value)) + { + goto end; //String + } + } + + + v1alpha3_device_toleration_local_var = v1alpha3_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 v1alpha3_device_toleration_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1alpha3_device_toleration.h b/kubernetes/model/v1alpha3_device_toleration.h new file mode 100644 index 00000000..7fef6d82 --- /dev/null +++ b/kubernetes/model/v1alpha3_device_toleration.h @@ -0,0 +1,46 @@ +/* + * v1alpha3_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 _v1alpha3_device_toleration_H_ +#define _v1alpha3_device_toleration_H_ + +#include +#include "../external/cJSON.h" +#include "../include/list.h" +#include "../include/keyValuePair.h" +#include "../include/binary.h" + +typedef struct v1alpha3_device_toleration_t v1alpha3_device_toleration_t; + + + + +typedef struct v1alpha3_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? +} v1alpha3_device_toleration_t; + +__attribute__((deprecated)) v1alpha3_device_toleration_t *v1alpha3_device_toleration_create( + char *effect, + char *key, + char *_operator, + long toleration_seconds, + char *value +); + +void v1alpha3_device_toleration_free(v1alpha3_device_toleration_t *v1alpha3_device_toleration); + +v1alpha3_device_toleration_t *v1alpha3_device_toleration_parseFromJSON(cJSON *v1alpha3_device_tolerationJSON); + +cJSON *v1alpha3_device_toleration_convertToJSON(v1alpha3_device_toleration_t *v1alpha3_device_toleration); + +#endif /* _v1alpha3_device_toleration_H_ */ + diff --git a/kubernetes/model/v1alpha3_resource_slice_spec.c b/kubernetes/model/v1alpha3_resource_slice_spec.c index 683fb7c7..f208623f 100644 --- a/kubernetes/model/v1alpha3_resource_slice_spec.c +++ b/kubernetes/model/v1alpha3_resource_slice_spec.c @@ -11,7 +11,9 @@ static v1alpha3_resource_slice_spec_t *v1alpha3_resource_slice_spec_create_inter char *driver, char *node_name, v1_node_selector_t *node_selector, - v1alpha3_resource_pool_t *pool + int per_device_node_selection, + v1alpha3_resource_pool_t *pool, + list_t *shared_counters ) { v1alpha3_resource_slice_spec_t *v1alpha3_resource_slice_spec_local_var = malloc(sizeof(v1alpha3_resource_slice_spec_t)); if (!v1alpha3_resource_slice_spec_local_var) { @@ -22,7 +24,9 @@ static v1alpha3_resource_slice_spec_t *v1alpha3_resource_slice_spec_create_inter v1alpha3_resource_slice_spec_local_var->driver = driver; v1alpha3_resource_slice_spec_local_var->node_name = node_name; v1alpha3_resource_slice_spec_local_var->node_selector = node_selector; + v1alpha3_resource_slice_spec_local_var->per_device_node_selection = per_device_node_selection; v1alpha3_resource_slice_spec_local_var->pool = pool; + v1alpha3_resource_slice_spec_local_var->shared_counters = shared_counters; v1alpha3_resource_slice_spec_local_var->_library_owned = 1; return v1alpha3_resource_slice_spec_local_var; @@ -34,7 +38,9 @@ __attribute__((deprecated)) v1alpha3_resource_slice_spec_t *v1alpha3_resource_sl char *driver, char *node_name, v1_node_selector_t *node_selector, - v1alpha3_resource_pool_t *pool + int per_device_node_selection, + v1alpha3_resource_pool_t *pool, + list_t *shared_counters ) { return v1alpha3_resource_slice_spec_create_internal ( all_nodes, @@ -42,7 +48,9 @@ __attribute__((deprecated)) v1alpha3_resource_slice_spec_t *v1alpha3_resource_sl driver, node_name, node_selector, - pool + per_device_node_selection, + pool, + shared_counters ); } @@ -78,6 +86,13 @@ void v1alpha3_resource_slice_spec_free(v1alpha3_resource_slice_spec_t *v1alpha3_ v1alpha3_resource_pool_free(v1alpha3_resource_slice_spec->pool); v1alpha3_resource_slice_spec->pool = NULL; } + if (v1alpha3_resource_slice_spec->shared_counters) { + list_ForEach(listEntry, v1alpha3_resource_slice_spec->shared_counters) { + v1alpha3_counter_set_free(listEntry->data); + } + list_freeList(v1alpha3_resource_slice_spec->shared_counters); + v1alpha3_resource_slice_spec->shared_counters = NULL; + } free(v1alpha3_resource_slice_spec); } @@ -142,6 +157,14 @@ cJSON *v1alpha3_resource_slice_spec_convertToJSON(v1alpha3_resource_slice_spec_t } + // v1alpha3_resource_slice_spec->per_device_node_selection + if(v1alpha3_resource_slice_spec->per_device_node_selection) { + if(cJSON_AddBoolToObject(item, "perDeviceNodeSelection", v1alpha3_resource_slice_spec->per_device_node_selection) == NULL) { + goto fail; //Bool + } + } + + // v1alpha3_resource_slice_spec->pool if (!v1alpha3_resource_slice_spec->pool) { goto fail; @@ -155,6 +178,26 @@ cJSON *v1alpha3_resource_slice_spec_convertToJSON(v1alpha3_resource_slice_spec_t goto fail; } + + // v1alpha3_resource_slice_spec->shared_counters + if(v1alpha3_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 (v1alpha3_resource_slice_spec->shared_counters) { + list_ForEach(shared_countersListEntry, v1alpha3_resource_slice_spec->shared_counters) { + cJSON *itemLocal = v1alpha3_counter_set_convertToJSON(shared_countersListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(shared_counters, itemLocal); + } + } + } + return item; fail: if (item) { @@ -176,6 +219,9 @@ v1alpha3_resource_slice_spec_t *v1alpha3_resource_slice_spec_parseFromJSON(cJSON // define the local variable for v1alpha3_resource_slice_spec->pool v1alpha3_resource_pool_t *pool_local_nonprim = NULL; + // define the local list for v1alpha3_resource_slice_spec->shared_counters + list_t *shared_countersList = NULL; + // v1alpha3_resource_slice_spec->all_nodes cJSON *all_nodes = cJSON_GetObjectItemCaseSensitive(v1alpha3_resource_slice_specJSON, "allNodes"); if (cJSON_IsNull(all_nodes)) { @@ -248,6 +294,18 @@ v1alpha3_resource_slice_spec_t *v1alpha3_resource_slice_spec_parseFromJSON(cJSON node_selector_local_nonprim = v1_node_selector_parseFromJSON(node_selector); //nonprimitive } + // v1alpha3_resource_slice_spec->per_device_node_selection + cJSON *per_device_node_selection = cJSON_GetObjectItemCaseSensitive(v1alpha3_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 + } + } + // v1alpha3_resource_slice_spec->pool cJSON *pool = cJSON_GetObjectItemCaseSensitive(v1alpha3_resource_slice_specJSON, "pool"); if (cJSON_IsNull(pool)) { @@ -260,6 +318,30 @@ v1alpha3_resource_slice_spec_t *v1alpha3_resource_slice_spec_parseFromJSON(cJSON pool_local_nonprim = v1alpha3_resource_pool_parseFromJSON(pool); //nonprimitive + // v1alpha3_resource_slice_spec->shared_counters + cJSON *shared_counters = cJSON_GetObjectItemCaseSensitive(v1alpha3_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; + } + v1alpha3_counter_set_t *shared_countersItem = v1alpha3_counter_set_parseFromJSON(shared_counters_local_nonprimitive); + + list_addElement(shared_countersList, shared_countersItem); + } + } + v1alpha3_resource_slice_spec_local_var = v1alpha3_resource_slice_spec_create_internal ( all_nodes ? all_nodes->valueint : 0, @@ -267,7 +349,9 @@ v1alpha3_resource_slice_spec_t *v1alpha3_resource_slice_spec_parseFromJSON(cJSON strdup(driver->valuestring), node_name && !cJSON_IsNull(node_name) ? strdup(node_name->valuestring) : NULL, node_selector ? node_selector_local_nonprim : NULL, - pool_local_nonprim + per_device_node_selection ? per_device_node_selection->valueint : 0, + pool_local_nonprim, + shared_counters ? shared_countersList : NULL ); return v1alpha3_resource_slice_spec_local_var; @@ -289,6 +373,15 @@ v1alpha3_resource_slice_spec_t *v1alpha3_resource_slice_spec_parseFromJSON(cJSON v1alpha3_resource_pool_free(pool_local_nonprim); pool_local_nonprim = NULL; } + if (shared_countersList) { + listEntry_t *listEntry = NULL; + list_ForEach(listEntry, shared_countersList) { + v1alpha3_counter_set_free(listEntry->data); + listEntry->data = NULL; + } + list_freeList(shared_countersList); + shared_countersList = NULL; + } return NULL; } diff --git a/kubernetes/model/v1alpha3_resource_slice_spec.h b/kubernetes/model/v1alpha3_resource_slice_spec.h index 7b92afe0..8d90a86e 100644 --- a/kubernetes/model/v1alpha3_resource_slice_spec.h +++ b/kubernetes/model/v1alpha3_resource_slice_spec.h @@ -16,6 +16,7 @@ typedef struct v1alpha3_resource_slice_spec_t v1alpha3_resource_slice_spec_t; #include "v1_node_selector.h" +#include "v1alpha3_counter_set.h" #include "v1alpha3_device.h" #include "v1alpha3_resource_pool.h" @@ -27,7 +28,9 @@ typedef struct v1alpha3_resource_slice_spec_t { char *driver; // string char *node_name; // string struct v1_node_selector_t *node_selector; //model + int per_device_node_selection; //boolean struct v1alpha3_resource_pool_t *pool; //model + list_t *shared_counters; //nonprimitive container int _library_owned; // Is the library responsible for freeing this object? } v1alpha3_resource_slice_spec_t; @@ -38,7 +41,9 @@ __attribute__((deprecated)) v1alpha3_resource_slice_spec_t *v1alpha3_resource_sl char *driver, char *node_name, v1_node_selector_t *node_selector, - v1alpha3_resource_pool_t *pool + int per_device_node_selection, + v1alpha3_resource_pool_t *pool, + list_t *shared_counters ); void v1alpha3_resource_slice_spec_free(v1alpha3_resource_slice_spec_t *v1alpha3_resource_slice_spec); diff --git a/kubernetes/model/v1beta1_basic_device.c b/kubernetes/model/v1beta1_basic_device.c index e9e91cb9..9faa166f 100644 --- a/kubernetes/model/v1beta1_basic_device.c +++ b/kubernetes/model/v1beta1_basic_device.c @@ -6,27 +6,47 @@ static v1beta1_basic_device_t *v1beta1_basic_device_create_internal( + int all_nodes, list_t* attributes, - list_t* capacity + 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->attributes = attributes; 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, list_t* attributes, - list_t* capacity + 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, attributes, - capacity + capacity, + consumes_counters, + node_name, + node_selector, + taints ); } @@ -59,12 +79,42 @@ void v1beta1_basic_device_free(v1beta1_basic_device_t *v1beta1_basic_device) { 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->attributes if(v1beta1_basic_device->attributes) { cJSON *attributes = cJSON_AddObjectToObject(item, "attributes"); @@ -96,6 +146,67 @@ cJSON *v1beta1_basic_device_convertToJSON(v1beta1_basic_device_t *v1beta1_basic_ } } + + // 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) { @@ -114,6 +225,27 @@ v1beta1_basic_device_t *v1beta1_basic_device_parseFromJSON(cJSON *v1beta1_basic_ // 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->attributes cJSON *attributes = cJSON_GetObjectItemCaseSensitive(v1beta1_basic_deviceJSON, "attributes"); if (cJSON_IsNull(attributes)) { @@ -136,10 +268,84 @@ v1beta1_basic_device_t *v1beta1_basic_device_parseFromJSON(cJSON *v1beta1_basic_ } + // 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, attributes ? attributesList : NULL, - capacity ? capacityList : NULL + 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; @@ -150,6 +356,28 @@ v1beta1_basic_device_t *v1beta1_basic_device_parseFromJSON(cJSON *v1beta1_basic_ // 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 index b1c0c1b5..8e1c41af 100644 --- a/kubernetes/model/v1beta1_basic_device.h +++ b/kubernetes/model/v1beta1_basic_device.h @@ -15,21 +15,34 @@ 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 list_t* attributes; //map 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, list_t* attributes, - list_t* capacity + 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); 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_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 index c0dc8b2a..24c0aa15 100644 --- a/kubernetes/model/v1beta1_device_request.c +++ b/kubernetes/model/v1beta1_device_request.c @@ -10,8 +10,10 @@ static v1beta1_device_request_t *v1beta1_device_request_create_internal( char *allocation_mode, long count, char *device_class_name, + list_t *first_available, char *name, - list_t *selectors + 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) { @@ -21,8 +23,10 @@ static v1beta1_device_request_t *v1beta1_device_request_create_internal( v1beta1_device_request_local_var->allocation_mode = allocation_mode; 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; @@ -33,16 +37,20 @@ __attribute__((deprecated)) v1beta1_device_request_t *v1beta1_device_request_cre char *allocation_mode, long count, char *device_class_name, + list_t *first_available, char *name, - list_t *selectors + list_t *selectors, + list_t *tolerations ) { return v1beta1_device_request_create_internal ( admin_access, allocation_mode, count, device_class_name, + first_available, name, - selectors + selectors, + tolerations ); } @@ -63,6 +71,13 @@ void v1beta1_device_request_free(v1beta1_device_request_t *v1beta1_device_reques 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; @@ -74,6 +89,13 @@ void v1beta1_device_request_free(v1beta1_device_request_t *v1beta1_device_reques 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); } @@ -105,12 +127,31 @@ cJSON *v1beta1_device_request_convertToJSON(v1beta1_device_request_t *v1beta1_de // v1beta1_device_request->device_class_name - if (!v1beta1_device_request->device_class_name) { - goto fail; - } + 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 @@ -141,6 +182,26 @@ cJSON *v1beta1_device_request_convertToJSON(v1beta1_device_request_t *v1beta1_de } } + + // 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) { @@ -153,9 +214,15 @@ v1beta1_device_request_t *v1beta1_device_request_parseFromJSON(cJSON *v1beta1_de v1beta1_device_request_t *v1beta1_device_request_local_var = 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)) { @@ -197,14 +264,35 @@ v1beta1_device_request_t *v1beta1_device_request_parseFromJSON(cJSON *v1beta1_de if (cJSON_IsNull(device_class_name)) { device_class_name = NULL; } - if (!device_class_name) { - goto end; + if (device_class_name) { + if(!cJSON_IsString(device_class_name) && !cJSON_IsNull(device_class_name)) + { + goto end; //String + } } - - if(!cJSON_IsString(device_class_name)) + // 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 ) { - goto end; //String + 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 @@ -246,18 +334,53 @@ v1beta1_device_request_t *v1beta1_device_request_parseFromJSON(cJSON *v1beta1_de } } + // 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, count ? count->valuedouble : 0, - strdup(device_class_name->valuestring), + 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 + selectors ? selectorsList : NULL, + tolerations ? tolerationsList : NULL ); return v1beta1_device_request_local_var; end: + 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) { @@ -267,6 +390,15 @@ v1beta1_device_request_t *v1beta1_device_request_parseFromJSON(cJSON *v1beta1_de 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 index 7643c95b..40a6c75d 100644 --- a/kubernetes/model/v1beta1_device_request.h +++ b/kubernetes/model/v1beta1_device_request.h @@ -1,7 +1,7 @@ /* * 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. A DeviceClassName is currently required. Clients must check that it is indeed set. It's absence indicates that something changed in a way that is not supported by the client yet, in which case it must refuse to handle the request. + * 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_ @@ -16,6 +16,8 @@ typedef struct v1beta1_device_request_t v1beta1_device_request_t; #include "v1beta1_device_selector.h" +#include "v1beta1_device_sub_request.h" +#include "v1beta1_device_toleration.h" @@ -24,8 +26,10 @@ typedef struct v1beta1_device_request_t { char *allocation_mode; // string 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; @@ -35,8 +39,10 @@ __attribute__((deprecated)) v1beta1_device_request_t *v1beta1_device_request_cre char *allocation_mode, long count, char *device_class_name, + list_t *first_available, char *name, - list_t *selectors + list_t *selectors, + list_t *tolerations ); void v1beta1_device_request_free(v1beta1_device_request_t *v1beta1_device_request); diff --git a/kubernetes/model/v1beta1_device_request_allocation_result.c b/kubernetes/model/v1beta1_device_request_allocation_result.c index ed00109d..b64bd55c 100644 --- a/kubernetes/model/v1beta1_device_request_allocation_result.c +++ b/kubernetes/model/v1beta1_device_request_allocation_result.c @@ -10,7 +10,8 @@ static v1beta1_device_request_allocation_result_t *v1beta1_device_request_alloca char *device, char *driver, char *pool, - char *request + char *request, + 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) { @@ -21,6 +22,7 @@ static v1beta1_device_request_allocation_result_t *v1beta1_device_request_alloca 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->tolerations = tolerations; v1beta1_device_request_allocation_result_local_var->_library_owned = 1; return v1beta1_device_request_allocation_result_local_var; @@ -31,14 +33,16 @@ __attribute__((deprecated)) v1beta1_device_request_allocation_result_t *v1beta1_ char *device, char *driver, char *pool, - char *request + char *request, + list_t *tolerations ) { return v1beta1_device_request_allocation_result_create_internal ( admin_access, device, driver, pool, - request + request, + tolerations ); } @@ -67,6 +71,13 @@ void v1beta1_device_request_allocation_result_free(v1beta1_device_request_alloca free(v1beta1_device_request_allocation_result->request); v1beta1_device_request_allocation_result->request = 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); } @@ -116,6 +127,26 @@ cJSON *v1beta1_device_request_allocation_result_convertToJSON(v1beta1_device_req 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) { @@ -128,6 +159,9 @@ v1beta1_device_request_allocation_result_t *v1beta1_device_request_allocation_re v1beta1_device_request_allocation_result_t *v1beta1_device_request_allocation_result_local_var = 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)) { @@ -200,17 +234,51 @@ v1beta1_device_request_allocation_result_t *v1beta1_device_request_allocation_re 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, strdup(device->valuestring), strdup(driver->valuestring), strdup(pool->valuestring), - strdup(request->valuestring) + strdup(request->valuestring), + tolerations ? tolerationsList : NULL ); return v1beta1_device_request_allocation_result_local_var; end: + 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 index 816c3b23..84b15463 100644 --- a/kubernetes/model/v1beta1_device_request_allocation_result.h +++ b/kubernetes/model/v1beta1_device_request_allocation_result.h @@ -15,6 +15,7 @@ typedef struct v1beta1_device_request_allocation_result_t v1beta1_device_request_allocation_result_t; +#include "v1beta1_device_toleration.h" @@ -24,6 +25,7 @@ typedef struct v1beta1_device_request_allocation_result_t { char *driver; // string char *pool; // string char *request; // string + list_t *tolerations; //nonprimitive container int _library_owned; // Is the library responsible for freeing this object? } v1beta1_device_request_allocation_result_t; @@ -33,7 +35,8 @@ __attribute__((deprecated)) v1beta1_device_request_allocation_result_t *v1beta1_ char *device, char *driver, char *pool, - char *request + char *request, + list_t *tolerations ); void v1beta1_device_request_allocation_result_free(v1beta1_device_request_allocation_result_t *v1beta1_device_request_allocation_result); diff --git a/kubernetes/model/v1beta1_device_sub_request.c b/kubernetes/model/v1beta1_device_sub_request.c new file mode 100644 index 00000000..9bc9aaeb --- /dev/null +++ b/kubernetes/model/v1beta1_device_sub_request.c @@ -0,0 +1,315 @@ +#include +#include +#include +#include "v1beta1_device_sub_request.h" + + + +static v1beta1_device_sub_request_t *v1beta1_device_sub_request_create_internal( + char *allocation_mode, + 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->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, + long count, + char *device_class_name, + char *name, + list_t *selectors, + list_t *tolerations + ) { + return v1beta1_device_sub_request_create_internal ( + allocation_mode, + 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->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->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 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->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, + 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 (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..14e462f9 --- /dev/null +++ b/kubernetes/model/v1beta1_device_sub_request.h @@ -0,0 +1,50 @@ +/* + * 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_device_selector.h" +#include "v1beta1_device_toleration.h" + + + +typedef struct v1beta1_device_sub_request_t { + char *allocation_mode; // string + 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, + 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_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_resource_slice_spec.c b/kubernetes/model/v1beta1_resource_slice_spec.c index 440b3b0d..4a5d4fa7 100644 --- a/kubernetes/model/v1beta1_resource_slice_spec.c +++ b/kubernetes/model/v1beta1_resource_slice_spec.c @@ -11,7 +11,9 @@ static v1beta1_resource_slice_spec_t *v1beta1_resource_slice_spec_create_interna char *driver, char *node_name, v1_node_selector_t *node_selector, - v1beta1_resource_pool_t *pool + 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) { @@ -22,7 +24,9 @@ static v1beta1_resource_slice_spec_t *v1beta1_resource_slice_spec_create_interna 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; @@ -34,7 +38,9 @@ __attribute__((deprecated)) v1beta1_resource_slice_spec_t *v1beta1_resource_slic char *driver, char *node_name, v1_node_selector_t *node_selector, - v1beta1_resource_pool_t *pool + int per_device_node_selection, + v1beta1_resource_pool_t *pool, + list_t *shared_counters ) { return v1beta1_resource_slice_spec_create_internal ( all_nodes, @@ -42,7 +48,9 @@ __attribute__((deprecated)) v1beta1_resource_slice_spec_t *v1beta1_resource_slic driver, node_name, node_selector, - pool + per_device_node_selection, + pool, + shared_counters ); } @@ -78,6 +86,13 @@ void v1beta1_resource_slice_spec_free(v1beta1_resource_slice_spec_t *v1beta1_res 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); } @@ -142,6 +157,14 @@ cJSON *v1beta1_resource_slice_spec_convertToJSON(v1beta1_resource_slice_spec_t * } + // 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; @@ -155,6 +178,26 @@ cJSON *v1beta1_resource_slice_spec_convertToJSON(v1beta1_resource_slice_spec_t * 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) { @@ -176,6 +219,9 @@ v1beta1_resource_slice_spec_t *v1beta1_resource_slice_spec_parseFromJSON(cJSON * // 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)) { @@ -248,6 +294,18 @@ v1beta1_resource_slice_spec_t *v1beta1_resource_slice_spec_parseFromJSON(cJSON * 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)) { @@ -260,6 +318,30 @@ v1beta1_resource_slice_spec_t *v1beta1_resource_slice_spec_parseFromJSON(cJSON * 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, @@ -267,7 +349,9 @@ v1beta1_resource_slice_spec_t *v1beta1_resource_slice_spec_parseFromJSON(cJSON * strdup(driver->valuestring), node_name && !cJSON_IsNull(node_name) ? strdup(node_name->valuestring) : NULL, node_selector ? node_selector_local_nonprim : NULL, - pool_local_nonprim + 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; @@ -289,6 +373,15 @@ v1beta1_resource_slice_spec_t *v1beta1_resource_slice_spec_parseFromJSON(cJSON * 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 index 9738e139..7d3437bf 100644 --- a/kubernetes/model/v1beta1_resource_slice_spec.h +++ b/kubernetes/model/v1beta1_resource_slice_spec.h @@ -16,6 +16,7 @@ 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" @@ -27,7 +28,9 @@ typedef struct v1beta1_resource_slice_spec_t { 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; @@ -38,7 +41,9 @@ __attribute__((deprecated)) v1beta1_resource_slice_spec_t *v1beta1_resource_slic char *driver, char *node_name, v1_node_selector_t *node_selector, - v1beta1_resource_pool_t *pool + 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); diff --git a/kubernetes/model/v1beta1_self_subject_review.c b/kubernetes/model/v1beta1_self_subject_review.c deleted file mode 100644 index 73039f37..00000000 --- a/kubernetes/model/v1beta1_self_subject_review.c +++ /dev/null @@ -1,193 +0,0 @@ -#include -#include -#include -#include "v1beta1_self_subject_review.h" - - - -static v1beta1_self_subject_review_t *v1beta1_self_subject_review_create_internal( - 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; - - v1beta1_self_subject_review_local_var->_library_owned = 1; - return v1beta1_self_subject_review_local_var; -} - -__attribute__((deprecated)) 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 - ) { - return v1beta1_self_subject_review_create_internal ( - api_version, - kind, - metadata, - status - ); -} - -void v1beta1_self_subject_review_free(v1beta1_self_subject_review_t *v1beta1_self_subject_review) { - if(NULL == v1beta1_self_subject_review){ - return ; - } - if(v1beta1_self_subject_review->_library_owned != 1){ - fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_self_subject_review_free"); - 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 (cJSON_IsNull(api_version)) { - api_version = NULL; - } - 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 (cJSON_IsNull(kind)) { - kind = NULL; - } - 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 (cJSON_IsNull(metadata)) { - metadata = NULL; - } - 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 (cJSON_IsNull(status)) { - status = NULL; - } - if (status) { - status_local_nonprim = v1beta1_self_subject_review_status_parseFromJSON(status); //nonprimitive - } - - - v1beta1_self_subject_review_local_var = v1beta1_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, - 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 da0fa078..00000000 --- a/kubernetes/model/v1beta1_self_subject_review.h +++ /dev/null @@ -1,46 +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 - - int _library_owned; // Is the library responsible for freeing this object? -} v1beta1_self_subject_review_t; - -__attribute__((deprecated)) 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 8a75c28f..00000000 --- a/kubernetes/model/v1beta1_self_subject_review_status.c +++ /dev/null @@ -1,97 +0,0 @@ -#include -#include -#include -#include "v1beta1_self_subject_review_status.h" - - - -static v1beta1_self_subject_review_status_t *v1beta1_self_subject_review_status_create_internal( - 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; - - v1beta1_self_subject_review_status_local_var->_library_owned = 1; - return v1beta1_self_subject_review_status_local_var; -} - -__attribute__((deprecated)) v1beta1_self_subject_review_status_t *v1beta1_self_subject_review_status_create( - v1_user_info_t *user_info - ) { - return v1beta1_self_subject_review_status_create_internal ( - user_info - ); -} - -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 ; - } - if(v1beta1_self_subject_review_status->_library_owned != 1){ - fprintf(stderr, "WARNING: %s() does NOT free objects allocated by the user\n", "v1beta1_self_subject_review_status_free"); - 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 (cJSON_IsNull(user_info)) { - user_info = NULL; - } - 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_internal ( - 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 d2e251b7..00000000 --- a/kubernetes/model/v1beta1_self_subject_review_status.h +++ /dev/null @@ -1,39 +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 - - int _library_owned; // Is the library responsible for freeing this object? -} v1beta1_self_subject_review_status_t; - -__attribute__((deprecated)) 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/v1beta2_allocated_device_status.c b/kubernetes/model/v1beta2_allocated_device_status.c new file mode 100644 index 00000000..a4de4e20 --- /dev/null +++ b/kubernetes/model/v1beta2_allocated_device_status.c @@ -0,0 +1,296 @@ +#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 + ) { + 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->_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 + ) { + return v1beta2_allocated_device_status_create_internal ( + conditions, + data, + device, + driver, + network_data, + pool + ); +} + +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; + } + 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 + } + + 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_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) + ); + + 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..4f561ebb --- /dev/null +++ b/kubernetes/model/v1beta2_allocated_device_status.h @@ -0,0 +1,51 @@ +/* + * 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. + */ + +#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 + + 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 +); + +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..bdc2d567 --- /dev/null +++ b/kubernetes/model/v1beta2_allocation_result.c @@ -0,0 +1,135 @@ +#include +#include +#include +#include "v1beta2_allocation_result.h" + + + +static v1beta2_allocation_result_t *v1beta2_allocation_result_create_internal( + 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->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( + v1beta2_device_allocation_result_t *devices, + v1_node_selector_t *node_selector + ) { + return v1beta2_allocation_result_create_internal ( + 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->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->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->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 ( + 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..67472e31 --- /dev/null +++ b/kubernetes/model/v1beta2_allocation_result.h @@ -0,0 +1,42 @@ +/* + * 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 { + 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( + 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_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..e392854b --- /dev/null +++ b/kubernetes/model/v1beta2_device.c @@ -0,0 +1,416 @@ +#include +#include +#include +#include "v1beta2_device.h" + + + +static v1beta2_device_t *v1beta2_device_create_internal( + int all_nodes, + list_t* attributes, + 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->attributes = attributes; + 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, + list_t* attributes, + 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, + attributes, + 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->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->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->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 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->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->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, + attributes ? attributesList : NULL, + 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. + + + // 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..14466626 --- /dev/null +++ b/kubernetes/model/v1beta2_device.h @@ -0,0 +1,57 @@ +/* + * 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 + list_t* attributes; //map + 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, + list_t* attributes, + 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..236f4bc3 --- /dev/null +++ b/kubernetes/model/v1beta2_device_capacity.c @@ -0,0 +1,92 @@ +#include +#include +#include +#include "v1beta2_device_capacity.h" + + + +static v1beta2_device_capacity_t *v1beta2_device_capacity_create_internal( + 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->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( + char *value + ) { + return v1beta2_device_capacity_create_internal ( + 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->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->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; + + // 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 ( + strdup(value->valuestring) + ); + + return v1beta2_device_capacity_local_var; +end: + return NULL; + +} diff --git a/kubernetes/model/v1beta2_device_capacity.h b/kubernetes/model/v1beta2_device_capacity.h new file mode 100644 index 00000000..0e101855 --- /dev/null +++ b/kubernetes/model/v1beta2_device_capacity.h @@ -0,0 +1,38 @@ +/* + * 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; + + + + +typedef struct v1beta2_device_capacity_t { + 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( + 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..56221887 --- /dev/null +++ b/kubernetes/model/v1beta2_device_class_spec.c @@ -0,0 +1,195 @@ +#include +#include +#include +#include "v1beta2_device_class_spec.h" + + + +static v1beta2_device_class_spec_t *v1beta2_device_class_spec_create_internal( + list_t *config, + 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->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, + list_t *selectors + ) { + return v1beta2_device_class_spec_create_internal ( + config, + 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->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->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->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, + 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..093eefec --- /dev/null +++ b/kubernetes/model/v1beta2_device_class_spec.h @@ -0,0 +1,42 @@ +/* + * 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 + 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, + 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..b8e0c54e --- /dev/null +++ b/kubernetes/model/v1beta2_device_constraint.c @@ -0,0 +1,151 @@ +#include +#include +#include +#include "v1beta2_device_constraint.h" + + + +static v1beta2_device_constraint_t *v1beta2_device_constraint_create_internal( + 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->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 *match_attribute, + list_t *requests + ) { + return v1beta2_device_constraint_create_internal ( + 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->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->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->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 ( + 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..39753828 --- /dev/null +++ b/kubernetes/model/v1beta2_device_constraint.h @@ -0,0 +1,40 @@ +/* + * 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 *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 *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..54f4adee --- /dev/null +++ b/kubernetes/model/v1beta2_device_request_allocation_result.c @@ -0,0 +1,284 @@ +#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, + char *device, + char *driver, + char *pool, + char *request, + 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->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->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, + char *device, + char *driver, + char *pool, + char *request, + list_t *tolerations + ) { + return v1beta2_device_request_allocation_result_create_internal ( + admin_access, + device, + driver, + pool, + request, + 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->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->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->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->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->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->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->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, + strdup(device->valuestring), + strdup(driver->valuestring), + strdup(pool->valuestring), + strdup(request->valuestring), + tolerations ? tolerationsList : NULL + ); + + return v1beta2_device_request_allocation_result_local_var; +end: + 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..d33a6429 --- /dev/null +++ b/kubernetes/model/v1beta2_device_request_allocation_result.h @@ -0,0 +1,49 @@ +/* + * 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 + char *device; // string + char *driver; // string + char *pool; // string + char *request; // 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, + char *device, + char *driver, + char *pool, + char *request, + 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..32b0c4da --- /dev/null +++ b/kubernetes/model/v1beta2_device_sub_request.c @@ -0,0 +1,315 @@ +#include +#include +#include +#include "v1beta2_device_sub_request.h" + + + +static v1beta2_device_sub_request_t *v1beta2_device_sub_request_create_internal( + char *allocation_mode, + 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->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, + long count, + char *device_class_name, + char *name, + list_t *selectors, + list_t *tolerations + ) { + return v1beta2_device_sub_request_create_internal ( + allocation_mode, + 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->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->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 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->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, + 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 (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..817157ea --- /dev/null +++ b/kubernetes/model/v1beta2_device_sub_request.h @@ -0,0 +1,50 @@ +/* + * 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_device_selector.h" +#include "v1beta2_device_toleration.h" + + + +typedef struct v1beta2_device_sub_request_t { + char *allocation_mode; // string + 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, + 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..e3281677 --- /dev/null +++ b/kubernetes/model/v1beta2_exact_device_request.c @@ -0,0 +1,307 @@ +#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, + 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->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, + long count, + char *device_class_name, + list_t *selectors, + list_t *tolerations + ) { + return v1beta2_exact_device_request_create_internal ( + admin_access, + allocation_mode, + 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->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->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 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->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, + count ? count->valuedouble : 0, + strdup(device_class_name->valuestring), + selectors ? selectorsList : NULL, + tolerations ? tolerationsList : NULL + ); + + return v1beta2_exact_device_request_local_var; +end: + 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..71b27f62 --- /dev/null +++ b/kubernetes/model/v1beta2_exact_device_request.h @@ -0,0 +1,50 @@ +/* + * 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_device_selector.h" +#include "v1beta2_device_toleration.h" + + + +typedef struct v1beta2_exact_device_request_t { + int admin_access; //boolean + char *allocation_mode; // string + 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, + 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/v2_hpa_scaling_rules.c b/kubernetes/model/v2_hpa_scaling_rules.c index a9b6fbb3..bd95daab 100644 --- a/kubernetes/model/v2_hpa_scaling_rules.c +++ b/kubernetes/model/v2_hpa_scaling_rules.c @@ -8,7 +8,8 @@ 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,6 +18,7 @@ static v2_hpa_scaling_rules_t *v2_hpa_scaling_rules_create_internal( 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; @@ -25,12 +27,14 @@ static v2_hpa_scaling_rules_t *v2_hpa_scaling_rules_create_internal( __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 ) { return v2_hpa_scaling_rules_create_internal ( policies, select_policy, - stabilization_window_seconds + stabilization_window_seconds, + tolerance ); } @@ -54,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); } @@ -95,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) { @@ -158,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_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 9b49320b..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,6 +23,7 @@ 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; @@ -30,7 +31,8 @@ typedef struct v2_hpa_scaling_rules_t { __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/version_info.c b/kubernetes/model/version_info.c index 8cdcb031..337f7b31 100644 --- a/kubernetes/model/version_info.c +++ b/kubernetes/model/version_info.c @@ -8,11 +8,15 @@ 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,11 +26,15 @@ static version_info_t *version_info_create_internal( } 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; @@ -37,22 +45,30 @@ static version_info_t *version_info_create_internal( __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 ); @@ -75,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; @@ -95,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; @@ -127,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; @@ -172,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; @@ -231,6 +295,30 @@ 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)) { @@ -306,6 +394,30 @@ 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)) { @@ -340,11 +452,15 @@ version_info_t *version_info_parseFromJSON(cJSON *version_infoJSON){ 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 a836db29..2928834b 100644 --- a/kubernetes/model/version_info.h +++ b/kubernetes/model/version_info.h @@ -21,11 +21,15 @@ 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 @@ -35,11 +39,15 @@ typedef struct version_info_t { __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/swagger.json b/kubernetes/swagger.json index 523480f1..3e1b7473 100644 --- a/kubernetes/swagger.json +++ b/kubernetes/swagger.json @@ -907,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" }, @@ -915,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": { @@ -924,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" }, @@ -2357,7 +2357,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" }, @@ -2385,12 +2385,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" }, @@ -2400,7 +2405,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" } @@ -2493,7 +2498,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" }, @@ -2529,7 +2534,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" }, @@ -2539,7 +2544,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": [ @@ -2551,7 +2556,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" }, @@ -2569,7 +2574,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" }, @@ -2579,12 +2584,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" } @@ -2818,8 +2828,7 @@ }, "required": [ "selector", - "template", - "serviceName" + "template" ], "type": "object" }, @@ -3156,45 +3165,6 @@ }, "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.", - "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" - }, - "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." - } - }, - "type": "object" - }, "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": { @@ -3968,10 +3938,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" }, @@ -3986,6 +3956,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" @@ -4690,7 +4664,7 @@ "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" }, @@ -4712,7 +4686,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" }, @@ -4735,7 +4709,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 beta-level. To use this field, you must enable the `JobSuccessPolicy` feature gate (enabled 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.", @@ -4789,7 +4763,7 @@ "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": { @@ -4899,7 +4873,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": { @@ -5245,6 +5219,90 @@ ], "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": { @@ -5437,7 +5495,108 @@ "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. (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.", + "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" } }, @@ -6589,6 +6748,10 @@ "$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" @@ -6714,7 +6877,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", @@ -6740,7 +6903,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.", @@ -6767,7 +6930,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.", @@ -6797,7 +6960,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", @@ -6830,7 +6993,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", @@ -6865,14 +7028,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. Must be a C_IDENTIFIER.", "type": "string" }, "secretRef": { @@ -7760,6 +7923,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" @@ -8622,6 +8789,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": { @@ -8661,6 +8839,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" @@ -9294,7 +9476,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 a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).", + "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" }, @@ -9302,7 +9484,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 a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).", + "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" }, @@ -9370,6 +9552,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" @@ -9729,7 +9916,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" }, @@ -9960,6 +10147,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" @@ -9990,7 +10182,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": { @@ -11501,7 +11693,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 a beta 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": { @@ -11762,11 +11954,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": { @@ -11907,7 +12099,7 @@ }, "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). The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type." + "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", @@ -12177,7 +12369,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" }, @@ -12225,15 +12417,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" } }, @@ -12242,8 +12434,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" }, @@ -12265,7 +12465,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" }, @@ -12278,10 +12478,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": { @@ -12305,7 +12505,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" }, @@ -12361,6 +12561,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": { @@ -13142,6 +13355,83 @@ ], "type": "object" }, + "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", + "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.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": "networking.k8s.io", + "kind": "IPAddress", + "version": "v1" + } + ] + }, + "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 the list of IPAddresses.", + "items": { + "$ref": "#/definitions/v1.IPAddress" + }, + "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": "IPAddressList", + "version": "v1" + } + ] + }, + "v1.IPAddressSpec": { + "description": "IPAddressSpec describe the attributes in an IP Address.", + "properties": { + "parentRef": { + "$ref": "#/definitions/v1.ParentReference", + "description": "ParentRef references the resource that an IPAddress is attached to. An IPAddress must reference a parent object." + } + }, + "required": [ + "parentRef" + ], + "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": { @@ -13682,6 +13972,32 @@ ], "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": [ + "resource", + "name" + ], + "type": "object" + }, "v1.ServiceBackendPort": { "description": "ServiceBackendPort is the service port being referenced.", "properties": { @@ -13698,6 +14014,107 @@ "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" + }, "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": { @@ -14127,7 +14544,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" } }, @@ -14600,7 +15017,7 @@ "description": "AllocatedDeviceStatus contains the status of an allocated device, if the driver chooses to report it. This may include driver-specific information.", "properties": { "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.", + "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/v1.Condition" }, @@ -14655,6 +15072,10 @@ "v1alpha3.BasicDevice": { "description": "BasicDevice defines one device instance.", "properties": { + "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" + }, "attributes": { "additionalProperties": { "$ref": "#/definitions/v1alpha3.DeviceAttribute" @@ -14669,6 +15090,30 @@ }, "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/v1alpha3.DeviceCounterConsumption" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + }, + "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" + }, + "nodeSelector": { + "$ref": "#/definitions/v1.NodeSelector", + "description": "NodeSelector defines the nodes 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." + }, + "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/v1alpha3.DeviceTaint" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" } }, "type": "object" @@ -14686,6 +15131,40 @@ ], "type": "object" }, + "v1alpha3.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" + }, + "v1alpha3.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/v1alpha3.Counter" + }, + "description": "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.\n\nTo 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.\n\nThe maximum number of counters is 32.", + "type": "object" + }, + "name": { + "description": "CounterSet is the name of the set from which the counters defined will be consumed.", + "type": "string" + } + }, + "required": [ + "name", + "counters" + ], + "type": "object" + }, "v1alpha3.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": { @@ -14711,7 +15190,7 @@ "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.", + "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" }, @@ -14811,7 +15290,7 @@ "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.", + "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" }, @@ -14928,7 +15407,7 @@ "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.", + "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" }, @@ -14938,42 +15417,78 @@ }, "type": "object" }, + "v1alpha3.DeviceCounterConsumption": { + "description": "DeviceCounterConsumption defines a set of counters that a device will consume from a CounterSet.", + "properties": { + "counterSet": { + "description": "CounterSet defines the set from which the counters defined will be consumed.", + "type": "string" + }, + "counters": { + "additionalProperties": { + "$ref": "#/definitions/v1alpha3.Counter" + }, + "description": "Counters defines the Counter 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" + }, "v1alpha3.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.\n\nA DeviceClassName is currently required. Clients must check that it is indeed set. It's absence indicates that something changed in a way that is not supported by the client yet, in which case it must refuse to handle the request.", + "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.", "properties": { "adminAccess": { - "description": "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.\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.", + "description": "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.\n\nThis field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list.\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" }, "allocationMode": { - "description": "AllocationMode and its related fields define how devices are allocated to satisfy this request. 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 request 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 AlloctionMode 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.\n\nMore modes may get added in the future. Clients must refuse to handle requests with unknown modes.", + "description": "AllocationMode and its related fields define how devices are allocated to satisfy this request. 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 request is for all of the matching devices in a pool.\n At least one device must exist on the node for the allocation to succeed.\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 requests must specify this field.\n\nThis field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list.\n\nMore modes may get added in the future. Clients must refuse to handle requests with unknown modes.", "type": "string" }, "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.", + "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.\n\nThis field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list.", "format": "int64", "type": "integer" }, "deviceClassName": { - "description": "DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this request.\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.", + "description": "DeviceClassName references a specific DeviceClass, which can define additional configuration and selectors to be inherited by this request.\n\nA 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.\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" }, + "firstAvailable": { + "description": "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.\n\nThis field may only be set in the entries of DeviceClaim.Requests.\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/v1alpha3.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\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 request. All selectors must be satisfied for a device to be considered.", + "description": "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.\n\nThis field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list.", "items": { "$ref": "#/definitions/v1alpha3.DeviceSelector" }, "type": "array", "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 field can only be set when deviceClassName is set and no subrequests are specified in the firstAvailable list.\n\nThis is an alpha field and requires enabling the DRADeviceTaints feature gate.", + "items": { + "$ref": "#/definitions/v1alpha3.DeviceToleration" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" } }, "required": [ - "name", - "deviceClassName" + "name" ], "type": "object" }, @@ -14997,8 +15512,16 @@ "type": "string" }, "request": { - "description": "Request is the name of the request in the claim which caused this device to be allocated. Multiple devices may have been allocated per 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" + }, + "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/v1alpha3.DeviceToleration" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" } }, "required": [ @@ -15019,6 +15542,217 @@ }, "type": "object" }, + "v1alpha3.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 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.", + "properties": { + "allocationMode": { + "description": "AllocationMode and its related fields define how devices are allocated to satisfy this request. 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 request 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 requests must specify this field.\n\nMore modes may get added in the future. Clients must refuse to handle requests with unknown modes.", + "type": "string" + }, + "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 request. All selectors must be satisfied for a device to be considered.", + "items": { + "$ref": "#/definitions/v1alpha3.DeviceSelector" + }, + "type": "array", + "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/v1alpha3.DeviceToleration" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + } + }, + "required": [ + "name", + "deviceClassName" + ], + "type": "object" + }, + "v1alpha3.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" + }, + "v1alpha3.DeviceTaintRule": { + "description": "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.", + "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 metadata" + }, + "spec": { + "$ref": "#/definitions/v1alpha3.DeviceTaintRuleSpec", + "description": "Spec specifies the selector and one taint.\n\nChanging the spec automatically increments the metadata.generation number." + } + }, + "required": [ + "spec" + ], + "type": "object", + "x-kubernetes-group-version-kind": [ + { + "group": "resource.k8s.io", + "kind": "DeviceTaintRule", + "version": "v1alpha3" + } + ] + }, + "v1alpha3.DeviceTaintRuleList": { + "description": "DeviceTaintRuleList is a collection of DeviceTaintRules.", + "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 DeviceTaintRules.", + "items": { + "$ref": "#/definitions/v1alpha3.DeviceTaintRule" + }, + "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": "resource.k8s.io", + "kind": "DeviceTaintRuleList", + "version": "v1alpha3" + } + ] + }, + "v1alpha3.DeviceTaintRuleSpec": { + "description": "DeviceTaintRuleSpec specifies the selector and one taint.", + "properties": { + "deviceSelector": { + "$ref": "#/definitions/v1alpha3.DeviceTaintSelector", + "description": "DeviceSelector defines which device(s) the taint is applied to. All selector criteria must be satified for a device to match. The empty selector matches all devices. Without a selector, no devices are matches." + }, + "taint": { + "$ref": "#/definitions/v1alpha3.DeviceTaint", + "description": "The taint that gets applied to matching devices." + } + }, + "required": [ + "taint" + ], + "type": "object" + }, + "v1alpha3.DeviceTaintSelector": { + "description": "DeviceTaintSelector defines which device(s) a DeviceTaintRule applies to. The empty selector matches all devices. Without a selector, no devices are matched.", + "properties": { + "device": { + "description": "If device is set, only devices with that name are selected. This field corresponds to slice.spec.devices[].name.\n\nSetting also driver and pool may be required to avoid ambiguity, but is not required.", + "type": "string" + }, + "deviceClassName": { + "description": "If DeviceClassName is set, the selectors defined there must be satisfied by a device to be selected. This field corresponds to class.metadata.name.", + "type": "string" + }, + "driver": { + "description": "If driver is set, only devices from that driver are selected. This fields corresponds to slice.spec.driver.", + "type": "string" + }, + "pool": { + "description": "If pool is set, only devices in that pool are selected.\n\nAlso 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.", + "type": "string" + }, + "selectors": { + "description": "Selectors contains the same selection criteria as a ResourceClaim. Currently, CEL expressions are supported. All of these selectors must be satisfied.", + "items": { + "$ref": "#/definitions/v1alpha3.DeviceSelector" + }, + "type": "array", + "x-kubernetes-list-type": "atomic" + } + }, + "type": "object" + }, + "v1alpha3.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