From ac85831041bb96f8a09ec5679b954b5315881c75 Mon Sep 17 00:00:00 2001 From: Mikhail Nacharov <1246847+mnacharov@users.noreply.github.com> Date: Thu, 22 May 2025 20:39:25 +0200 Subject: [PATCH 1/3] Generate client version 2.10.0 --- airflow/.openapi-generator/FILES | 145 +- airflow/.openapi-generator/VERSION | 2 +- airflow/README.md | 270 +- airflow/api/openapi.yaml | 11047 ++++++++++------ airflow/api_config.go | 245 +- airflow/api_connection.go | 402 +- airflow/api_dag.go | 1101 +- airflow/api_dag_run.go | 686 +- airflow/api_dag_stats.go | 153 + airflow/api_dag_warning.go | 114 +- airflow/api_dataset.go | 1392 +- airflow/api_event_log.go | 271 +- airflow/api_import_error.go | 160 +- airflow/api_monitoring.go | 131 +- airflow/api_permission.go | 104 +- airflow/api_plugin.go | 102 +- airflow/api_pool.go | 338 +- airflow/api_provider.go | 90 +- airflow/api_role.go | 360 +- airflow/api_task_instance.go | 2573 +++- airflow/api_user.go | 365 +- airflow/api_variable.go | 335 +- airflow/api_x_com.go | 216 +- airflow/client.go | 353 +- airflow/configuration.go | 41 +- airflow/docs/Action.md | 19 - airflow/docs/ActionCollection.md | 69 +- airflow/docs/ActionResource.md | 19 - airflow/docs/BasicDAGRun.md | 209 +- airflow/docs/ClassReference.md | 69 +- airflow/docs/ClearDagRun.md | 19 - airflow/docs/ClearDagRun200Response.md | 536 + airflow/docs/ClearTaskInstances.md | 365 +- airflow/docs/CollectionInfo.md | 21 +- airflow/docs/Config.md | 19 - airflow/docs/ConfigApi.md | 136 +- airflow/docs/ConfigOption.md | 19 - airflow/docs/ConfigSection.md | 19 - airflow/docs/Connection.md | 167 +- airflow/docs/ConnectionApi.md | 231 +- airflow/docs/ConnectionCollection.md | 69 +- airflow/docs/ConnectionCollectionItem.md | 141 +- airflow/docs/ConnectionTest.md | 69 +- airflow/docs/CreateDatasetEvent.md | 87 + airflow/docs/CronExpression.md | 19 - airflow/docs/DAG.md | 983 +- airflow/docs/DAGApi.md | 583 +- airflow/docs/DAGCollection.md | 69 +- airflow/docs/DAGDetail.md | 1295 +- airflow/docs/DAGRun.md | 403 +- airflow/docs/DAGRunApi.md | 385 +- airflow/docs/DAGRunCollection.md | 69 +- airflow/docs/DagProcessorStatus.md | 102 + airflow/docs/DagScheduleDatasetReference.md | 71 +- airflow/docs/DagState.md | 19 - airflow/docs/DagStatsAPI.md | 73 + airflow/docs/DagStatsCollectionItem.md | 92 + airflow/docs/DagStatsCollectionSchema.md | 82 + airflow/docs/DagStatsStateCollectionItem.md | 82 + airflow/docs/DagWarning.md | 71 +- airflow/docs/DagWarningApi.md | 65 +- airflow/docs/DagWarningCollection.md | 71 +- airflow/docs/Dataset.md | 173 +- airflow/docs/DatasetApi.md | 694 +- airflow/docs/DatasetCollection.md | 69 +- airflow/docs/DatasetEvent.md | 147 +- airflow/docs/DatasetEventCollection.md | 69 +- airflow/docs/Error.md | 119 +- airflow/docs/EventLog.md | 349 +- airflow/docs/EventLogApi.md | 120 +- airflow/docs/EventLogCollection.md | 69 +- airflow/docs/ExtraLink.md | 69 +- airflow/docs/ExtraLinkCollection.md | 19 - airflow/docs/GetDagSource200Response.md | 56 + airflow/docs/GetLog200Response.md | 82 + airflow/docs/GetProviders200Response.md | 82 + airflow/docs/HealthInfo.md | 71 +- airflow/docs/HealthStatus.md | 19 - airflow/docs/ImportError.md | 119 +- airflow/docs/ImportErrorApi.md | 95 +- airflow/docs/ImportErrorCollection.md | 69 +- airflow/docs/Job.md | 295 +- airflow/docs/ListDagRunsForm.md | 273 +- airflow/docs/ListTaskInstanceForm.md | 355 +- airflow/docs/MetadatabaseStatus.md | 31 +- airflow/docs/MonitoringApi.md | 83 +- airflow/docs/PermissionApi.md | 59 +- airflow/docs/PluginApi.md | 59 +- airflow/docs/PluginCollection.md | 69 +- airflow/docs/PluginCollectionItem.md | 287 +- airflow/docs/Pool.md | 239 +- airflow/docs/PoolApi.md | 197 +- airflow/docs/PoolCollection.md | 69 +- airflow/docs/Provider.md | 69 +- airflow/docs/ProviderApi.md | 57 +- airflow/docs/ProviderCollection.md | 19 - airflow/docs/QueuedEvent.md | 108 + airflow/docs/QueuedEventCollection.md | 82 + airflow/docs/RelativeDelta.md | 261 +- airflow/docs/Resource.md | 19 - airflow/docs/Role.md | 69 +- airflow/docs/RoleApi.md | 197 +- airflow/docs/RoleCollection.md | 69 +- airflow/docs/SLAMiss.md | 185 +- airflow/docs/ScheduleInterval.md | 259 +- airflow/docs/SchedulerStatus.md | 83 +- airflow/docs/SetDagRunNote.md | 19 - airflow/docs/SetTaskInstanceNote.md | 19 - airflow/docs/Tag.md | 19 - airflow/docs/Task.md | 635 +- airflow/docs/TaskCollection.md | 19 - airflow/docs/TaskExtraLinksInner.md | 56 + airflow/docs/TaskFailedDependency.md | 82 + airflow/docs/TaskInstance.md | 679 +- airflow/docs/TaskInstanceApi.md | 1103 +- airflow/docs/TaskInstanceCollection.md | 69 +- .../docs/TaskInstanceDependencyCollection.md | 56 + airflow/docs/TaskInstanceHistory.md | 702 + airflow/docs/TaskInstanceHistoryCollection.md | 82 + airflow/docs/TaskInstanceReference.md | 95 +- .../docs/TaskInstanceReferenceCollection.md | 19 - airflow/docs/TaskOutletDatasetReference.md | 71 +- airflow/docs/TaskState.md | 19 - airflow/docs/TimeDelta.md | 59 +- airflow/docs/Trigger.md | 119 +- airflow/docs/TriggerRule.md | 27 +- airflow/docs/TriggererStatus.md | 102 + airflow/docs/UpdateDagRunState.md | 19 - airflow/docs/UpdateTaskInstance.md | 29 +- airflow/docs/UpdateTaskInstancesState.md | 181 +- airflow/docs/UpdateTaskState.md | 15 + airflow/docs/User.md | 333 +- airflow/docs/UserApi.md | 201 +- airflow/docs/UserCollection.md | 69 +- airflow/docs/UserCollectionItem.md | 333 +- airflow/docs/UserCollectionItemRolesInner.md | 56 + airflow/docs/Variable.md | 71 +- airflow/docs/VariableApi.md | 197 +- airflow/docs/VariableCollection.md | 69 +- airflow/docs/VariableCollectionItem.md | 71 +- airflow/docs/VersionInfo.md | 71 +- airflow/docs/WeightRule.md | 19 - airflow/docs/XCom.md | 165 +- airflow/docs/XComApi.md | 119 +- airflow/docs/XComCollection.md | 69 +- airflow/docs/XComCollectionItem.md | 147 +- airflow/go.mod | 8 +- airflow/go.sum | 18 +- airflow/model_action.go | 42 +- airflow/model_action_collection.go | 106 +- airflow/model_action_resource.go | 70 +- airflow/model_basic_dag_run.go | 300 +- airflow/model_class_reference.go | 100 +- airflow/model_clear_dag_run.go | 42 +- airflow/model_clear_dag_run_200_response.go | 108 + airflow/model_clear_task_instances.go | 560 +- airflow/model_collection_info.go | 44 +- airflow/model_config.go | 50 +- airflow/model_config_option.go | 50 +- airflow/model_config_section.go | 58 +- airflow/model_connection.go | 252 +- airflow/model_connection_collection.go | 106 +- airflow/model_connection_collection_item.go | 208 +- airflow/model_connection_test_.go | 106 +- airflow/model_create_dataset_event.go | 198 + airflow/model_cron_expression.go | 84 +- airflow/model_dag.go | 1298 +- airflow/model_dag_collection.go | 106 +- airflow/model_dag_detail.go | 1760 +-- airflow/model_dag_processor_status.go | 184 + airflow/model_dag_run.go | 560 +- airflow/model_dag_run_collection.go | 106 +- .../model_dag_schedule_dataset_reference.go | 120 +- airflow/model_dag_state.go | 29 +- airflow/model_dag_stats_collection_item.go | 165 + airflow/model_dag_stats_collection_schema.go | 164 + .../model_dag_stats_state_collection_item.go | 165 + airflow/model_dag_warning.go | 132 +- airflow/model_dag_warning_collection.go | 106 +- airflow/model_dataset.go | 264 +- airflow/model_dataset_collection.go | 106 +- airflow/model_dataset_event.go | 250 +- airflow/model_dataset_event_collection.go | 106 +- airflow/model_error.go | 237 +- airflow/model_event_log.go | 483 +- airflow/model_event_log_collection.go | 108 +- airflow/model_extra_link.go | 108 +- airflow/model_extra_link_collection.go | 50 +- airflow/model_get_dag_source_200_response.go | 127 + airflow/model_get_log_200_response.go | 163 + airflow/model_get_providers_200_response.go | 164 + airflow/model_health_info.go | 122 +- airflow/model_health_status.go | 25 +- airflow/model_import_error.go | 174 +- airflow/model_import_error_collection.go | 106 +- airflow/model_job.go | 390 +- airflow/model_list_dag_runs_form.go | 414 +- airflow/model_list_task_instance_form.go | 583 +- airflow/model_metadatabase_status.go | 66 +- airflow/model_plugin_collection.go | 106 +- airflow/model_plugin_collection_item.go | 451 +- airflow/model_pool.go | 357 +- airflow/model_pool_collection.go | 106 +- airflow/model_provider.go | 110 +- airflow/model_provider_collection.go | 50 +- airflow/model_queued_event.go | 203 + airflow/model_queued_event_collection.go | 164 + airflow/model_relative_delta.go | 450 +- airflow/model_resource.go | 42 +- airflow/model_role.go | 104 +- airflow/model_role_collection.go | 106 +- airflow/model_schedule_interval.go | 46 +- airflow/model_scheduler_status.go | 122 +- airflow/model_set_dag_run_note.go | 42 +- airflow/model_set_task_instance_note.go | 79 +- airflow/model_sla_miss.go | 276 +- airflow/model_tag.go | 42 +- airflow/model_task.go | 951 +- airflow/model_task_collection.go | 50 +- airflow/model_task_extra_links_inner.go | 127 + airflow/model_task_failed_dependency.go | 163 + airflow/model_task_instance.go | 1016 +- airflow/model_task_instance_collection.go | 106 +- ...del_task_instance_dependency_collection.go | 127 + airflow/model_task_instance_history.go | 988 ++ .../model_task_instance_history_collection.go | 164 + airflow/model_task_instance_reference.go | 144 +- ...odel_task_instance_reference_collection.go | 50 +- .../model_task_outlet_dataset_reference.go | 124 +- airflow/model_task_state.go | 49 +- airflow/model_time_delta.go | 136 +- airflow/model_trigger.go | 174 +- airflow/model_trigger_rule.go | 51 +- airflow/model_triggerer_status.go | 184 + airflow/model_update_dag_run_state.go | 42 +- airflow/model_update_task_instance.go | 67 +- airflow/model_update_task_instances_state.go | 307 +- airflow/model_update_task_state.go | 114 + airflow/model_user.go | 486 +- airflow/model_user_collection.go | 106 +- airflow/model_user_collection_item.go | 474 +- .../model_user_collection_item_roles_inner.go | 127 + airflow/model_variable.go | 118 +- airflow/model_variable_collection.go | 106 +- airflow/model_variable_collection_item.go | 110 +- airflow/model_version_info.go | 112 +- airflow/model_weight_rule.go | 27 +- airflow/model_x_com.go | 241 +- airflow/model_x_com_collection.go | 106 +- airflow/model_x_com_collection_item.go | 212 +- airflow/response.go | 21 +- airflow/test/api_config_test.go | 52 + airflow/test/api_connection_test.go | 102 + airflow/test/api_dag_run_test.go | 154 + airflow/test/api_dag_stats_test.go | 37 + airflow/test/api_dag_test.go | 188 + airflow/test/api_dag_warning_test.go | 37 + airflow/test/api_dataset_test.go | 173 + airflow/test/api_event_log_test.go | 51 + airflow/test/api_import_error_test.go | 51 + airflow/test/api_monitoring_test.go | 49 + airflow/test/api_permission_test.go | 37 + airflow/test/api_plugin_test.go | 37 + airflow/test/api_pool_test.go | 90 + airflow/test/api_provider_test.go | 37 + airflow/test/api_role_test.go | 90 + airflow/test/api_task_instance_test.go | 301 + airflow/test/api_user_test.go | 90 + airflow/test/api_variable_test.go | 90 + airflow/test/api_x_com_test.go | 58 + airflow/utils.go | 56 +- go.mod | 30 +- go.sum | 442 +- 273 files changed, 39445 insertions(+), 24575 deletions(-) create mode 100644 airflow/api_dag_stats.go create mode 100644 airflow/docs/ClearDagRun200Response.md create mode 100644 airflow/docs/CreateDatasetEvent.md create mode 100644 airflow/docs/DagProcessorStatus.md create mode 100644 airflow/docs/DagStatsAPI.md create mode 100644 airflow/docs/DagStatsCollectionItem.md create mode 100644 airflow/docs/DagStatsCollectionSchema.md create mode 100644 airflow/docs/DagStatsStateCollectionItem.md create mode 100644 airflow/docs/GetDagSource200Response.md create mode 100644 airflow/docs/GetLog200Response.md create mode 100644 airflow/docs/GetProviders200Response.md create mode 100644 airflow/docs/QueuedEvent.md create mode 100644 airflow/docs/QueuedEventCollection.md create mode 100644 airflow/docs/TaskExtraLinksInner.md create mode 100644 airflow/docs/TaskFailedDependency.md create mode 100644 airflow/docs/TaskInstanceDependencyCollection.md create mode 100644 airflow/docs/TaskInstanceHistory.md create mode 100644 airflow/docs/TaskInstanceHistoryCollection.md create mode 100644 airflow/docs/TriggererStatus.md create mode 100644 airflow/docs/UpdateTaskState.md create mode 100644 airflow/docs/UserCollectionItemRolesInner.md create mode 100644 airflow/model_clear_dag_run_200_response.go create mode 100644 airflow/model_create_dataset_event.go create mode 100644 airflow/model_dag_processor_status.go create mode 100644 airflow/model_dag_stats_collection_item.go create mode 100644 airflow/model_dag_stats_collection_schema.go create mode 100644 airflow/model_dag_stats_state_collection_item.go create mode 100644 airflow/model_get_dag_source_200_response.go create mode 100644 airflow/model_get_log_200_response.go create mode 100644 airflow/model_get_providers_200_response.go create mode 100644 airflow/model_queued_event.go create mode 100644 airflow/model_queued_event_collection.go create mode 100644 airflow/model_task_extra_links_inner.go create mode 100644 airflow/model_task_failed_dependency.go create mode 100644 airflow/model_task_instance_dependency_collection.go create mode 100644 airflow/model_task_instance_history.go create mode 100644 airflow/model_task_instance_history_collection.go create mode 100644 airflow/model_triggerer_status.go create mode 100644 airflow/model_update_task_state.go create mode 100644 airflow/model_user_collection_item_roles_inner.go create mode 100644 airflow/test/api_config_test.go create mode 100644 airflow/test/api_connection_test.go create mode 100644 airflow/test/api_dag_run_test.go create mode 100644 airflow/test/api_dag_stats_test.go create mode 100644 airflow/test/api_dag_test.go create mode 100644 airflow/test/api_dag_warning_test.go create mode 100644 airflow/test/api_dataset_test.go create mode 100644 airflow/test/api_event_log_test.go create mode 100644 airflow/test/api_import_error_test.go create mode 100644 airflow/test/api_monitoring_test.go create mode 100644 airflow/test/api_permission_test.go create mode 100644 airflow/test/api_plugin_test.go create mode 100644 airflow/test/api_pool_test.go create mode 100644 airflow/test/api_provider_test.go create mode 100644 airflow/test/api_role_test.go create mode 100644 airflow/test/api_task_instance_test.go create mode 100644 airflow/test/api_user_test.go create mode 100644 airflow/test/api_variable_test.go create mode 100644 airflow/test/api_x_com_test.go diff --git a/airflow/.openapi-generator/FILES b/airflow/.openapi-generator/FILES index 0df9136..567de15 100644 --- a/airflow/.openapi-generator/FILES +++ b/airflow/.openapi-generator/FILES @@ -5,6 +5,7 @@ api_config.go api_connection.go api_dag.go api_dag_run.go +api_dag_stats.go api_dag_warning.go api_dataset.go api_event_log.go @@ -23,86 +24,82 @@ client.go configuration.go docs/Action.md docs/ActionCollection.md -docs/ActionCollectionAllOf.md docs/ActionResource.md docs/BasicDAGRun.md docs/ClassReference.md docs/ClearDagRun.md +docs/ClearDagRun200Response.md docs/ClearTaskInstances.md docs/CollectionInfo.md docs/Config.md -docs/ConfigApi.md +docs/ConfigAPI.md docs/ConfigOption.md docs/ConfigSection.md docs/Connection.md -docs/ConnectionAllOf.md -docs/ConnectionApi.md +docs/ConnectionAPI.md docs/ConnectionCollection.md -docs/ConnectionCollectionAllOf.md docs/ConnectionCollectionItem.md docs/ConnectionTest.md +docs/CreateDatasetEvent.md docs/CronExpression.md docs/DAG.md -docs/DAGApi.md +docs/DAGAPI.md docs/DAGCollection.md -docs/DAGCollectionAllOf.md docs/DAGDetail.md -docs/DAGDetailAllOf.md docs/DAGRun.md -docs/DAGRunApi.md +docs/DAGRunAPI.md docs/DAGRunCollection.md -docs/DAGRunCollectionAllOf.md +docs/DagProcessorStatus.md docs/DagScheduleDatasetReference.md docs/DagState.md +docs/DagStatsAPI.md +docs/DagStatsCollectionItem.md +docs/DagStatsCollectionSchema.md +docs/DagStatsStateCollectionItem.md docs/DagWarning.md -docs/DagWarningApi.md +docs/DagWarningAPI.md docs/DagWarningCollection.md -docs/DagWarningCollectionAllOf.md docs/Dataset.md -docs/DatasetApi.md +docs/DatasetAPI.md docs/DatasetCollection.md -docs/DatasetCollectionAllOf.md docs/DatasetEvent.md docs/DatasetEventCollection.md -docs/DatasetEventCollectionAllOf.md docs/Error.md docs/EventLog.md -docs/EventLogApi.md +docs/EventLogAPI.md docs/EventLogCollection.md -docs/EventLogCollectionAllOf.md docs/ExtraLink.md docs/ExtraLinkCollection.md +docs/GetDagSource200Response.md +docs/GetLog200Response.md +docs/GetProviders200Response.md docs/HealthInfo.md docs/HealthStatus.md docs/ImportError.md -docs/ImportErrorApi.md +docs/ImportErrorAPI.md docs/ImportErrorCollection.md -docs/ImportErrorCollectionAllOf.md -docs/InlineResponse200.md -docs/InlineResponse2001.md docs/Job.md docs/ListDagRunsForm.md docs/ListTaskInstanceForm.md docs/MetadatabaseStatus.md -docs/MonitoringApi.md -docs/PermissionApi.md -docs/PluginApi.md +docs/MonitoringAPI.md +docs/PermissionAPI.md +docs/PluginAPI.md docs/PluginCollection.md -docs/PluginCollectionAllOf.md docs/PluginCollectionItem.md docs/Pool.md -docs/PoolApi.md +docs/PoolAPI.md docs/PoolCollection.md -docs/PoolCollectionAllOf.md docs/Provider.md -docs/ProviderApi.md +docs/ProviderAPI.md docs/ProviderCollection.md +docs/QueuedEvent.md +docs/QueuedEventCollection.md docs/RelativeDelta.md docs/Resource.md docs/Role.md -docs/RoleApi.md +docs/RoleAPI.md docs/RoleCollection.md -docs/RoleCollectionAllOf.md docs/SLAMiss.md docs/ScheduleInterval.md docs/SchedulerStatus.md @@ -111,11 +108,14 @@ docs/SetTaskInstanceNote.md docs/Tag.md docs/Task.md docs/TaskCollection.md -docs/TaskExtraLinks.md +docs/TaskExtraLinksInner.md +docs/TaskFailedDependency.md docs/TaskInstance.md -docs/TaskInstanceApi.md +docs/TaskInstanceAPI.md docs/TaskInstanceCollection.md -docs/TaskInstanceCollectionAllOf.md +docs/TaskInstanceDependencyCollection.md +docs/TaskInstanceHistory.md +docs/TaskInstanceHistoryCollection.md docs/TaskInstanceReference.md docs/TaskInstanceReferenceCollection.md docs/TaskOutletDatasetReference.md @@ -123,100 +123,91 @@ docs/TaskState.md docs/TimeDelta.md docs/Trigger.md docs/TriggerRule.md +docs/TriggererStatus.md docs/UpdateDagRunState.md docs/UpdateTaskInstance.md docs/UpdateTaskInstancesState.md +docs/UpdateTaskState.md docs/User.md -docs/UserAllOf.md -docs/UserApi.md +docs/UserAPI.md docs/UserCollection.md -docs/UserCollectionAllOf.md docs/UserCollectionItem.md -docs/UserCollectionItemRoles.md +docs/UserCollectionItemRolesInner.md docs/Variable.md -docs/VariableAllOf.md -docs/VariableApi.md +docs/VariableAPI.md docs/VariableCollection.md -docs/VariableCollectionAllOf.md docs/VariableCollectionItem.md docs/VersionInfo.md docs/WeightRule.md docs/XCom.md -docs/XComAllOf.md -docs/XComApi.md +docs/XComAPI.md docs/XComCollection.md -docs/XComCollectionAllOf.md docs/XComCollectionItem.md go.mod go.sum model_action.go model_action_collection.go -model_action_collection_all_of.go model_action_resource.go model_basic_dag_run.go model_class_reference.go model_clear_dag_run.go +model_clear_dag_run_200_response.go model_clear_task_instances.go model_collection_info.go model_config.go model_config_option.go model_config_section.go model_connection.go -model_connection_all_of.go model_connection_collection.go -model_connection_collection_all_of.go model_connection_collection_item.go model_connection_test_.go +model_create_dataset_event.go model_cron_expression.go model_dag.go model_dag_collection.go -model_dag_collection_all_of.go model_dag_detail.go -model_dag_detail_all_of.go +model_dag_processor_status.go model_dag_run.go model_dag_run_collection.go -model_dag_run_collection_all_of.go model_dag_schedule_dataset_reference.go model_dag_state.go +model_dag_stats_collection_item.go +model_dag_stats_collection_schema.go +model_dag_stats_state_collection_item.go model_dag_warning.go model_dag_warning_collection.go -model_dag_warning_collection_all_of.go model_dataset.go model_dataset_collection.go -model_dataset_collection_all_of.go model_dataset_event.go model_dataset_event_collection.go -model_dataset_event_collection_all_of.go model_error.go model_event_log.go model_event_log_collection.go -model_event_log_collection_all_of.go model_extra_link.go model_extra_link_collection.go +model_get_dag_source_200_response.go +model_get_log_200_response.go +model_get_providers_200_response.go model_health_info.go model_health_status.go model_import_error.go model_import_error_collection.go -model_import_error_collection_all_of.go -model_inline_response_200.go -model_inline_response_200_1.go model_job.go model_list_dag_runs_form.go model_list_task_instance_form.go model_metadatabase_status.go model_plugin_collection.go -model_plugin_collection_all_of.go model_plugin_collection_item.go model_pool.go model_pool_collection.go -model_pool_collection_all_of.go model_provider.go model_provider_collection.go +model_queued_event.go +model_queued_event_collection.go model_relative_delta.go model_resource.go model_role.go model_role_collection.go -model_role_collection_all_of.go model_schedule_interval.go model_scheduler_status.go model_set_dag_run_note.go @@ -225,10 +216,13 @@ model_sla_miss.go model_tag.go model_task.go model_task_collection.go -model_task_extra_links.go +model_task_extra_links_inner.go +model_task_failed_dependency.go model_task_instance.go model_task_instance_collection.go -model_task_instance_collection_all_of.go +model_task_instance_dependency_collection.go +model_task_instance_history.go +model_task_instance_history_collection.go model_task_instance_reference.go model_task_instance_reference_collection.go model_task_outlet_dataset_reference.go @@ -236,26 +230,41 @@ model_task_state.go model_time_delta.go model_trigger.go model_trigger_rule.go +model_triggerer_status.go model_update_dag_run_state.go model_update_task_instance.go model_update_task_instances_state.go +model_update_task_state.go model_user.go -model_user_all_of.go model_user_collection.go -model_user_collection_all_of.go model_user_collection_item.go -model_user_collection_item_roles.go +model_user_collection_item_roles_inner.go model_variable.go -model_variable_all_of.go model_variable_collection.go -model_variable_collection_all_of.go model_variable_collection_item.go model_version_info.go model_weight_rule.go model_x_com.go -model_x_com_all_of.go model_x_com_collection.go -model_x_com_collection_all_of.go model_x_com_collection_item.go response.go +test/api_config_test.go +test/api_connection_test.go +test/api_dag_run_test.go +test/api_dag_stats_test.go +test/api_dag_test.go +test/api_dag_warning_test.go +test/api_dataset_test.go +test/api_event_log_test.go +test/api_import_error_test.go +test/api_monitoring_test.go +test/api_permission_test.go +test/api_plugin_test.go +test/api_pool_test.go +test/api_provider_test.go +test/api_role_test.go +test/api_task_instance_test.go +test/api_user_test.go +test/api_variable_test.go +test/api_x_com_test.go utils.go diff --git a/airflow/.openapi-generator/VERSION b/airflow/.openapi-generator/VERSION index e230c83..eb1dc6a 100644 --- a/airflow/.openapi-generator/VERSION +++ b/airflow/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.0 \ No newline at end of file +7.13.0 diff --git a/airflow/README.md b/airflow/README.md index 5d8a4dc..02fa220 100644 --- a/airflow/README.md +++ b/airflow/README.md @@ -6,9 +6,7 @@ to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -16,7 +14,6 @@ specific language governing permissions and limitations under the License. --> - # Go API client for airflow # Overview @@ -85,7 +82,7 @@ resource in the response body. ### Delete -Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. +Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions @@ -96,12 +93,14 @@ The response usually returns a `204 No Content` response code upon success. - Field names are in snake_case. ```json { + \"description\": \"string\", \"name\": \"string\", - \"slots\": 0, \"occupied_slots\": 0, - \"used_slots\": 0, - \"queued_slots\": 0, \"open_slots\": 0 + \"queued_slots\": 0, + \"running_slots\": 0, + \"scheduled_slots\": 0, + \"slots\": 0, } ``` @@ -147,7 +146,7 @@ curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \ Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: -1. Download the API specification by clicking the **Download** button at top of this document +1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI @@ -232,8 +231,9 @@ fulfilling the request. ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 2.5.0 -- Package version: 2.5.0 +- API version: 2.10.5 +- Package version: 2.10.5 +- Generator version: 7.13.0 - Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit [https://airflow.apache.org](https://airflow.apache.org) @@ -241,21 +241,20 @@ For more information, please visit [https://airflow.apache.org](https://airflow. Install the following dependencies: -```shell +```sh go get github.com/stretchr/testify/assert -go get golang.org/x/oauth2 go get golang.org/x/net/context ``` Put the package under your project folder and add the following in import: -```golang -import sw "./airflow" +```go +import fab "github.com/airflow/airflow-client-go/airflow/" ``` To use a proxy, set the environment variable `HTTP_PROXY`: -```golang +```go os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") ``` @@ -265,18 +264,18 @@ Default configuration comes with `Servers` field that contains server objects as ### Select Server Configuration -For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. +For using other server than the one defined on index 0 set context value `airflow.ContextServerIndex` of type `int`. -```golang -ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1) +```go +ctx := context.WithValue(context.Background(), airflow.ContextServerIndex, 1) ``` ### Templated Server URL -Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. +Templated server URL is formatted using default variables from configuration or from context value `airflow.ContextServerVariables` of type `map[string]string`. -```golang -ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{ +```go +ctx := context.WithValue(context.Background(), airflow.ContextServerVariables, map[string]string{ "basePath": "v2", }) ``` @@ -287,13 +286,13 @@ Note, enum values are always validated and all unused variables are silently ign Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. An operation is uniquely identified by `"{classname}Service.{nickname}"` string. -Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. +Similar rules for overriding default operation server index and variables applies by using `airflow.ContextOperationServerIndices` and `airflow.ContextOperationServerVariables` context maps. -``` -ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{ +```go +ctx := context.WithValue(context.Background(), airflow.ContextOperationServerIndices, map[string]int{ "{classname}Service.{nickname}": 2, }) -ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{ +ctx = context.WithValue(context.Background(), airflow.ContextOperationServerVariables, map[string]map[string]string{ "{classname}Service.{nickname}": { "port": "8443", }, @@ -302,156 +301,167 @@ ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables ## Documentation for API Endpoints -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*ConfigApi* | [**GetConfig**](docs/ConfigApi.md#getconfig) | **Get** /config | Get current configuration -*ConnectionApi* | [**DeleteConnection**](docs/ConnectionApi.md#deleteconnection) | **Delete** /connections/{connection_id} | Delete a connection -*ConnectionApi* | [**GetConnection**](docs/ConnectionApi.md#getconnection) | **Get** /connections/{connection_id} | Get a connection -*ConnectionApi* | [**GetConnections**](docs/ConnectionApi.md#getconnections) | **Get** /connections | List connections -*ConnectionApi* | [**PatchConnection**](docs/ConnectionApi.md#patchconnection) | **Patch** /connections/{connection_id} | Update a connection -*ConnectionApi* | [**PostConnection**](docs/ConnectionApi.md#postconnection) | **Post** /connections | Create a connection -*ConnectionApi* | [**TestConnection**](docs/ConnectionApi.md#testconnection) | **Post** /connections/test | Test a connection -*DAGApi* | [**DeleteDag**](docs/DAGApi.md#deletedag) | **Delete** /dags/{dag_id} | Delete a DAG -*DAGApi* | [**GetDag**](docs/DAGApi.md#getdag) | **Get** /dags/{dag_id} | Get basic information about a DAG -*DAGApi* | [**GetDagDetails**](docs/DAGApi.md#getdagdetails) | **Get** /dags/{dag_id}/details | Get a simplified representation of DAG -*DAGApi* | [**GetDagSource**](docs/DAGApi.md#getdagsource) | **Get** /dagSources/{file_token} | Get a source code -*DAGApi* | [**GetDags**](docs/DAGApi.md#getdags) | **Get** /dags | List DAGs -*DAGApi* | [**GetTask**](docs/DAGApi.md#gettask) | **Get** /dags/{dag_id}/tasks/{task_id} | Get simplified representation of a task -*DAGApi* | [**GetTasks**](docs/DAGApi.md#gettasks) | **Get** /dags/{dag_id}/tasks | Get tasks for DAG -*DAGApi* | [**PatchDag**](docs/DAGApi.md#patchdag) | **Patch** /dags/{dag_id} | Update a DAG -*DAGApi* | [**PatchDags**](docs/DAGApi.md#patchdags) | **Patch** /dags | Update DAGs -*DAGApi* | [**PostClearTaskInstances**](docs/DAGApi.md#postcleartaskinstances) | **Post** /dags/{dag_id}/clearTaskInstances | Clear a set of task instances -*DAGApi* | [**PostSetTaskInstancesState**](docs/DAGApi.md#postsettaskinstancesstate) | **Post** /dags/{dag_id}/updateTaskInstancesState | Set a state of task instances -*DAGApi* | [**SetMappedTaskInstanceNote**](docs/DAGApi.md#setmappedtaskinstancenote) | **Patch** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}/setNote | Update the TaskInstance note. -*DAGApi* | [**SetTaskInstanceNote**](docs/DAGApi.md#settaskinstancenote) | **Patch** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/setNote | Update the TaskInstance note. -*DAGRunApi* | [**ClearDagRun**](docs/DAGRunApi.md#cleardagrun) | **Post** /dags/{dag_id}/dagRuns/{dag_run_id}/clear | Clear a DAG run -*DAGRunApi* | [**DeleteDagRun**](docs/DAGRunApi.md#deletedagrun) | **Delete** /dags/{dag_id}/dagRuns/{dag_run_id} | Delete a DAG run -*DAGRunApi* | [**GetDagRun**](docs/DAGRunApi.md#getdagrun) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id} | Get a DAG run -*DAGRunApi* | [**GetDagRuns**](docs/DAGRunApi.md#getdagruns) | **Get** /dags/{dag_id}/dagRuns | List DAG runs -*DAGRunApi* | [**GetDagRunsBatch**](docs/DAGRunApi.md#getdagrunsbatch) | **Post** /dags/~/dagRuns/list | List DAG runs (batch) -*DAGRunApi* | [**GetUpstreamDatasetEvents**](docs/DAGRunApi.md#getupstreamdatasetevents) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/upstreamDatasetEvents | Get dataset events for a DAG run -*DAGRunApi* | [**PostDagRun**](docs/DAGRunApi.md#postdagrun) | **Post** /dags/{dag_id}/dagRuns | Trigger a new DAG run -*DAGRunApi* | [**SetDagRunNote**](docs/DAGRunApi.md#setdagrunnote) | **Patch** /dags/{dag_id}/dagRuns/{dag_run_id}/setNote | Update the DagRun note. -*DAGRunApi* | [**UpdateDagRunState**](docs/DAGRunApi.md#updatedagrunstate) | **Patch** /dags/{dag_id}/dagRuns/{dag_run_id} | Modify a DAG run -*DagWarningApi* | [**GetDagWarnings**](docs/DagWarningApi.md#getdagwarnings) | **Get** /dagWarnings | List dag warnings -*DatasetApi* | [**GetDataset**](docs/DatasetApi.md#getdataset) | **Get** /datasets/{uri} | Get a dataset -*DatasetApi* | [**GetDatasetEvents**](docs/DatasetApi.md#getdatasetevents) | **Get** /datasets/events | Get dataset events -*DatasetApi* | [**GetDatasets**](docs/DatasetApi.md#getdatasets) | **Get** /datasets | List datasets -*DatasetApi* | [**GetUpstreamDatasetEvents**](docs/DatasetApi.md#getupstreamdatasetevents) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/upstreamDatasetEvents | Get dataset events for a DAG run -*EventLogApi* | [**GetEventLog**](docs/EventLogApi.md#geteventlog) | **Get** /eventLogs/{event_log_id} | Get a log entry -*EventLogApi* | [**GetEventLogs**](docs/EventLogApi.md#geteventlogs) | **Get** /eventLogs | List log entries -*ImportErrorApi* | [**GetImportError**](docs/ImportErrorApi.md#getimporterror) | **Get** /importErrors/{import_error_id} | Get an import error -*ImportErrorApi* | [**GetImportErrors**](docs/ImportErrorApi.md#getimporterrors) | **Get** /importErrors | List import errors -*MonitoringApi* | [**GetHealth**](docs/MonitoringApi.md#gethealth) | **Get** /health | Get instance status -*MonitoringApi* | [**GetVersion**](docs/MonitoringApi.md#getversion) | **Get** /version | Get version information -*PermissionApi* | [**GetPermissions**](docs/PermissionApi.md#getpermissions) | **Get** /permissions | List permissions -*PluginApi* | [**GetPlugins**](docs/PluginApi.md#getplugins) | **Get** /plugins | Get a list of loaded plugins -*PoolApi* | [**DeletePool**](docs/PoolApi.md#deletepool) | **Delete** /pools/{pool_name} | Delete a pool -*PoolApi* | [**GetPool**](docs/PoolApi.md#getpool) | **Get** /pools/{pool_name} | Get a pool -*PoolApi* | [**GetPools**](docs/PoolApi.md#getpools) | **Get** /pools | List pools -*PoolApi* | [**PatchPool**](docs/PoolApi.md#patchpool) | **Patch** /pools/{pool_name} | Update a pool -*PoolApi* | [**PostPool**](docs/PoolApi.md#postpool) | **Post** /pools | Create a pool -*ProviderApi* | [**GetProviders**](docs/ProviderApi.md#getproviders) | **Get** /providers | List providers -*RoleApi* | [**DeleteRole**](docs/RoleApi.md#deleterole) | **Delete** /roles/{role_name} | Delete a role -*RoleApi* | [**GetRole**](docs/RoleApi.md#getrole) | **Get** /roles/{role_name} | Get a role -*RoleApi* | [**GetRoles**](docs/RoleApi.md#getroles) | **Get** /roles | List roles -*RoleApi* | [**PatchRole**](docs/RoleApi.md#patchrole) | **Patch** /roles/{role_name} | Update a role -*RoleApi* | [**PostRole**](docs/RoleApi.md#postrole) | **Post** /roles | Create a role -*TaskInstanceApi* | [**GetExtraLinks**](docs/TaskInstanceApi.md#getextralinks) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/links | List extra links -*TaskInstanceApi* | [**GetLog**](docs/TaskInstanceApi.md#getlog) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/logs/{task_try_number} | Get logs -*TaskInstanceApi* | [**GetMappedTaskInstance**](docs/TaskInstanceApi.md#getmappedtaskinstance) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index} | Get a mapped task instance -*TaskInstanceApi* | [**GetMappedTaskInstances**](docs/TaskInstanceApi.md#getmappedtaskinstances) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/listMapped | List mapped task instances -*TaskInstanceApi* | [**GetTaskInstance**](docs/TaskInstanceApi.md#gettaskinstance) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id} | Get a task instance -*TaskInstanceApi* | [**GetTaskInstances**](docs/TaskInstanceApi.md#gettaskinstances) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances | List task instances -*TaskInstanceApi* | [**GetTaskInstancesBatch**](docs/TaskInstanceApi.md#gettaskinstancesbatch) | **Post** /dags/~/dagRuns/~/taskInstances/list | List task instances (batch) -*TaskInstanceApi* | [**PatchMappedTaskInstance**](docs/TaskInstanceApi.md#patchmappedtaskinstance) | **Patch** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index} | Updates the state of a mapped task instance -*TaskInstanceApi* | [**PatchTaskInstance**](docs/TaskInstanceApi.md#patchtaskinstance) | **Patch** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id} | Updates the state of a task instance -*UserApi* | [**DeleteUser**](docs/UserApi.md#deleteuser) | **Delete** /users/{username} | Delete a user -*UserApi* | [**GetUser**](docs/UserApi.md#getuser) | **Get** /users/{username} | Get a user -*UserApi* | [**GetUsers**](docs/UserApi.md#getusers) | **Get** /users | List users -*UserApi* | [**PatchUser**](docs/UserApi.md#patchuser) | **Patch** /users/{username} | Update a user -*UserApi* | [**PostUser**](docs/UserApi.md#postuser) | **Post** /users | Create a user -*VariableApi* | [**DeleteVariable**](docs/VariableApi.md#deletevariable) | **Delete** /variables/{variable_key} | Delete a variable -*VariableApi* | [**GetVariable**](docs/VariableApi.md#getvariable) | **Get** /variables/{variable_key} | Get a variable -*VariableApi* | [**GetVariables**](docs/VariableApi.md#getvariables) | **Get** /variables | List variables -*VariableApi* | [**PatchVariable**](docs/VariableApi.md#patchvariable) | **Patch** /variables/{variable_key} | Update a variable -*VariableApi* | [**PostVariables**](docs/VariableApi.md#postvariables) | **Post** /variables | Create a variable -*XComApi* | [**GetXcomEntries**](docs/XComApi.md#getxcomentries) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries | List XCom entries -*XComApi* | [**GetXcomEntry**](docs/XComApi.md#getxcomentry) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries/{xcom_key} | Get an XCom entry +*ConfigAPI* | [**GetConfig**](docs/ConfigAPI.md#getconfig) | **Get** /config | Get current configuration +*ConfigAPI* | [**GetValue**](docs/ConfigAPI.md#getvalue) | **Get** /config/section/{section}/option/{option} | Get a option from configuration +*ConnectionAPI* | [**DeleteConnection**](docs/ConnectionAPI.md#deleteconnection) | **Delete** /connections/{connection_id} | Delete a connection +*ConnectionAPI* | [**GetConnection**](docs/ConnectionAPI.md#getconnection) | **Get** /connections/{connection_id} | Get a connection +*ConnectionAPI* | [**GetConnections**](docs/ConnectionAPI.md#getconnections) | **Get** /connections | List connections +*ConnectionAPI* | [**PatchConnection**](docs/ConnectionAPI.md#patchconnection) | **Patch** /connections/{connection_id} | Update a connection +*ConnectionAPI* | [**PostConnection**](docs/ConnectionAPI.md#postconnection) | **Post** /connections | Create a connection +*ConnectionAPI* | [**TestConnection**](docs/ConnectionAPI.md#testconnection) | **Post** /connections/test | Test a connection +*DAGAPI* | [**DeleteDag**](docs/DAGAPI.md#deletedag) | **Delete** /dags/{dag_id} | Delete a DAG +*DAGAPI* | [**GetDag**](docs/DAGAPI.md#getdag) | **Get** /dags/{dag_id} | Get basic information about a DAG +*DAGAPI* | [**GetDagDetails**](docs/DAGAPI.md#getdagdetails) | **Get** /dags/{dag_id}/details | Get a simplified representation of DAG +*DAGAPI* | [**GetDagSource**](docs/DAGAPI.md#getdagsource) | **Get** /dagSources/{file_token} | Get a source code +*DAGAPI* | [**GetDags**](docs/DAGAPI.md#getdags) | **Get** /dags | List DAGs +*DAGAPI* | [**GetTask**](docs/DAGAPI.md#gettask) | **Get** /dags/{dag_id}/tasks/{task_id} | Get simplified representation of a task +*DAGAPI* | [**GetTasks**](docs/DAGAPI.md#gettasks) | **Get** /dags/{dag_id}/tasks | Get tasks for DAG +*DAGAPI* | [**PatchDag**](docs/DAGAPI.md#patchdag) | **Patch** /dags/{dag_id} | Update a DAG +*DAGAPI* | [**PatchDags**](docs/DAGAPI.md#patchdags) | **Patch** /dags | Update DAGs +*DAGAPI* | [**PostClearTaskInstances**](docs/DAGAPI.md#postcleartaskinstances) | **Post** /dags/{dag_id}/clearTaskInstances | Clear a set of task instances +*DAGAPI* | [**PostSetTaskInstancesState**](docs/DAGAPI.md#postsettaskinstancesstate) | **Post** /dags/{dag_id}/updateTaskInstancesState | Set a state of task instances +*DAGAPI* | [**ReparseDagFile**](docs/DAGAPI.md#reparsedagfile) | **Put** /parseDagFile/{file_token} | Request re-parsing of a DAG file +*DAGRunAPI* | [**ClearDagRun**](docs/DAGRunAPI.md#cleardagrun) | **Post** /dags/{dag_id}/dagRuns/{dag_run_id}/clear | Clear a DAG run +*DAGRunAPI* | [**DeleteDagRun**](docs/DAGRunAPI.md#deletedagrun) | **Delete** /dags/{dag_id}/dagRuns/{dag_run_id} | Delete a DAG run +*DAGRunAPI* | [**GetDagRun**](docs/DAGRunAPI.md#getdagrun) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id} | Get a DAG run +*DAGRunAPI* | [**GetDagRuns**](docs/DAGRunAPI.md#getdagruns) | **Get** /dags/{dag_id}/dagRuns | List DAG runs +*DAGRunAPI* | [**GetDagRunsBatch**](docs/DAGRunAPI.md#getdagrunsbatch) | **Post** /dags/~/dagRuns/list | List DAG runs (batch) +*DAGRunAPI* | [**GetUpstreamDatasetEvents**](docs/DAGRunAPI.md#getupstreamdatasetevents) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/upstreamDatasetEvents | Get dataset events for a DAG run +*DAGRunAPI* | [**PostDagRun**](docs/DAGRunAPI.md#postdagrun) | **Post** /dags/{dag_id}/dagRuns | Trigger a new DAG run. +*DAGRunAPI* | [**SetDagRunNote**](docs/DAGRunAPI.md#setdagrunnote) | **Patch** /dags/{dag_id}/dagRuns/{dag_run_id}/setNote | Update the DagRun note. +*DAGRunAPI* | [**UpdateDagRunState**](docs/DAGRunAPI.md#updatedagrunstate) | **Patch** /dags/{dag_id}/dagRuns/{dag_run_id} | Modify a DAG run +*DagStatsAPI* | [**GetDagStats**](docs/DagStatsAPI.md#getdagstats) | **Get** /dagStats | List Dag statistics +*DagWarningAPI* | [**GetDagWarnings**](docs/DagWarningAPI.md#getdagwarnings) | **Get** /dagWarnings | List dag warnings +*DatasetAPI* | [**CreateDatasetEvent**](docs/DatasetAPI.md#createdatasetevent) | **Post** /datasets/events | Create dataset event +*DatasetAPI* | [**DeleteDagDatasetQueuedEvent**](docs/DatasetAPI.md#deletedagdatasetqueuedevent) | **Delete** /dags/{dag_id}/datasets/queuedEvent/{uri} | Delete a queued Dataset event for a DAG. +*DatasetAPI* | [**DeleteDagDatasetQueuedEvents**](docs/DatasetAPI.md#deletedagdatasetqueuedevents) | **Delete** /dags/{dag_id}/datasets/queuedEvent | Delete queued Dataset events for a DAG. +*DatasetAPI* | [**DeleteDatasetQueuedEvents**](docs/DatasetAPI.md#deletedatasetqueuedevents) | **Delete** /datasets/queuedEvent/{uri} | Delete queued Dataset events for a Dataset. +*DatasetAPI* | [**GetDagDatasetQueuedEvent**](docs/DatasetAPI.md#getdagdatasetqueuedevent) | **Get** /dags/{dag_id}/datasets/queuedEvent/{uri} | Get a queued Dataset event for a DAG +*DatasetAPI* | [**GetDagDatasetQueuedEvents**](docs/DatasetAPI.md#getdagdatasetqueuedevents) | **Get** /dags/{dag_id}/datasets/queuedEvent | Get queued Dataset events for a DAG. +*DatasetAPI* | [**GetDataset**](docs/DatasetAPI.md#getdataset) | **Get** /datasets/{uri} | Get a dataset +*DatasetAPI* | [**GetDatasetEvents**](docs/DatasetAPI.md#getdatasetevents) | **Get** /datasets/events | Get dataset events +*DatasetAPI* | [**GetDatasetQueuedEvents**](docs/DatasetAPI.md#getdatasetqueuedevents) | **Get** /datasets/queuedEvent/{uri} | Get queued Dataset events for a Dataset. +*DatasetAPI* | [**GetDatasets**](docs/DatasetAPI.md#getdatasets) | **Get** /datasets | List datasets +*DatasetAPI* | [**GetUpstreamDatasetEvents**](docs/DatasetAPI.md#getupstreamdatasetevents) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/upstreamDatasetEvents | Get dataset events for a DAG run +*EventLogAPI* | [**GetEventLog**](docs/EventLogAPI.md#geteventlog) | **Get** /eventLogs/{event_log_id} | Get a log entry +*EventLogAPI* | [**GetEventLogs**](docs/EventLogAPI.md#geteventlogs) | **Get** /eventLogs | List log entries +*ImportErrorAPI* | [**GetImportError**](docs/ImportErrorAPI.md#getimporterror) | **Get** /importErrors/{import_error_id} | Get an import error +*ImportErrorAPI* | [**GetImportErrors**](docs/ImportErrorAPI.md#getimporterrors) | **Get** /importErrors | List import errors +*MonitoringAPI* | [**GetHealth**](docs/MonitoringAPI.md#gethealth) | **Get** /health | Get instance status +*MonitoringAPI* | [**GetVersion**](docs/MonitoringAPI.md#getversion) | **Get** /version | Get version information +*PermissionAPI* | [**GetPermissions**](docs/PermissionAPI.md#getpermissions) | **Get** /permissions | List permissions +*PluginAPI* | [**GetPlugins**](docs/PluginAPI.md#getplugins) | **Get** /plugins | Get a list of loaded plugins +*PoolAPI* | [**DeletePool**](docs/PoolAPI.md#deletepool) | **Delete** /pools/{pool_name} | Delete a pool +*PoolAPI* | [**GetPool**](docs/PoolAPI.md#getpool) | **Get** /pools/{pool_name} | Get a pool +*PoolAPI* | [**GetPools**](docs/PoolAPI.md#getpools) | **Get** /pools | List pools +*PoolAPI* | [**PatchPool**](docs/PoolAPI.md#patchpool) | **Patch** /pools/{pool_name} | Update a pool +*PoolAPI* | [**PostPool**](docs/PoolAPI.md#postpool) | **Post** /pools | Create a pool +*ProviderAPI* | [**GetProviders**](docs/ProviderAPI.md#getproviders) | **Get** /providers | List providers +*RoleAPI* | [**DeleteRole**](docs/RoleAPI.md#deleterole) | **Delete** /roles/{role_name} | Delete a role +*RoleAPI* | [**GetRole**](docs/RoleAPI.md#getrole) | **Get** /roles/{role_name} | Get a role +*RoleAPI* | [**GetRoles**](docs/RoleAPI.md#getroles) | **Get** /roles | List roles +*RoleAPI* | [**PatchRole**](docs/RoleAPI.md#patchrole) | **Patch** /roles/{role_name} | Update a role +*RoleAPI* | [**PostRole**](docs/RoleAPI.md#postrole) | **Post** /roles | Create a role +*TaskInstanceAPI* | [**GetExtraLinks**](docs/TaskInstanceAPI.md#getextralinks) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/links | List extra links +*TaskInstanceAPI* | [**GetLog**](docs/TaskInstanceAPI.md#getlog) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/logs/{task_try_number} | Get logs +*TaskInstanceAPI* | [**GetMappedTaskInstance**](docs/TaskInstanceAPI.md#getmappedtaskinstance) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index} | Get a mapped task instance +*TaskInstanceAPI* | [**GetMappedTaskInstanceDependencies**](docs/TaskInstanceAPI.md#getmappedtaskinstancedependencies) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}/dependencies | Get task dependencies blocking task from getting scheduled. +*TaskInstanceAPI* | [**GetMappedTaskInstanceTries**](docs/TaskInstanceAPI.md#getmappedtaskinstancetries) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}/tries | List mapped task instance tries +*TaskInstanceAPI* | [**GetMappedTaskInstanceTryDetails**](docs/TaskInstanceAPI.md#getmappedtaskinstancetrydetails) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}/tries/{task_try_number} | get mapped taskinstance try +*TaskInstanceAPI* | [**GetMappedTaskInstances**](docs/TaskInstanceAPI.md#getmappedtaskinstances) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/listMapped | List mapped task instances +*TaskInstanceAPI* | [**GetTaskInstance**](docs/TaskInstanceAPI.md#gettaskinstance) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id} | Get a task instance +*TaskInstanceAPI* | [**GetTaskInstanceDependencies**](docs/TaskInstanceAPI.md#gettaskinstancedependencies) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/dependencies | Get task dependencies blocking task from getting scheduled. +*TaskInstanceAPI* | [**GetTaskInstanceTries**](docs/TaskInstanceAPI.md#gettaskinstancetries) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/tries | List task instance tries +*TaskInstanceAPI* | [**GetTaskInstanceTryDetails**](docs/TaskInstanceAPI.md#gettaskinstancetrydetails) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/tries/{task_try_number} | get taskinstance try +*TaskInstanceAPI* | [**GetTaskInstances**](docs/TaskInstanceAPI.md#gettaskinstances) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances | List task instances +*TaskInstanceAPI* | [**GetTaskInstancesBatch**](docs/TaskInstanceAPI.md#gettaskinstancesbatch) | **Post** /dags/~/dagRuns/~/taskInstances/list | List task instances (batch) +*TaskInstanceAPI* | [**PatchMappedTaskInstance**](docs/TaskInstanceAPI.md#patchmappedtaskinstance) | **Patch** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index} | Updates the state of a mapped task instance +*TaskInstanceAPI* | [**PatchTaskInstance**](docs/TaskInstanceAPI.md#patchtaskinstance) | **Patch** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id} | Updates the state of a task instance +*TaskInstanceAPI* | [**SetMappedTaskInstanceNote**](docs/TaskInstanceAPI.md#setmappedtaskinstancenote) | **Patch** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}/setNote | Update the TaskInstance note. +*TaskInstanceAPI* | [**SetTaskInstanceNote**](docs/TaskInstanceAPI.md#settaskinstancenote) | **Patch** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/setNote | Update the TaskInstance note. +*UserAPI* | [**DeleteUser**](docs/UserAPI.md#deleteuser) | **Delete** /users/{username} | Delete a user +*UserAPI* | [**GetUser**](docs/UserAPI.md#getuser) | **Get** /users/{username} | Get a user +*UserAPI* | [**GetUsers**](docs/UserAPI.md#getusers) | **Get** /users | List users +*UserAPI* | [**PatchUser**](docs/UserAPI.md#patchuser) | **Patch** /users/{username} | Update a user +*UserAPI* | [**PostUser**](docs/UserAPI.md#postuser) | **Post** /users | Create a user +*VariableAPI* | [**DeleteVariable**](docs/VariableAPI.md#deletevariable) | **Delete** /variables/{variable_key} | Delete a variable +*VariableAPI* | [**GetVariable**](docs/VariableAPI.md#getvariable) | **Get** /variables/{variable_key} | Get a variable +*VariableAPI* | [**GetVariables**](docs/VariableAPI.md#getvariables) | **Get** /variables | List variables +*VariableAPI* | [**PatchVariable**](docs/VariableAPI.md#patchvariable) | **Patch** /variables/{variable_key} | Update a variable +*VariableAPI* | [**PostVariables**](docs/VariableAPI.md#postvariables) | **Post** /variables | Create a variable +*XComAPI* | [**GetXcomEntries**](docs/XComAPI.md#getxcomentries) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries | List XCom entries +*XComAPI* | [**GetXcomEntry**](docs/XComAPI.md#getxcomentry) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries/{xcom_key} | Get an XCom entry ## Documentation For Models - [Action](docs/Action.md) - [ActionCollection](docs/ActionCollection.md) - - [ActionCollectionAllOf](docs/ActionCollectionAllOf.md) - [ActionResource](docs/ActionResource.md) - [BasicDAGRun](docs/BasicDAGRun.md) - [ClassReference](docs/ClassReference.md) - [ClearDagRun](docs/ClearDagRun.md) + - [ClearDagRun200Response](docs/ClearDagRun200Response.md) - [ClearTaskInstances](docs/ClearTaskInstances.md) - [CollectionInfo](docs/CollectionInfo.md) - [Config](docs/Config.md) - [ConfigOption](docs/ConfigOption.md) - [ConfigSection](docs/ConfigSection.md) - [Connection](docs/Connection.md) - - [ConnectionAllOf](docs/ConnectionAllOf.md) - [ConnectionCollection](docs/ConnectionCollection.md) - - [ConnectionCollectionAllOf](docs/ConnectionCollectionAllOf.md) - [ConnectionCollectionItem](docs/ConnectionCollectionItem.md) - [ConnectionTest](docs/ConnectionTest.md) + - [CreateDatasetEvent](docs/CreateDatasetEvent.md) - [CronExpression](docs/CronExpression.md) - [DAG](docs/DAG.md) - [DAGCollection](docs/DAGCollection.md) - - [DAGCollectionAllOf](docs/DAGCollectionAllOf.md) - [DAGDetail](docs/DAGDetail.md) - - [DAGDetailAllOf](docs/DAGDetailAllOf.md) - [DAGRun](docs/DAGRun.md) - [DAGRunCollection](docs/DAGRunCollection.md) - - [DAGRunCollectionAllOf](docs/DAGRunCollectionAllOf.md) + - [DagProcessorStatus](docs/DagProcessorStatus.md) - [DagScheduleDatasetReference](docs/DagScheduleDatasetReference.md) - [DagState](docs/DagState.md) + - [DagStatsCollectionItem](docs/DagStatsCollectionItem.md) + - [DagStatsCollectionSchema](docs/DagStatsCollectionSchema.md) + - [DagStatsStateCollectionItem](docs/DagStatsStateCollectionItem.md) - [DagWarning](docs/DagWarning.md) - [DagWarningCollection](docs/DagWarningCollection.md) - - [DagWarningCollectionAllOf](docs/DagWarningCollectionAllOf.md) - [Dataset](docs/Dataset.md) - [DatasetCollection](docs/DatasetCollection.md) - - [DatasetCollectionAllOf](docs/DatasetCollectionAllOf.md) - [DatasetEvent](docs/DatasetEvent.md) - [DatasetEventCollection](docs/DatasetEventCollection.md) - - [DatasetEventCollectionAllOf](docs/DatasetEventCollectionAllOf.md) - [Error](docs/Error.md) - [EventLog](docs/EventLog.md) - [EventLogCollection](docs/EventLogCollection.md) - - [EventLogCollectionAllOf](docs/EventLogCollectionAllOf.md) - [ExtraLink](docs/ExtraLink.md) - [ExtraLinkCollection](docs/ExtraLinkCollection.md) + - [GetDagSource200Response](docs/GetDagSource200Response.md) + - [GetLog200Response](docs/GetLog200Response.md) + - [GetProviders200Response](docs/GetProviders200Response.md) - [HealthInfo](docs/HealthInfo.md) - [HealthStatus](docs/HealthStatus.md) - [ImportError](docs/ImportError.md) - [ImportErrorCollection](docs/ImportErrorCollection.md) - - [ImportErrorCollectionAllOf](docs/ImportErrorCollectionAllOf.md) - - [InlineResponse200](docs/InlineResponse200.md) - - [InlineResponse2001](docs/InlineResponse2001.md) - [Job](docs/Job.md) - [ListDagRunsForm](docs/ListDagRunsForm.md) - [ListTaskInstanceForm](docs/ListTaskInstanceForm.md) - [MetadatabaseStatus](docs/MetadatabaseStatus.md) - [PluginCollection](docs/PluginCollection.md) - - [PluginCollectionAllOf](docs/PluginCollectionAllOf.md) - [PluginCollectionItem](docs/PluginCollectionItem.md) - [Pool](docs/Pool.md) - [PoolCollection](docs/PoolCollection.md) - - [PoolCollectionAllOf](docs/PoolCollectionAllOf.md) - [Provider](docs/Provider.md) - [ProviderCollection](docs/ProviderCollection.md) + - [QueuedEvent](docs/QueuedEvent.md) + - [QueuedEventCollection](docs/QueuedEventCollection.md) - [RelativeDelta](docs/RelativeDelta.md) - [Resource](docs/Resource.md) - [Role](docs/Role.md) - [RoleCollection](docs/RoleCollection.md) - - [RoleCollectionAllOf](docs/RoleCollectionAllOf.md) - [SLAMiss](docs/SLAMiss.md) - [ScheduleInterval](docs/ScheduleInterval.md) - [SchedulerStatus](docs/SchedulerStatus.md) @@ -460,10 +470,13 @@ Class | Method | HTTP request | Description - [Tag](docs/Tag.md) - [Task](docs/Task.md) - [TaskCollection](docs/TaskCollection.md) - - [TaskExtraLinks](docs/TaskExtraLinks.md) + - [TaskExtraLinksInner](docs/TaskExtraLinksInner.md) + - [TaskFailedDependency](docs/TaskFailedDependency.md) - [TaskInstance](docs/TaskInstance.md) - [TaskInstanceCollection](docs/TaskInstanceCollection.md) - - [TaskInstanceCollectionAllOf](docs/TaskInstanceCollectionAllOf.md) + - [TaskInstanceDependencyCollection](docs/TaskInstanceDependencyCollection.md) + - [TaskInstanceHistory](docs/TaskInstanceHistory.md) + - [TaskInstanceHistoryCollection](docs/TaskInstanceHistoryCollection.md) - [TaskInstanceReference](docs/TaskInstanceReference.md) - [TaskInstanceReferenceCollection](docs/TaskInstanceReferenceCollection.md) - [TaskOutletDatasetReference](docs/TaskOutletDatasetReference.md) @@ -471,47 +484,44 @@ Class | Method | HTTP request | Description - [TimeDelta](docs/TimeDelta.md) - [Trigger](docs/Trigger.md) - [TriggerRule](docs/TriggerRule.md) + - [TriggererStatus](docs/TriggererStatus.md) - [UpdateDagRunState](docs/UpdateDagRunState.md) - [UpdateTaskInstance](docs/UpdateTaskInstance.md) - [UpdateTaskInstancesState](docs/UpdateTaskInstancesState.md) + - [UpdateTaskState](docs/UpdateTaskState.md) - [User](docs/User.md) - - [UserAllOf](docs/UserAllOf.md) - [UserCollection](docs/UserCollection.md) - - [UserCollectionAllOf](docs/UserCollectionAllOf.md) - [UserCollectionItem](docs/UserCollectionItem.md) - - [UserCollectionItemRoles](docs/UserCollectionItemRoles.md) + - [UserCollectionItemRolesInner](docs/UserCollectionItemRolesInner.md) - [Variable](docs/Variable.md) - - [VariableAllOf](docs/VariableAllOf.md) - [VariableCollection](docs/VariableCollection.md) - - [VariableCollectionAllOf](docs/VariableCollectionAllOf.md) - [VariableCollectionItem](docs/VariableCollectionItem.md) - [VersionInfo](docs/VersionInfo.md) - [WeightRule](docs/WeightRule.md) - [XCom](docs/XCom.md) - - [XComAllOf](docs/XComAllOf.md) - [XComCollection](docs/XComCollection.md) - - [XComCollectionAllOf](docs/XComCollectionAllOf.md) - [XComCollectionItem](docs/XComCollectionItem.md) ## Documentation For Authorization - +Authentication schemes defined for the API: ### Basic - **Type**: HTTP basic authentication Example -```golang -auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ - UserName: "username", - Password: "password", +```go +auth := context.WithValue(context.Background(), airflow.ContextBasicAuth, airflow.BasicAuth{ + UserName: "username", + Password: "password", }) r, err := client.Service.Operation(auth, args) ``` +### GoogleOpenId ### Kerberos diff --git a/airflow/api/openapi.yaml b/airflow/api/openapi.yaml index 2596ac4..3494810 100644 --- a/airflow/api/openapi.yaml +++ b/airflow/api/openapi.yaml @@ -1,20 +1,3 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - openapi: 3.0.3 info: contact: @@ -88,7 +71,7 @@ info: ### Delete - Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. + Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions @@ -99,12 +82,14 @@ info: - Field names are in snake_case. ```json { + "description": "string", "name": "string", - "slots": 0, "occupied_slots": 0, - "used_slots": 0, - "queued_slots": 0, "open_slots": 0 + "queued_slots": 0, + "running_slots": 0, + "scheduled_slots": 0, + "slots": 0, } ``` @@ -150,7 +135,7 @@ info: Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: - 1. Download the API specification by clicking the **Download** button at top of this document + 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI @@ -234,36 +219,154 @@ info: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html title: Airflow API (Stable) - version: 2.5.0 + version: 2.10.5 externalDocs: url: https://airflow.apache.org/docs/apache-airflow/stable/ servers: -- description: Apache Airflow Stable API. - url: /api/v1 -security: -- Basic: [] -- GoogleOpenId: [] -- Kerberos: [] +- url: /api/v1 tags: - name: Config - name: Connection - name: DAG - name: DAGRun +- name: DagWarning +- name: Dataset - name: EventLog - name: ImportError - name: Monitoring +- name: Permission +- name: Plugin - name: Pool - name: Provider +- name: Role - name: TaskInstance +- name: User - name: Variable - name: XCom -- name: Plugin -- name: Role -- name: Permission -- name: User -- name: DagWarning -- name: Dataset paths: + /config: + get: + operationId: get_config + parameters: + - description: "If given, only return config of this section." + explode: true + in: query + name: section + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + example: + sections: + - name: core + options: + - key: dags_folder + value: /home/user/my-dags-folder + - name: smtp + options: + - key: smtp_host + value: localhost + - key: smtp_mail_from + value: airflow@example.com + schema: + $ref: '#/components/schemas/Config' + text/plain: + example: | + [core] + dags_folder = /home/user/my-dags-folder + [smtp] + smtp_host = localhost + smtp_mail_from = airflow@example.com + schema: + type: string + description: Success. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Get current configuration + tags: + - Config + x-openapi-router-controller: airflow.api_connexion.endpoints.config_endpoint + /config/section/{section}/option/{option}: + get: + operationId: get_value + parameters: + - explode: false + in: path + name: section + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: option + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + example: + sections: + - name: core + options: + - key: dags_folder + value: /home/user/my-dags-folder + schema: + $ref: '#/components/schemas/Config' + text/plain: + example: | + [core] + dags_folder = /home/user/my-dags-folder + schema: + type: string + description: Success. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Get a option from configuration + tags: + - Config + x-openapi-router-controller: airflow.api_connexion.endpoints.config_endpoint /connections: get: operationId: get_connections @@ -311,8 +414,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -349,8 +452,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -361,6 +464,64 @@ paths: tags: - Connection x-openapi-router-controller: airflow.api_connexion.endpoints.connection_endpoint + /connections/test: + post: + description: | + Test a connection. + + For security reasons, the test connection functionality is disabled by default across Airflow UI, API and CLI. + For more information on capabilities of users, see the documentation: + https://airflow.apache.org/docs/apache-airflow/stable/security/security_model.html#capabilities-of-authenticated-ui-users. + It is strongly advised to not enable the feature until you make sure that only + highly trusted UI/API users have "edit connection" permissions. + + Set the "test_connection" flag to "Enabled" in the "core" section of Airflow configuration (airflow.cfg) to enable testing of collections. + It can also be controlled by the environment variable `AIRFLOW__CORE__TEST_CONNECTION`. + + *New in version 2.2.0* + operationId: test_connection + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Connection' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectionTest' + description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Test a connection + tags: + - Connection + x-openapi-router-controller: airflow.api_connexion.endpoints.connection_endpoint /connections/{connection_id}: delete: operationId: delete_connection @@ -387,8 +548,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -428,8 +589,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -493,8 +654,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -511,39 +672,40 @@ paths: tags: - Connection x-openapi-router-controller: airflow.api_connexion.endpoints.connection_endpoint - /connections/test: - post: + /dagSources/{file_token}: + get: description: | - Test a connection. - - *New in version 2.2.0* - operationId: test_connection - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Connection' + Get a source code using file token. + operationId: get_dag_source + parameters: + - description: | + The key containing the encrypted path to the file. Encryption and decryption take place only on + the server. This prevents the client from reading an non-DAG file. This also ensures API + extensibility, because the format of encrypted data may change. + explode: false + in: path + name: file_token required: true + schema: + type: string + style: simple responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ConnectionTest' - description: Success. - "400": - content: - application/json: + $ref: '#/components/schemas/get_dag_source_200_response' + text/plain: schema: - $ref: '#/components/schemas/Error' - description: Client specified an invalid argument. + type: string + description: Success. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -556,49 +718,167 @@ paths: schema: $ref: '#/components/schemas/Error' description: A specified resource is not found. - summary: Test a connection + "406": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified Accept header is not allowed. + summary: Get a source code tags: - - Connection - x-openapi-router-controller: airflow.api_connexion.endpoints.connection_endpoint - /dags: + - DAG + x-openapi-router-controller: airflow.api_connexion.endpoints.dag_source_endpoint + /dagStats: get: - description: | - List DAGs in the database. - `dag_id_pattern` can be set to match dags of a specific pattern - operationId: get_dags + operationId: get_dag_stats parameters: - - description: The numbers of items to return. - explode: true - in: query - name: limit - required: false - schema: - default: 100 - type: integer - style: form - - description: The number of items to skip before starting to collect the result - set. - explode: true - in: query - name: offset - required: false - schema: - minimum: 0 - type: integer - style: form - description: | - The name of the field to order the results by. - Prefix a field name with `-` to reverse the sort order. - - *New in version 2.1.0* + One or more DAG IDs separated by commas to filter relevant Dags. explode: true in: query - name: order_by - required: false + name: dag_ids + required: true schema: type: string style: form - - description: | + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DagStatsCollectionSchema' + description: Success. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + summary: List Dag statistics + tags: + - DagStats + x-openapi-router-controller: airflow.api_connexion.endpoints.dag_stats_endpoint + /dagWarnings: + get: + operationId: get_dag_warnings + parameters: + - description: "If set, only return DAG warnings with this dag_id." + explode: true + in: query + name: dag_id + required: false + schema: + type: string + style: form + - description: "If set, only return DAG warnings with this type." + explode: true + in: query + name: warning_type + required: false + schema: + type: string + style: form + - description: The numbers of items to return. + explode: true + in: query + name: limit + required: false + schema: + default: 100 + type: integer + style: form + - description: The number of items to skip before starting to collect the result + set. + explode: true + in: query + name: offset + required: false + schema: + minimum: 0 + type: integer + style: form + - description: | + The name of the field to order the results by. + Prefix a field name with `-` to reverse the sort order. + + *New in version 2.1.0* + explode: true + in: query + name: order_by + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DagWarningCollection' + description: Success. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + summary: List dag warnings + tags: + - DagWarning + x-openapi-router-controller: airflow.api_connexion.endpoints.dag_warning_endpoint + /dags: + get: + description: | + List DAGs in the database. + `dag_id_pattern` can be set to match dags of a specific pattern + operationId: get_dags + parameters: + - description: The numbers of items to return. + explode: true + in: query + name: limit + required: false + schema: + default: 100 + type: integer + style: form + - description: The number of items to skip before starting to collect the result + set. + explode: true + in: query + name: offset + required: false + schema: + minimum: 0 + type: integer + style: form + - description: | + The name of the field to order the results by. + Prefix a field name with `-` to reverse the sort order. + + *New in version 2.1.0* + explode: true + in: query + name: order_by + required: false + schema: + type: string + style: form + - description: | List of tags to filter results. *New in version 2.2.0* @@ -623,6 +903,28 @@ paths: default: true type: boolean style: form + - description: | + Only filter paused/unpaused DAGs. If absent or null, it returns paused and unpaused DAGs. + + *New in version 2.6.0* + explode: true + in: query + name: paused + required: false + schema: + type: boolean + style: form + - description: | + List of field for return. + explode: true + in: query + name: fields + required: false + schema: + items: + type: string + type: array + style: form - description: | If set, only return DAGs with dag_ids matching this pattern. explode: true @@ -644,8 +946,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." summary: List DAGs tags: - DAG @@ -742,8 +1044,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -791,8 +1093,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -829,6 +1131,17 @@ paths: schema: type: string style: simple + - description: | + List of field for return. + explode: true + in: query + name: fields + required: false + schema: + items: + type: string + type: array + style: form responses: "200": content: @@ -841,8 +1154,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -902,8 +1215,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -953,8 +1266,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -971,13 +1284,11 @@ paths: tags: - DAG x-openapi-router-controller: airflow.api_connexion.endpoints.task_instance_endpoint - /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/setNote: - patch: + /dags/{dag_id}/dagRuns: + get: description: | - Update the manual user note of a non-mapped Task Instance. - - *New in version 2.5.0* - operationId: set_task_instance_note + This endpoint allows specifying `~` as the dag_id to retrieve DAG runs for all DAGs. + operationId: get_dag_runs parameters: - description: The DAG ID. explode: false @@ -987,251 +1298,68 @@ paths: schema: type: string style: simple - - description: The DAG run ID. - explode: false - in: path - name: dag_run_id - required: true + - description: The numbers of items to return. + explode: true + in: query + name: limit + required: false schema: - type: string - style: simple - - description: The task ID. - explode: false - in: path - name: task_id - required: true + default: 100 + type: integer + style: form + - description: The number of items to skip before starting to collect the result + set. + explode: true + in: query + name: offset + required: false schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SetTaskInstanceNote' - description: Parameters of set Task Instance note. - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/TaskInstance' - description: Success. - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client specified an invalid argument. - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. - "403": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client does not have sufficient permission. - "404": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: A specified resource is not found. - summary: Update the TaskInstance note. - tags: - - DAG - x-openapi-router-controller: airflow.api_connexion.endpoints.task_instance_endpoint - /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}/setNote: - patch: - description: | - Update the manual user note of a mapped Task Instance. + minimum: 0 + type: integer + style: form + - description: | + Returns objects greater or equal to the specified date. - *New in version 2.5.0* - operationId: set_mapped_task_instance_note - parameters: - - description: The DAG ID. - explode: false - in: path - name: dag_id - required: true + This can be combined with execution_date_lte parameter to receive only the selected period. + explode: true + in: query + name: execution_date_gte + required: false schema: + format: date-time type: string - style: simple - - description: The DAG run ID. - explode: false - in: path - name: dag_run_id - required: true - schema: - type: string - style: simple - - description: The task ID. - explode: false - in: path - name: task_id - required: true - schema: - type: string - style: simple - - description: The map index. - explode: false - in: path - name: map_index - required: true - schema: - type: integer - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SetTaskInstanceNote' - description: Parameters of set Task Instance note. - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/TaskInstance' - description: Success. - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client specified an invalid argument. - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. - "403": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client does not have sufficient permission. - "404": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: A specified resource is not found. - summary: Update the TaskInstance note. - tags: - - DAG - x-openapi-router-controller: airflow.api_connexion.endpoints.task_instance_endpoint - /dags/{dag_id}/updateTaskInstancesState: - post: - description: | - Updates the state for multiple task instances simultaneously. - operationId: post_set_task_instances_state - parameters: - - description: The DAG ID. - explode: false - in: path - name: dag_id - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateTaskInstancesState' - description: Parameters of action - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/TaskInstanceReferenceCollection' - description: Success. - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. - "403": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client does not have sufficient permission. - "404": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: A specified resource is not found. - summary: Set a state of task instances - tags: - - DAG - x-openapi-router-controller: airflow.api_connexion.endpoints.task_instance_endpoint - /dags/{dag_id}/dagRuns: - get: - description: | - This endpoint allows specifying `~` as the dag_id to retrieve DAG runs for all DAGs. - operationId: get_dag_runs - parameters: - - description: The DAG ID. - explode: false - in: path - name: dag_id - required: true - schema: - type: string - style: simple - - description: The numbers of items to return. - explode: true - in: query - name: limit - required: false - schema: - default: 100 - type: integer style: form - - description: The number of items to skip before starting to collect the result - set. + - description: | + Returns objects less than or equal to the specified date. + + This can be combined with execution_date_gte parameter to receive only the selected period. explode: true in: query - name: offset + name: execution_date_lte required: false schema: - minimum: 0 - type: integer + format: date-time + type: string style: form - description: | - Returns objects greater or equal to the specified date. + Returns objects greater or equal the specified date. - This can be combined with execution_date_lte parameter to receive only the selected period. + This can be combined with start_date_lte parameter to receive only the selected period. explode: true in: query - name: execution_date_gte + name: start_date_gte required: false schema: format: date-time type: string style: form - description: | - Returns objects less than or equal to the specified date. + Returns objects less or equal the specified date. - This can be combined with execution_date_gte parameter to receive only the selected period. + This can be combined with start_date_gte parameter to receive only the selected period. explode: true in: query - name: execution_date_lte + name: start_date_lte required: false schema: format: date-time @@ -1243,19 +1371,19 @@ paths: This can be combined with start_date_lte parameter to receive only the selected period. explode: true in: query - name: start_date_gte + name: end_date_gte required: false schema: format: date-time type: string style: form - description: | - Returns objects less or equal the specified date. + Returns objects less than or equal to the specified date. This can be combined with start_date_gte parameter to receive only the selected period. explode: true in: query - name: start_date_lte + name: end_date_lte required: false schema: format: date-time @@ -1264,22 +1392,26 @@ paths: - description: | Returns objects greater or equal the specified date. - This can be combined with start_date_lte parameter to receive only the selected period. + This can be combined with updated_at_lte parameter to receive only the selected period. + + *New in version 2.6.0* explode: true in: query - name: end_date_gte + name: updated_at_gte required: false schema: format: date-time type: string style: form - description: | - Returns objects less than or equal to the specified date. + Returns objects less or equal the specified date. - This can be combined with start_date_gte parameter to receive only the selected period. + This can be combined with updated_at_gte parameter to receive only the selected period. + + *New in version 2.6.0* explode: true in: query - name: end_date_lte + name: updated_at_lte required: false schema: format: date-time @@ -1308,6 +1440,17 @@ paths: schema: type: string style: form + - description: | + List of field for return. + explode: true + in: query + name: fields + required: false + schema: + items: + type: string + type: array + style: form responses: "200": content: @@ -1320,13 +1463,15 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." summary: List DAG runs tags: - DAGRun x-openapi-router-controller: airflow.api_connexion.endpoints.dag_run_endpoint post: + description: | + This will initiate a dagrun. If DAG is paused then dagrun state will remain queued, and the task won't run. operationId: post_dag_run parameters: - description: The DAG ID. @@ -1361,14 +1506,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. - "409": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: An existing resource conflicts with the request. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -1381,48 +1520,13 @@ paths: schema: $ref: '#/components/schemas/Error' description: A specified resource is not found. - summary: Trigger a new DAG run - tags: - - DAGRun - x-openapi-router-controller: airflow.api_connexion.endpoints.dag_run_endpoint - /dags/~/dagRuns/list: - post: - description: | - This endpoint is a POST to allow filtering across a large number of DAG IDs, where as a GET it would run in to maximum HTTP request URL length limit. - operationId: get_dag_runs_batch - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ListDagRunsForm' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/DAGRunCollection' - description: Success. - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client specified an invalid argument. - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. - "403": + "409": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Client does not have sufficient permission. - summary: List DAG runs (batch) + description: An existing resource conflicts with the request. + summary: Trigger a new DAG run. tags: - DAGRun x-openapi-router-controller: airflow.api_connexion.endpoints.dag_run_endpoint @@ -1460,8 +1564,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -1497,6 +1601,17 @@ paths: schema: type: string style: simple + - description: | + List of field for return. + explode: true + in: query + name: fields + required: false + schema: + items: + type: string + type: array + style: form responses: "200": content: @@ -1509,8 +1624,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -1574,8 +1689,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -1627,7 +1742,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DAGRun' + $ref: '#/components/schemas/clear_dag_run_200_response' description: Success. "400": content: @@ -1640,8 +1755,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -1658,13 +1773,13 @@ paths: tags: - DAGRun x-openapi-router-controller: airflow.api_connexion.endpoints.dag_run_endpoint - /dags/{dag_id}/dagRuns/{dag_run_id}/upstreamDatasetEvents: - get: + /dags/{dag_id}/dagRuns/{dag_run_id}/setNote: + patch: description: | - Get datasets for a dag run. + Update the manual user note of a DagRun. - *New in version 2.4.0* - operationId: get_upstream_dataset_events + *New in version 2.5.0* + operationId: set_dag_run_note parameters: - description: The DAG ID. explode: false @@ -1682,20 +1797,33 @@ paths: schema: type: string style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SetDagRunNote' + description: Parameters of set DagRun note. + required: true responses: "200": content: application/json: schema: - $ref: '#/components/schemas/DatasetEventCollection' + $ref: '#/components/schemas/DAGRun' description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -1708,18 +1836,15 @@ paths: schema: $ref: '#/components/schemas/Error' description: A specified resource is not found. - summary: Get dataset events for a DAG run + summary: Update the DagRun note. tags: - DAGRun - - Dataset x-openapi-router-controller: airflow.api_connexion.endpoints.dag_run_endpoint - /dags/{dag_id}/dagRuns/{dag_run_id}/setNote: - patch: + /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances: + get: description: | - Update the manual user note of a DagRun. - - *New in version 2.5.0* - operationId: set_dag_run_note + This endpoint allows specifying `~` as the dag_id, dag_run_id to retrieve DAG runs for all DAGs and DAG runs. + operationId: get_task_instances parameters: - description: The DAG ID. explode: false @@ -1737,54 +1862,172 @@ paths: schema: type: string style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SetDagRunNote' - description: Parameters of set DagRun note. - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/DAGRun' - description: Success. - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client specified an invalid argument. - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. - "403": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client does not have sufficient permission. - "404": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: A specified resource is not found. - summary: Update the DagRun note. - tags: - - DAGRun - x-openapi-router-controller: airflow.api_connexion.endpoints.dag_run_endpoint - /eventLogs: - get: - description: List log entries from event log. - operationId: get_event_logs - parameters: + - description: | + Returns objects greater or equal to the specified date. + + This can be combined with execution_date_lte parameter to receive only the selected period. + explode: true + in: query + name: execution_date_gte + required: false + schema: + format: date-time + type: string + style: form + - description: | + Returns objects less than or equal to the specified date. + + This can be combined with execution_date_gte parameter to receive only the selected period. + explode: true + in: query + name: execution_date_lte + required: false + schema: + format: date-time + type: string + style: form + - description: | + Returns objects greater or equal the specified date. + + This can be combined with start_date_lte parameter to receive only the selected period. + explode: true + in: query + name: start_date_gte + required: false + schema: + format: date-time + type: string + style: form + - description: | + Returns objects less or equal the specified date. + + This can be combined with start_date_gte parameter to receive only the selected period. + explode: true + in: query + name: start_date_lte + required: false + schema: + format: date-time + type: string + style: form + - description: | + Returns objects greater or equal the specified date. + + This can be combined with start_date_lte parameter to receive only the selected period. + explode: true + in: query + name: end_date_gte + required: false + schema: + format: date-time + type: string + style: form + - description: | + Returns objects less than or equal to the specified date. + + This can be combined with start_date_gte parameter to receive only the selected period. + explode: true + in: query + name: end_date_lte + required: false + schema: + format: date-time + type: string + style: form + - description: | + Returns objects greater or equal the specified date. + + This can be combined with updated_at_lte parameter to receive only the selected period. + + *New in version 2.6.0* + explode: true + in: query + name: updated_at_gte + required: false + schema: + format: date-time + type: string + style: form + - description: | + Returns objects less or equal the specified date. + + This can be combined with updated_at_gte parameter to receive only the selected period. + + *New in version 2.6.0* + explode: true + in: query + name: updated_at_lte + required: false + schema: + format: date-time + type: string + style: form + - description: | + Returns objects greater than or equal to the specified values. + + This can be combined with duration_lte parameter to receive only the selected period. + explode: true + in: query + name: duration_gte + required: false + schema: + type: number + style: form + - description: | + Returns objects less than or equal to the specified values. + + This can be combined with duration_gte parameter to receive only the selected range. + explode: true + in: query + name: duration_lte + required: false + schema: + type: number + style: form + - description: The value can be repeated to retrieve multiple matching values + (OR condition). + explode: true + in: query + name: state + required: false + schema: + items: + type: string + type: array + style: form + - description: The value can be repeated to retrieve multiple matching values + (OR condition). + explode: true + in: query + name: pool + required: false + schema: + items: + type: string + type: array + style: form + - description: The value can be repeated to retrieve multiple matching values + (OR condition). + explode: true + in: query + name: queue + required: false + schema: + items: + type: string + type: array + style: form + - description: The value can be repeated to retrieve multiple matching values + (OR condition). + explode: true + in: query + name: executor + required: false + schema: + items: + type: string + type: array + style: form - description: The numbers of items to return. explode: true in: query @@ -1804,68 +2047,72 @@ paths: minimum: 0 type: integer style: form - - description: | - The name of the field to order the results by. - Prefix a field name with `-` to reverse the sort order. - - *New in version 2.1.0* - explode: true - in: query - name: order_by - required: false - schema: - type: string - style: form responses: "200": content: application/json: schema: - $ref: '#/components/schemas/EventLogCollection' + $ref: '#/components/schemas/TaskInstanceCollection' description: Success. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: schema: $ref: '#/components/schemas/Error' description: Client does not have sufficient permission. - summary: List log entries + summary: List task instances tags: - - EventLog - x-openapi-router-controller: airflow.api_connexion.endpoints.event_log_endpoint - /eventLogs/{event_log_id}: + - TaskInstance + x-openapi-router-controller: airflow.api_connexion.endpoints.task_instance_endpoint + /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}: get: - operationId: get_event_log + operationId: get_task_instance parameters: - - description: The event log ID. + - description: The DAG ID. explode: false in: path - name: event_log_id + name: dag_id required: true schema: - type: integer + type: string style: simple - responses: + - description: The DAG run ID. + explode: false + in: path + name: dag_run_id + required: true + schema: + type: string + style: simple + - description: The task ID. + explode: false + in: path + name: task_id + required: true + schema: + type: string + style: simple + responses: "200": content: application/json: schema: - $ref: '#/components/schemas/EventLog' + $ref: '#/components/schemas/TaskInstance' description: Success. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -1878,95 +2125,129 @@ paths: schema: $ref: '#/components/schemas/Error' description: A specified resource is not found. - summary: Get a log entry + summary: Get a task instance tags: - - EventLog - x-openapi-router-controller: airflow.api_connexion.endpoints.event_log_endpoint - /importErrors: - get: - operationId: get_import_errors + - TaskInstance + x-openapi-router-controller: airflow.api_connexion.endpoints.task_instance_endpoint + patch: + description: | + Updates the state for single task instance. + *New in version 2.5.0* + operationId: patch_task_instance parameters: - - description: The numbers of items to return. - explode: true - in: query - name: limit - required: false + - description: The DAG ID. + explode: false + in: path + name: dag_id + required: true schema: - default: 100 - type: integer - style: form - - description: The number of items to skip before starting to collect the result - set. - explode: true - in: query - name: offset - required: false + type: string + style: simple + - description: The DAG run ID. + explode: false + in: path + name: dag_run_id + required: true schema: - minimum: 0 - type: integer - style: form - - description: | - The name of the field to order the results by. - Prefix a field name with `-` to reverse the sort order. - - *New in version 2.1.0* - explode: true - in: query - name: order_by - required: false + type: string + style: simple + - description: The task ID. + explode: false + in: path + name: task_id + required: true schema: type: string - style: form + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateTaskInstance' + description: Parameters of action + required: true responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ImportErrorCollection' + $ref: '#/components/schemas/TaskInstanceReference' description: Success. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: schema: $ref: '#/components/schemas/Error' description: Client does not have sufficient permission. - summary: List import errors + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Updates the state of a task instance tags: - - ImportError - x-openapi-router-controller: airflow.api_connexion.endpoints.import_error_endpoint - /importErrors/{import_error_id}: + - TaskInstance + x-openapi-router-controller: airflow.api_connexion.endpoints.task_instance_endpoint + /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/dependencies: get: - operationId: get_import_error + description: | + Get task dependencies blocking task from getting scheduled. + + *New in version 2.10.0* + operationId: get_task_instance_dependencies parameters: - - description: The import error ID. + - description: The DAG ID. explode: false in: path - name: import_error_id + name: dag_id required: true schema: - type: integer + type: string + style: simple + - description: The DAG run ID. + explode: false + in: path + name: dag_run_id + required: true + schema: + type: string + style: simple + - description: The task ID. + explode: false + in: path + name: task_id + required: true + schema: + type: string style: simple responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ImportError' + $ref: '#/components/schemas/TaskInstanceDependencyCollection' description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -1979,318 +2260,129 @@ paths: schema: $ref: '#/components/schemas/Error' description: A specified resource is not found. - summary: Get an import error + summary: Get task dependencies blocking task from getting scheduled. tags: - - ImportError - x-openapi-router-controller: airflow.api_connexion.endpoints.import_error_endpoint - /pools: + - TaskInstance + x-openapi-router-controller: airflow.api_connexion.endpoints.task_instance_endpoint + /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/links: get: - operationId: get_pools + description: | + List extra links for task instance. + operationId: get_extra_links parameters: - - description: The numbers of items to return. - explode: true - in: query - name: limit - required: false + - description: The DAG ID. + explode: false + in: path + name: dag_id + required: true schema: - default: 100 - type: integer - style: form - - description: The number of items to skip before starting to collect the result - set. - explode: true - in: query - name: offset - required: false + type: string + style: simple + - description: The DAG run ID. + explode: false + in: path + name: dag_run_id + required: true schema: - minimum: 0 - type: integer - style: form - - description: | - The name of the field to order the results by. - Prefix a field name with `-` to reverse the sort order. - - *New in version 2.1.0* + type: string + style: simple + - description: The task ID. + explode: false + in: path + name: task_id + required: true + schema: + type: string + style: simple + - description: Filter on map index for mapped task. explode: true in: query - name: order_by + name: map_index required: false schema: - type: string + type: integer style: form responses: "200": content: application/json: schema: - $ref: '#/components/schemas/PoolCollection' - description: List of pools. + $ref: '#/components/schemas/ExtraLinkCollection' + description: Success. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: schema: $ref: '#/components/schemas/Error' description: Client does not have sufficient permission. - summary: List pools - tags: - - Pool - x-openapi-router-controller: airflow.api_connexion.endpoints.pool_endpoint - post: - operationId: post_pool - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pool' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Pool' - description: Success. - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client specified an invalid argument. - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. - "403": + "404": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Client does not have sufficient permission. - summary: Create a pool + description: A specified resource is not found. + summary: List extra links tags: - - Pool - x-openapi-router-controller: airflow.api_connexion.endpoints.pool_endpoint - /pools/{pool_name}: - delete: - operationId: delete_pool + - TaskInstance + x-openapi-router-controller: airflow.api_connexion.endpoints.extra_link_endpoint + /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/listMapped: + get: + description: | + Get details of all mapped task instances. + + *New in version 2.3.0* + operationId: get_mapped_task_instances parameters: - - description: The pool name. + - description: The DAG ID. explode: false in: path - name: pool_name + name: dag_id required: true schema: type: string style: simple - responses: - "204": - description: Success. - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client specified an invalid argument. - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. - "403": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client does not have sufficient permission. - "404": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: A specified resource is not found. - summary: Delete a pool - tags: - - Pool - x-openapi-router-controller: airflow.api_connexion.endpoints.pool_endpoint - get: - operationId: get_pool - parameters: - - description: The pool name. + - description: The DAG run ID. explode: false in: path - name: pool_name + name: dag_run_id required: true schema: type: string style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Pool' - description: Success. - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. - "403": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client does not have sufficient permission. - "404": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: A specified resource is not found. - summary: Get a pool - tags: - - Pool - x-openapi-router-controller: airflow.api_connexion.endpoints.pool_endpoint - patch: - operationId: patch_pool - parameters: - - description: The pool name. + - description: The task ID. explode: false in: path - name: pool_name + name: task_id required: true schema: type: string style: simple - - description: | - The fields to update on the resource. If absent or empty, all modifiable fields are updated. - A comma-separated list of fully qualified names of fields. - explode: false + - description: The numbers of items to return. + explode: true in: query - name: update_mask + name: limit required: false schema: - items: - type: string - type: array + default: 100 + type: integer style: form - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pool' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Pool' - description: Success. - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client specified an invalid argument. - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. - "403": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client does not have sufficient permission. - "404": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: A specified resource is not found. - "409": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: An existing resource conflicts with the request. - summary: Update a pool - tags: - - Pool - x-openapi-router-controller: airflow.api_connexion.endpoints.pool_endpoint - /providers: - get: - description: | - Get a list of providers. - - *New in version 2.1.0* - operationId: get_providers - responses: - "200": - content: - application/json: - schema: - allOf: - - $ref: '#/components/schemas/ProviderCollection' - - $ref: '#/components/schemas/CollectionInfo' - description: List of providers. - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. - "403": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client does not have sufficient permission. - summary: List providers - tags: - - Provider - x-openapi-router-controller: airflow.api_connexion.endpoints.provider_endpoint - /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances: - get: - description: | - This endpoint allows specifying `~` as the dag_id, dag_run_id to retrieve DAG runs for all DAGs and DAG runs. - operationId: get_task_instances - parameters: - - description: The DAG ID. - explode: false - in: path - name: dag_id - required: true - schema: - type: string - style: simple - - description: The DAG run ID. - explode: false - in: path - name: dag_run_id - required: true + - description: The number of items to skip before starting to collect the result + set. + explode: true + in: query + name: offset + required: false schema: - type: string - style: simple + minimum: 0 + type: integer + style: form - description: | Returns objects greater or equal to the specified date. @@ -2363,6 +2455,34 @@ paths: format: date-time type: string style: form + - description: | + Returns objects greater or equal the specified date. + + This can be combined with updated_at_lte parameter to receive only the selected period. + + *New in version 2.6.0* + explode: true + in: query + name: updated_at_gte + required: false + schema: + format: date-time + type: string + style: form + - description: | + Returns objects less or equal the specified date. + + This can be combined with updated_at_gte parameter to receive only the selected period. + + *New in version 2.6.0* + explode: true + in: query + name: updated_at_lte + required: false + schema: + format: date-time + type: string + style: form - description: | Returns objects greater than or equal to the specified values. @@ -2418,24 +2538,28 @@ paths: type: string type: array style: form - - description: The numbers of items to return. + - description: The value can be repeated to retrieve multiple matching values + (OR condition). explode: true in: query - name: limit + name: executor required: false schema: - default: 100 - type: integer + items: + type: string + type: array style: form - - description: The number of items to skip before starting to collect the result - set. + - description: | + The name of the field to order the results by. + Prefix a field name with `-` to reverse the sort order. + + *New in version 2.1.0* explode: true in: query - name: offset + name: order_by required: false schema: - minimum: 0 - type: integer + type: string style: form responses: "200": @@ -2449,21 +2573,55 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: schema: $ref: '#/components/schemas/Error' description: Client does not have sufficient permission. - summary: List task instances + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: List mapped task instances tags: - TaskInstance x-openapi-router-controller: airflow.api_connexion.endpoints.task_instance_endpoint - /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}: + /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/logs/{task_try_number}: get: - operationId: get_task_instance + description: | + Get logs for a specific task instance and its try number. + To get log from specific character position, following way of using + URLSafeSerializer can be used. + + Example: + ``` + from itsdangerous.url_safe import URLSafeSerializer + + request_url = f"api/v1/dags/{DAG_ID}/dagRuns/{RUN_ID}/taskInstances/{TASK_ID}/logs/1" + key = app.config["SECRET_KEY"] + serializer = URLSafeSerializer(key) + token = serializer.dumps({"log_pos": 10000}) + + response = self.client.get( + request_url, + query_string={"token": token}, + headers={"Accept": "text/plain"}, + environ_overrides={"REMOTE_USER": "test"}, + ) + continuation_token = response.json["continuation_token"] + metadata = URLSafeSerializer(key).loads(continuation_token) + log_pos = metadata["log_pos"] + end_of_log = metadata["end_of_log"] + ``` + If log_pos is passed as 10000 like the above example, it renders the logs starting + from char position 10000 to last (not the end as the logs may be tailing behind in + running state). This way pagination can be done with metadata as part of the token. + operationId: get_log parameters: - description: The DAG ID. explode: false @@ -2489,23 +2647,68 @@ paths: schema: type: string style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/TaskInstance' - description: Success. - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. - "403": - content: - application/json: + - description: The task try number. + explode: false + in: path + name: task_try_number + required: true + schema: + type: integer + style: simple + - description: | + A full content will be returned. + By default, only the first fragment will be returned. + explode: true + in: query + name: full_content + required: false + schema: + type: boolean + style: form + - description: Filter on map index for mapped task. + explode: true + in: query + name: map_index + required: false + schema: + type: integer + style: form + - description: | + A token that allows you to continue fetching logs. + If passed, it will specify the location from which the download should be continued. + explode: true + in: query + name: token + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/get_log_200_response' + text/plain: + schema: + type: string + description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: schema: $ref: '#/components/schemas/Error' description: Client does not have sufficient permission. @@ -2515,15 +2718,17 @@ paths: schema: $ref: '#/components/schemas/Error' description: A specified resource is not found. - summary: Get a task instance + summary: Get logs tags: - TaskInstance - x-openapi-router-controller: airflow.api_connexion.endpoints.task_instance_endpoint + x-openapi-router-controller: airflow.api_connexion.endpoints.log_endpoint + /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/setNote: patch: description: | - Updates the state for single task instance. + Update the manual user note of a non-mapped Task Instance. + *New in version 2.5.0* - operationId: patch_task_instance + operationId: set_task_instance_note parameters: - description: The DAG ID. explode: false @@ -2553,23 +2758,29 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UpdateTaskInstance' - description: Parameters of action + $ref: '#/components/schemas/SetTaskInstanceNote' + description: Parameters of set Task Instance note. required: true responses: "200": content: application/json: schema: - $ref: '#/components/schemas/TaskInstanceReference' + $ref: '#/components/schemas/TaskInstance' description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -2582,17 +2793,17 @@ paths: schema: $ref: '#/components/schemas/Error' description: A specified resource is not found. - summary: Updates the state of a task instance + summary: Update the TaskInstance note. tags: - TaskInstance x-openapi-router-controller: airflow.api_connexion.endpoints.task_instance_endpoint - /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}: + /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/tries: get: description: | - Get details of a mapped task instance. + Get details of all task instance tries. - *New in version 2.3.0* - operationId: get_mapped_task_instance + *New in version 2.10.0* + operationId: get_task_instance_tries parameters: - description: The DAG ID. explode: false @@ -2618,28 +2829,51 @@ paths: schema: type: string style: simple - - description: The map index. - explode: false - in: path - name: map_index - required: true + - description: The numbers of items to return. + explode: true + in: query + name: limit + required: false schema: + default: 100 type: integer - style: simple + style: form + - description: The number of items to skip before starting to collect the result + set. + explode: true + in: query + name: offset + required: false + schema: + minimum: 0 + type: integer + style: form + - description: | + The name of the field to order the results by. + Prefix a field name with `-` to reverse the sort order. + + *New in version 2.1.0* + explode: true + in: query + name: order_by + required: false + schema: + type: string + style: form responses: "200": content: application/json: schema: - $ref: '#/components/schemas/TaskInstance' + $ref: '#/components/schemas/TaskInstanceHistoryCollection' description: Success. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -2652,15 +2886,17 @@ paths: schema: $ref: '#/components/schemas/Error' description: A specified resource is not found. - summary: Get a mapped task instance + summary: List task instance tries tags: - TaskInstance x-openapi-router-controller: airflow.api_connexion.endpoints.task_instance_endpoint - patch: + /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/tries/{task_try_number}: + get: description: | - Updates the state for single mapped task instance. - *New in version 2.5.0* - operationId: patch_mapped_task_instance + Get details of a task instance try. + + *New in version 2.10.0* + operationId: get_task_instance_try_details parameters: - description: The DAG ID. explode: false @@ -2686,34 +2922,28 @@ paths: schema: type: string style: simple - - description: The map index. + - description: The task try number. explode: false in: path - name: map_index + name: task_try_number required: true schema: type: integer style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateTaskInstance' - description: Parameters of action responses: "200": content: application/json: schema: - $ref: '#/components/schemas/TaskInstanceReference' + $ref: '#/components/schemas/TaskInstanceHistory' description: Success. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -2726,17 +2956,17 @@ paths: schema: $ref: '#/components/schemas/Error' description: A specified resource is not found. - summary: Updates the state of a mapped task instance + summary: get taskinstance try tags: - TaskInstance x-openapi-router-controller: airflow.api_connexion.endpoints.task_instance_endpoint - /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/listMapped: + /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries: get: - description: | - Get details of all mapped task instances. - - *New in version 2.3.0* - operationId: get_mapped_task_instances + description: "This endpoint allows specifying `~` as the dag_id, dag_run_id,\ + \ task_id to retrieve XCOM entries for for all DAGs, DAG runs and task instances.\ + \ XCom values won't be returned as they can be large. Use this endpoint to\ + \ get a list of XCom entries and then fetch individual entry to get value." + operationId: get_xcom_entries parameters: - description: The DAG ID. explode: false @@ -2762,6 +2992,22 @@ paths: schema: type: string style: simple + - description: Filter on map index for mapped task. + explode: true + in: query + name: map_index + required: false + schema: + type: integer + style: form + - description: Only filter the XCom records which have the provided key. + explode: true + in: query + name: xcom_key + required: false + schema: + type: string + style: form - description: The numbers of items to return. explode: true in: query @@ -2781,159 +3027,124 @@ paths: minimum: 0 type: integer style: form - - description: | - Returns objects greater or equal to the specified date. - - This can be combined with execution_date_lte parameter to receive only the selected period. + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/XComCollection' + description: Success. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + summary: List XCom entries + tags: + - XCom + x-openapi-router-controller: airflow.api_connexion.endpoints.xcom_endpoint + /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries/{xcom_key}: + get: + operationId: get_xcom_entry + parameters: + - description: The DAG ID. + explode: false + in: path + name: dag_id + required: true + schema: + type: string + style: simple + - description: The DAG run ID. + explode: false + in: path + name: dag_run_id + required: true + schema: + type: string + style: simple + - description: The task ID. + explode: false + in: path + name: task_id + required: true + schema: + type: string + style: simple + - description: The XCom key. + explode: false + in: path + name: xcom_key + required: true + schema: + format: path + type: string + style: simple + - description: Filter on map index for mapped task. explode: true in: query - name: execution_date_gte + name: map_index required: false schema: - format: date-time - type: string + type: integer style: form - description: | - Returns objects less than or equal to the specified date. + Whether to deserialize an XCom value when using a custom XCom backend. - This can be combined with execution_date_gte parameter to receive only the selected period. + The XCom API endpoint calls `orm_deserialize_value` by default since an XCom may contain value + that is potentially expensive to deserialize in the web server. Setting this to true overrides + the consideration, and calls `deserialize_value` instead. + + This parameter is not meaningful when using the default XCom backend. + + *New in version 2.4.0* explode: true in: query - name: execution_date_lte + name: deserialize required: false schema: - format: date-time - type: string + default: false + type: boolean style: form - description: | - Returns objects greater or equal the specified date. + Whether to convert the XCom value to be a string. XCom values can be of Any data type. - This can be combined with start_date_lte parameter to receive only the selected period. + If set to true (default) the Any value will be returned as string, e.g. a Python representation + of a dict. If set to false it will return the raw data as dict, list, string or whatever was stored. + + This parameter is not meaningful when using XCom pickling, then it is always returned as string. + + *New in version 2.10.0* explode: true in: query - name: start_date_gte + name: stringify required: false schema: - format: date-time - type: string - style: form - - description: | - Returns objects less or equal the specified date. - - This can be combined with start_date_gte parameter to receive only the selected period. - explode: true - in: query - name: start_date_lte - required: false - schema: - format: date-time - type: string - style: form - - description: | - Returns objects greater or equal the specified date. - - This can be combined with start_date_lte parameter to receive only the selected period. - explode: true - in: query - name: end_date_gte - required: false - schema: - format: date-time - type: string - style: form - - description: | - Returns objects less than or equal to the specified date. - - This can be combined with start_date_gte parameter to receive only the selected period. - explode: true - in: query - name: end_date_lte - required: false - schema: - format: date-time - type: string - style: form - - description: | - Returns objects greater than or equal to the specified values. - - This can be combined with duration_lte parameter to receive only the selected period. - explode: true - in: query - name: duration_gte - required: false - schema: - type: number - style: form - - description: | - Returns objects less than or equal to the specified values. - - This can be combined with duration_gte parameter to receive only the selected range. - explode: true - in: query - name: duration_lte - required: false - schema: - type: number - style: form - - description: The value can be repeated to retrieve multiple matching values - (OR condition). - explode: true - in: query - name: state - required: false - schema: - items: - type: string - type: array - style: form - - description: The value can be repeated to retrieve multiple matching values - (OR condition). - explode: true - in: query - name: pool - required: false - schema: - items: - type: string - type: array - style: form - - description: The value can be repeated to retrieve multiple matching values - (OR condition). - explode: true - in: query - name: queue - required: false - schema: - items: - type: string - type: array - style: form - - description: | - The name of the field to order the results by. - Prefix a field name with `-` to reverse the sort order. - - *New in version 2.1.0* - explode: true - in: query - name: order_by - required: false - schema: - type: string + default: true + type: boolean style: form responses: "200": content: application/json: schema: - $ref: '#/components/schemas/TaskInstanceCollection' + $ref: '#/components/schemas/XCom' description: Success. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -2946,36 +3157,64 @@ paths: schema: $ref: '#/components/schemas/Error' description: A specified resource is not found. - summary: List mapped task instances + summary: Get an XCom entry tags: - - TaskInstance - x-openapi-router-controller: airflow.api_connexion.endpoints.task_instance_endpoint - /dags/~/dagRuns/~/taskInstances/list: - post: + - XCom + x-openapi-router-controller: airflow.api_connexion.endpoints.xcom_endpoint + /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}: + get: description: | - List task instances from all DAGs and DAG runs. - This endpoint is a POST to allow filtering across a large number of DAG IDs, where as a GET it would run in to maximum HTTP request URL length limits. - operationId: get_task_instances_batch - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ListTaskInstanceForm' + Get details of a mapped task instance. + + *New in version 2.3.0* + operationId: get_mapped_task_instance + parameters: + - description: The DAG ID. + explode: false + in: path + name: dag_id + required: true + schema: + type: string + style: simple + - description: The DAG run ID. + explode: false + in: path + name: dag_run_id + required: true + schema: + type: string + style: simple + - description: The task ID. + explode: false + in: path + name: task_id + required: true + schema: + type: string + style: simple + - description: The map index. + explode: false + in: path + name: map_index required: true + schema: + type: integer + style: simple responses: "200": content: application/json: schema: - $ref: '#/components/schemas/TaskInstanceCollection' + $ref: '#/components/schemas/TaskInstance' description: Success. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -2988,124 +3227,130 @@ paths: schema: $ref: '#/components/schemas/Error' description: A specified resource is not found. - summary: List task instances (batch) + summary: Get a mapped task instance tags: - TaskInstance x-openapi-router-controller: airflow.api_connexion.endpoints.task_instance_endpoint - /variables: - get: - description: The collection does not contain data. To get data, you must get - a single entity. - operationId: get_variables + patch: + description: | + Updates the state for single mapped task instance. + *New in version 2.5.0* + operationId: patch_mapped_task_instance parameters: - - description: The numbers of items to return. - explode: true - in: query - name: limit - required: false + - description: The DAG ID. + explode: false + in: path + name: dag_id + required: true schema: - default: 100 - type: integer - style: form - - description: The number of items to skip before starting to collect the result - set. - explode: true - in: query - name: offset - required: false + type: string + style: simple + - description: The DAG run ID. + explode: false + in: path + name: dag_run_id + required: true schema: - minimum: 0 - type: integer - style: form - - description: | - The name of the field to order the results by. - Prefix a field name with `-` to reverse the sort order. - - *New in version 2.1.0* - explode: true - in: query - name: order_by - required: false + type: string + style: simple + - description: The task ID. + explode: false + in: path + name: task_id + required: true schema: type: string - style: form + style: simple + - description: The map index. + explode: false + in: path + name: map_index + required: true + schema: + type: integer + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateTaskInstance' + description: Parameters of action responses: "200": content: application/json: schema: - $ref: '#/components/schemas/VariableCollection' + $ref: '#/components/schemas/TaskInstanceReference' description: Success. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: schema: $ref: '#/components/schemas/Error' description: Client does not have sufficient permission. - summary: List variables - tags: - - Variable - x-openapi-router-controller: airflow.api_connexion.endpoints.variable_endpoint - post: - operationId: post_variables - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Variable' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Variable' - description: Success. - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client specified an invalid argument. - "401": + "404": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. - "403": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client does not have sufficient permission. - summary: Create a variable + description: A specified resource is not found. + summary: Updates the state of a mapped task instance tags: - - Variable - x-openapi-router-controller: airflow.api_connexion.endpoints.variable_endpoint - /variables/{variable_key}: - delete: - operationId: delete_variable + - TaskInstance + x-openapi-router-controller: airflow.api_connexion.endpoints.task_instance_endpoint + /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}/dependencies: + get: + description: | + Get task dependencies blocking task from getting scheduled. + + *New in version 2.10.0* + operationId: get_mapped_task_instance_dependencies parameters: - - description: The variable Key. + - description: The DAG ID. explode: false in: path - name: variable_key + name: dag_id required: true schema: - format: path type: string style: simple + - description: The DAG run ID. + explode: false + in: path + name: dag_run_id + required: true + schema: + type: string + style: simple + - description: The task ID. + explode: false + in: path + name: task_id + required: true + schema: + type: string + style: simple + - description: The map index. + explode: false + in: path + name: map_index + required: true + schema: + type: integer + style: simple responses: - "204": + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/TaskInstanceDependencyCollection' description: Success. "400": content: @@ -3118,8 +3363,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -3132,90 +3377,63 @@ paths: schema: $ref: '#/components/schemas/Error' description: A specified resource is not found. - summary: Delete a variable + summary: Get task dependencies blocking task from getting scheduled. tags: - - Variable - x-openapi-router-controller: airflow.api_connexion.endpoints.variable_endpoint - get: - description: Get a variable by key. - operationId: get_variable + - TaskInstance + x-openapi-router-controller: airflow.api_connexion.endpoints.task_instance_endpoint + /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}/setNote: + patch: + description: | + Update the manual user note of a mapped Task Instance. + + *New in version 2.5.0* + operationId: set_mapped_task_instance_note parameters: - - description: The variable Key. + - description: The DAG ID. explode: false in: path - name: variable_key + name: dag_id required: true schema: - format: path type: string style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Variable' - description: Success. - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. - "403": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client does not have sufficient permission. - "404": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: A specified resource is not found. - summary: Get a variable - tags: - - Variable - x-openapi-router-controller: airflow.api_connexion.endpoints.variable_endpoint - patch: - description: Update a variable by key. - operationId: patch_variable - parameters: - - description: The variable Key. + - description: The DAG run ID. explode: false in: path - name: variable_key + name: dag_run_id required: true schema: - format: path type: string style: simple - - description: | - The fields to update on the resource. If absent or empty, all modifiable fields are updated. - A comma-separated list of fully qualified names of fields. + - description: The task ID. explode: false - in: query - name: update_mask - required: false + in: path + name: task_id + required: true schema: - items: - type: string - type: array - style: form + type: string + style: simple + - description: The map index. + explode: false + in: path + name: map_index + required: true + schema: + type: integer + style: simple requestBody: content: application/json: schema: - $ref: '#/components/schemas/Variable' + $ref: '#/components/schemas/SetTaskInstanceNote' + description: Parameters of set Task Instance note. required: true responses: "200": content: application/json: schema: - $ref: '#/components/schemas/Variable' + $ref: '#/components/schemas/TaskInstance' description: Success. "400": content: @@ -3228,8 +3446,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -3242,17 +3460,17 @@ paths: schema: $ref: '#/components/schemas/Error' description: A specified resource is not found. - summary: Update a variable + summary: Update the TaskInstance note. tags: - - Variable - x-openapi-router-controller: airflow.api_connexion.endpoints.variable_endpoint - /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries: + - TaskInstance + x-openapi-router-controller: airflow.api_connexion.endpoints.task_instance_endpoint + /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}/tries: get: - description: This endpoint allows specifying `~` as the dag_id, dag_run_id, - task_id to retrieve XCOM entries for for all DAGs, DAG runs and task instances. - XCom values won't be returned as they can be large. Use this endpoint to get - a list of XCom entries and then fetch individual entry to get value. - operationId: get_xcom_entries + description: | + Get details of all task instance tries. + + *New in version 2.10.0* + operationId: get_mapped_task_instance_tries parameters: - description: The DAG ID. explode: false @@ -3278,6 +3496,14 @@ paths: schema: type: string style: simple + - description: The map index. + explode: false + in: path + name: map_index + required: true + schema: + type: integer + style: simple - description: The numbers of items to return. explode: true in: query @@ -3297,33 +3523,55 @@ paths: minimum: 0 type: integer style: form + - description: | + The name of the field to order the results by. + Prefix a field name with `-` to reverse the sort order. + + *New in version 2.1.0* + explode: true + in: query + name: order_by + required: false + schema: + type: string + style: form responses: "200": content: application/json: schema: - $ref: '#/components/schemas/XComCollection' + $ref: '#/components/schemas/TaskInstanceHistoryCollection' description: Success. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: schema: $ref: '#/components/schemas/Error' description: Client does not have sufficient permission. - summary: List XCom entries + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: List mapped task instance tries tags: - - XCom - x-openapi-router-controller: airflow.api_connexion.endpoints.xcom_endpoint - /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries/{xcom_key}: + - TaskInstance + x-openapi-router-controller: airflow.api_connexion.endpoints.task_instance_endpoint + /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}/tries/{task_try_number}: get: - operationId: get_xcom_entry + description: | + Get details of a mapped task instance try. + + *New in version 2.10.0* + operationId: get_mapped_task_instance_try_details parameters: - description: The DAG ID. explode: false @@ -3349,46 +3597,36 @@ paths: schema: type: string style: simple - - description: The XCom key. + - description: The map index. explode: false in: path - name: xcom_key + name: map_index required: true schema: - type: string + type: integer style: simple - - description: | - Whether to deserialize an XCom value when using a custom XCom backend. - - The XCom API endpoint calls `orm_deserialize_value` by default since an XCom may contain value - that is potentially expensive to deserialize in the web server. Setting this to true overrides - the consideration, and calls `deserialize_value` instead. - - This parameter is not meaningful when using the default XCom backend. - - *New in version 2.4.0* - explode: true - in: query - name: deserialize - required: false + - description: The task try number. + explode: false + in: path + name: task_try_number + required: true schema: - default: false - type: boolean - style: form + type: integer + style: simple responses: "200": content: application/json: schema: - $ref: '#/components/schemas/XCom' + $ref: '#/components/schemas/TaskInstanceHistory' description: Success. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -3401,15 +3639,17 @@ paths: schema: $ref: '#/components/schemas/Error' description: A specified resource is not found. - summary: Get an XCom entry + summary: get mapped taskinstance try tags: - - XCom - x-openapi-router-controller: airflow.api_connexion.endpoints.xcom_endpoint - /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/links: + - TaskInstance + x-openapi-router-controller: airflow.api_connexion.endpoints.task_instance_endpoint + /dags/{dag_id}/dagRuns/{dag_run_id}/upstreamDatasetEvents: get: description: | - List extra links for task instance. - operationId: get_extra_links + Get datasets for a dag run. + + *New in version 2.4.0* + operationId: get_upstream_dataset_events parameters: - description: The DAG ID. explode: false @@ -3427,28 +3667,20 @@ paths: schema: type: string style: simple - - description: The task ID. - explode: false - in: path - name: task_id - required: true - schema: - type: string - style: simple responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ExtraLinkCollection' + $ref: '#/components/schemas/DatasetEventCollection' description: Success. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -3461,16 +3693,20 @@ paths: schema: $ref: '#/components/schemas/Error' description: A specified resource is not found. - summary: List extra links + summary: Get dataset events for a DAG run tags: - - TaskInstance - x-openapi-router-controller: airflow.api_connexion.endpoints.extra_link_endpoint - /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/logs/{task_try_number}: - get: - description: Get logs for a specific task instance and its try number. - operationId: get_log - parameters: - - description: The DAG ID. + - DAGRun + - Dataset + x-openapi-router-controller: airflow.api_connexion.endpoints.dag_run_endpoint + /dags/{dag_id}/datasets/queuedEvent: + delete: + description: | + Delete queued Dataset events for a DAG. + + *New in version 2.9.0* + operationId: delete_dag_dataset_queued_events + parameters: + - description: The DAG ID. explode: false in: path name: dag_id @@ -3478,56 +3714,198 @@ paths: schema: type: string style: simple - - description: The DAG run ID. + - description: Timestamp to select event logs occurring before. + explode: true + in: query + name: before + required: false + schema: + format: date-time + type: string + style: form + responses: + "204": + description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Delete queued Dataset events for a DAG. + tags: + - Dataset + x-openapi-router-controller: airflow.api_connexion.endpoints.dataset_endpoint + get: + description: | + Get queued Dataset events for a DAG. + + *New in version 2.9.0* + operationId: get_dag_dataset_queued_events + parameters: + - description: The DAG ID. explode: false in: path - name: dag_run_id + name: dag_id required: true schema: type: string style: simple - - description: The task ID. + - description: Timestamp to select event logs occurring before. + explode: true + in: query + name: before + required: false + schema: + format: date-time + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/QueuedEventCollection' + description: Success. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Get queued Dataset events for a DAG. + tags: + - Dataset + x-openapi-router-controller: airflow.api_connexion.endpoints.dataset_endpoint + /dags/{dag_id}/datasets/queuedEvent/{uri}: + delete: + description: | + Delete a queued Dataset event for a DAG. + + *New in version 2.9.0* + operationId: delete_dag_dataset_queued_event + parameters: + - description: The DAG ID. explode: false in: path - name: task_id + name: dag_id required: true schema: type: string style: simple - - description: The task try number. + - description: The encoded Dataset URI explode: false in: path - name: task_try_number + name: uri required: true schema: - type: integer + format: path + type: string style: simple - - description: | - A full content will be returned. - By default, only the first fragment will be returned. + - description: Timestamp to select event logs occurring before. explode: true in: query - name: full_content + name: before required: false schema: - type: boolean + format: date-time + type: string style: form - - description: Filter on map index for mapped task. - explode: true - in: query - name: map_index - required: false + responses: + "204": + description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Delete a queued Dataset event for a DAG. + tags: + - Dataset + x-openapi-router-controller: airflow.api_connexion.endpoints.dataset_endpoint + get: + description: | + Get a queued Dataset event for a DAG. + + *New in version 2.9.0* + operationId: get_dag_dataset_queued_event + parameters: + - description: The DAG ID. + explode: false + in: path + name: dag_id + required: true schema: - type: integer - style: form - - description: | - A token that allows you to continue fetching logs. - If passed, it will specify the location from which the download should be continued. + type: string + style: simple + - description: The encoded Dataset URI + explode: false + in: path + name: uri + required: true + schema: + format: path + type: string + style: simple + - description: Timestamp to select event logs occurring before. explode: true in: query - name: token + name: before required: false schema: + format: date-time type: string style: form responses: @@ -3535,24 +3913,15 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/inline_response_200' - text/plain: - schema: - $ref: '#/components/schemas/inline_response_200' + $ref: '#/components/schemas/QueuedEvent' description: Success. - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client specified an invalid argument. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -3565,10 +3934,10 @@ paths: schema: $ref: '#/components/schemas/Error' description: A specified resource is not found. - summary: Get logs + summary: Get a queued Dataset event for a DAG tags: - - TaskInstance - x-openapi-router-controller: airflow.api_connexion.endpoints.log_endpoint + - Dataset + x-openapi-router-controller: airflow.api_connexion.endpoints.dataset_endpoint /dags/{dag_id}/details: get: description: | @@ -3583,6 +3952,17 @@ paths: schema: type: string style: simple + - description: | + List of field for return. + explode: true + in: query + name: fields + required: false + schema: + items: + type: string + type: array + style: form responses: "200": content: @@ -3595,8 +3975,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -3649,8 +4029,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -3699,8 +4079,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -3717,40 +4097,41 @@ paths: tags: - DAG x-openapi-router-controller: airflow.api_connexion.endpoints.task_endpoint - /dagSources/{file_token}: - get: + /dags/{dag_id}/updateTaskInstancesState: + post: description: | - Get a source code using file token. - operationId: get_dag_source + Updates the state for multiple task instances simultaneously. + operationId: post_set_task_instances_state parameters: - - description: | - The key containing the encrypted path to the file. Encryption and decryption take place only on - the server. This prevents the client from reading an non-DAG file. This also ensures API - extensibility, because the format of encrypted data may change. + - description: The DAG ID. explode: false in: path - name: file_token + name: dag_id required: true schema: type: string style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateTaskInstancesState' + description: Parameters of action + required: true responses: "200": content: application/json: schema: - $ref: '#/components/schemas/inline_response_200_1' - plain/text: - schema: - $ref: '#/components/schemas/inline_response_200_1' + $ref: '#/components/schemas/TaskInstanceReferenceCollection' description: Success. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -3763,91 +4144,93 @@ paths: schema: $ref: '#/components/schemas/Error' description: A specified resource is not found. - "406": + summary: Set a state of task instances + tags: + - DAG + x-openapi-router-controller: airflow.api_connexion.endpoints.task_instance_endpoint + /dags/~/dagRuns/list: + post: + description: | + This endpoint is a POST to allow filtering across a large number of DAG IDs, where as a GET it would run in to maximum HTTP request URL length limit. + operationId: get_dag_runs_batch + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ListDagRunsForm' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DAGRunCollection' + description: Success. + "400": content: application/json: schema: $ref: '#/components/schemas/Error' - description: A specified Accept header is not allowed. - summary: Get a source code + description: Client specified an invalid argument. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + summary: List DAG runs (batch) tags: - - DAG - x-openapi-router-controller: airflow.api_connexion.endpoints.dag_source_endpoint - /dagWarnings: - get: - operationId: get_dag_warnings - parameters: - - description: If set, only return DAG warnings with this dag_id. - explode: true - in: query - name: dag_id - required: false - schema: - type: string - style: form - - description: If set, only return DAG warnings with this type. - explode: true - in: query - name: warning_type - required: false - schema: - type: string - style: form - - description: The numbers of items to return. - explode: true - in: query - name: limit - required: false - schema: - default: 100 - type: integer - style: form - - description: The number of items to skip before starting to collect the result - set. - explode: true - in: query - name: offset - required: false - schema: - minimum: 0 - type: integer - style: form - - description: | - The name of the field to order the results by. - Prefix a field name with `-` to reverse the sort order. - - *New in version 2.1.0* - explode: true - in: query - name: order_by - required: false - schema: - type: string - style: form + - DAGRun + x-openapi-router-controller: airflow.api_connexion.endpoints.dag_run_endpoint + /dags/~/dagRuns/~/taskInstances/list: + post: + description: | + List task instances from all DAGs and DAG runs. + This endpoint is a POST to allow filtering across a large number of DAG IDs, where as a GET it would run in to maximum HTTP request URL length limits. + operationId: get_task_instances_batch + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ListTaskInstanceForm' + required: true responses: "200": content: application/json: schema: - $ref: '#/components/schemas/DagWarningCollection' + $ref: '#/components/schemas/TaskInstanceCollection' description: Success. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: schema: $ref: '#/components/schemas/Error' description: Client does not have sufficient permission. - summary: List dag warnings + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: List task instances (batch) tags: - - DagWarning - x-openapi-router-controller: airflow.api_connexion.endpoints.dag_warning_endpoint + - TaskInstance + x-openapi-router-controller: airflow.api_connexion.endpoints.task_instance_endpoint /datasets: get: operationId: get_datasets @@ -3892,71 +4275,38 @@ paths: schema: type: string style: form - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/DatasetCollection' - description: Success. - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. - "403": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client does not have sufficient permission. - summary: List datasets - tags: - - Dataset - x-openapi-router-controller: airflow.api_connexion.endpoints.dataset_endpoint - /datasets/{uri}: - get: - description: Get a dataset by uri. - operationId: get_dataset - parameters: - - description: The encoded Dataset URI - explode: false - in: path - name: uri - required: true + - description: | + One or more DAG IDs separated by commas to filter datasets by associated DAGs either consuming or producing. + + *New in version 2.9.0* + explode: true + in: query + name: dag_ids + required: false schema: - format: path type: string - style: simple + style: form responses: "200": content: application/json: schema: - $ref: '#/components/schemas/Dataset' + $ref: '#/components/schemas/DatasetCollection' description: Success. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: schema: $ref: '#/components/schemas/Error' description: Client does not have sufficient permission. - "404": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: A specified resource is not found. - summary: Get a dataset + summary: List datasets tags: - Dataset x-openapi-router-controller: airflow.api_connexion.endpoints.dataset_endpoint @@ -4048,8 +4398,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -4066,126 +4416,93 @@ paths: tags: - Dataset x-openapi-router-controller: airflow.api_connexion.endpoints.dataset_endpoint - /config: - get: - operationId: get_config + post: + description: Create dataset event + operationId: create_dataset_event + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateDatasetEvent' + required: true responses: "200": content: application/json: - example: - sections: - - name: core - options: - - key: dags_folder - value: /home/user/my-dags-folder - - name: smtp - options: - - key: smtp_host - value: localhost - - key: smtp_mail_from - value: airflow@example.com - schema: - $ref: '#/components/schemas/Config' - text/plain: - example: | - [core] - dags_folder = /home/user/my-dags-folder - [smtp] - smtp_host = localhost - smtp_mail_from = airflow@example.com schema: - type: string + $ref: '#/components/schemas/DatasetEvent' description: Success. - "401": + "400": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. - "403": + description: Client specified an invalid argument. + "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Client does not have sufficient permission. - summary: Get current configuration - tags: - - Config - x-openapi-router-controller: airflow.api_connexion.endpoints.config_endpoint - /health: - get: - description: | - Get the status of Airflow's metadatabase and scheduler. It includes info about - metadatabase and last heartbeat of scheduler. - operationId: get_health - responses: - "200": + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": content: application/json: schema: - $ref: '#/components/schemas/HealthInfo' - description: Success. - summary: Get instance status - tags: - - Monitoring - x-openapi-router-controller: airflow.api_connexion.endpoints.health_endpoint - /version: - get: - operationId: get_version - responses: - "200": + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": content: application/json: schema: - $ref: '#/components/schemas/VersionInfo' - description: Success. - summary: Get version information + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Create dataset event tags: - - Monitoring - x-openapi-router-controller: airflow.api_connexion.endpoints.version_endpoint - /plugins: - get: + - Dataset + x-openapi-router-controller: airflow.api_connexion.endpoints.dataset_endpoint + /datasets/queuedEvent/{uri}: + delete: description: | - Get a list of loaded plugins. + Delete queued Dataset events for a Dataset. - *New in version 2.1.0* - operationId: get_plugins + *New in version 2.9.0* + operationId: delete_dataset_queued_events parameters: - - description: The numbers of items to return. - explode: true - in: query - name: limit - required: false + - description: The encoded Dataset URI + explode: false + in: path + name: uri + required: true schema: - default: 100 - type: integer - style: form - - description: The number of items to skip before starting to collect the result - set. + format: path + type: string + style: simple + - description: Timestamp to select event logs occurring before. explode: true in: query - name: offset + name: before required: false schema: - minimum: 0 - type: integer + format: date-time + type: string style: form responses: - "200": + "204": + description: Success. + "400": content: application/json: schema: - $ref: '#/components/schemas/PluginCollection' - description: Success + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -4198,47 +4515,33 @@ paths: schema: $ref: '#/components/schemas/Error' description: A specified resource is not found. - summary: Get a list of loaded plugins + summary: Delete queued Dataset events for a Dataset. tags: - - Plugin - x-openapi-router-controller: airflow.api_connexion.endpoints.plugin_endpoint - /roles: + - Dataset + x-openapi-router-controller: airflow.api_connexion.endpoints.dataset_endpoint get: description: | - Get a list of roles. + Get queued Dataset events for a Dataset - *New in version 2.1.0* - operationId: get_roles + *New in version 2.9.0* + operationId: get_dataset_queued_events parameters: - - description: The numbers of items to return. + - description: The encoded Dataset URI + explode: false + in: path + name: uri + required: true + schema: + format: path + type: string + style: simple + - description: Timestamp to select event logs occurring before. explode: true in: query - name: limit - required: false - schema: - default: 100 - type: integer - style: form - - description: The number of items to skip before starting to collect the result - set. - explode: true - in: query - name: offset - required: false - schema: - minimum: 0 - type: integer - style: form - - description: | - The name of the field to order the results by. - Prefix a field name with `-` to reverse the sort order. - - *New in version 2.1.0* - explode: true - in: query - name: order_by + name: before required: false schema: + format: date-time type: string style: form responses: @@ -4246,99 +4549,15 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RoleCollection' - description: Success. - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. - "403": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client does not have sufficient permission. - summary: List roles - tags: - - Role - x-openapi-router-controller: airflow.api_connexion.endpoints.role_and_permission_endpoint - post: - description: | - Create a new role. - - *New in version 2.1.0* - operationId: post_role - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Role' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Role' - description: Success. - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client specified an invalid argument. - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. - "403": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client does not have sufficient permission. - summary: Create a role - tags: - - Role - x-openapi-router-controller: airflow.api_connexion.endpoints.role_and_permission_endpoint - /roles/{role_name}: - delete: - description: | - Delete a role. - - *New in version 2.1.0* - operationId: delete_role - parameters: - - description: The role name - explode: false - in: path - name: role_name - required: true - schema: - type: string - style: simple - responses: - "204": + $ref: '#/components/schemas/QueuedEventCollection' description: Success. - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client specified an invalid argument. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -4351,108 +4570,38 @@ paths: schema: $ref: '#/components/schemas/Error' description: A specified resource is not found. - summary: Delete a role + summary: Get queued Dataset events for a Dataset. tags: - - Role - x-openapi-router-controller: airflow.api_connexion.endpoints.role_and_permission_endpoint + - Dataset + x-openapi-router-controller: airflow.api_connexion.endpoints.dataset_endpoint + /datasets/{uri}: get: - description: | - Get a role. - - *New in version 2.1.0* - operationId: get_role - parameters: - - description: The role name - explode: false - in: path - name: role_name - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Role' - description: Success. - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. - "403": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client does not have sufficient permission. - "404": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: A specified resource is not found. - summary: Get a role - tags: - - Role - x-openapi-router-controller: airflow.api_connexion.endpoints.role_and_permission_endpoint - patch: - description: | - Update a role. - - *New in version 2.1.0* - operationId: patch_role + description: Get a dataset by uri. + operationId: get_dataset parameters: - - description: The role name + - description: The encoded Dataset URI explode: false in: path - name: role_name + name: uri required: true schema: + format: path type: string style: simple - - description: | - The fields to update on the resource. If absent or empty, all modifiable fields are updated. - A comma-separated list of fully qualified names of fields. - explode: false - in: query - name: update_mask - required: false - schema: - items: - type: string - type: array - style: form - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Role' - required: true responses: "200": content: application/json: schema: - $ref: '#/components/schemas/Role' + $ref: '#/components/schemas/Dataset' description: Success. - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client specified an invalid argument. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -4465,17 +4614,14 @@ paths: schema: $ref: '#/components/schemas/Error' description: A specified resource is not found. - summary: Update a role + summary: Get a dataset tags: - - Role - x-openapi-router-controller: airflow.api_connexion.endpoints.role_and_permission_endpoint - /permissions: + - Dataset + x-openapi-router-controller: airflow.api_connexion.endpoints.dataset_endpoint + /eventLogs: get: - description: | - Get a list of permissions. - - *New in version 2.1.0* - operationId: get_permissions + description: List log entries from event log. + operationId: get_event_logs parameters: - description: The numbers of items to return. explode: true @@ -4496,224 +4642,280 @@ paths: minimum: 0 type: integer style: form - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ActionCollection' - description: Success. - "401": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. - "403": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client does not have sufficient permission. - summary: List permissions - tags: - - Permission - x-openapi-router-controller: airflow.api_connexion.endpoints.role_and_permission_endpoint - /users: - get: - description: | - Get a list of users. + - description: | + The name of the field to order the results by. + Prefix a field name with `-` to reverse the sort order. - *New in version 2.1.0* - operationId: get_users - parameters: - - description: The numbers of items to return. + *New in version 2.1.0* explode: true in: query - name: limit + name: order_by required: false schema: - default: 100 - type: integer + type: string style: form - - description: The number of items to skip before starting to collect the result - set. + - description: Returns objects matched by the DAG ID. explode: true in: query - name: offset + name: dag_id required: false schema: - minimum: 0 - type: integer + type: string style: form - - description: | - The name of the field to order the results by. - Prefix a field name with `-` to reverse the sort order. - - *New in version 2.1.0* + - description: Returns objects matched by the Task ID. explode: true in: query - name: order_by + name: task_id required: false schema: type: string style: form - responses: - "200": - content: - application/json: + - description: Returns objects matched by the Run ID. + explode: true + in: query + name: run_id + required: false + schema: + type: string + style: form + - description: Filter on map index for mapped task. + explode: true + in: query + name: map_index + required: false + schema: + type: integer + style: form + - description: Filter on try_number for task instance. + explode: true + in: query + name: try_number + required: false + schema: + type: integer + style: form + - description: The name of event log. + explode: true + in: query + name: event + required: false + schema: + type: string + style: form + - description: The owner's name of event log. + explode: true + in: query + name: owner + required: false + schema: + type: string + style: form + - description: Timestamp to select event logs occurring before. + explode: true + in: query + name: before + required: false + schema: + format: date-time + type: string + style: form + - description: Timestamp to select event logs occurring after. + explode: true + in: query + name: after + required: false + schema: + format: date-time + type: string + style: form + - description: | + One or more event names separated by commas. If set, only return event logs with events matching this pattern. + *New in version 2.9.0* + explode: true + in: query + name: included_events + required: false + schema: + type: string + style: form + - description: | + One or more event names separated by commas. If set, only return event logs with events that do not match this pattern. + *New in version 2.9.0* + explode: true + in: query + name: excluded_events + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: schema: - $ref: '#/components/schemas/UserCollection' + $ref: '#/components/schemas/EventLogCollection' description: Success. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: schema: $ref: '#/components/schemas/Error' description: Client does not have sufficient permission. - summary: List users + summary: List log entries tags: - - User - x-openapi-router-controller: airflow.api_connexion.endpoints.user_endpoint - post: - description: | - Create a new user with unique username and email. - - *New in version 2.2.0* - operationId: post_user - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' + - EventLog + x-openapi-router-controller: airflow.api_connexion.endpoints.event_log_endpoint + /eventLogs/{event_log_id}: + get: + operationId: get_event_log + parameters: + - description: The event log ID. + explode: false + in: path + name: event_log_id required: true + schema: + type: integer + style: simple responses: "200": content: application/json: schema: - $ref: '#/components/schemas/User' + $ref: '#/components/schemas/EventLog' description: Success. - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client specified an invalid argument. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: schema: $ref: '#/components/schemas/Error' description: Client does not have sufficient permission. - "409": + "404": content: application/json: schema: $ref: '#/components/schemas/Error' - description: An existing resource conflicts with the request. - summary: Create a user + description: A specified resource is not found. + summary: Get a log entry tags: - - User - x-openapi-router-controller: airflow.api_connexion.endpoints.user_endpoint - /users/{username}: - delete: + - EventLog + x-openapi-router-controller: airflow.api_connexion.endpoints.event_log_endpoint + /health: + get: description: | - Delete a user with a specific username. - - *New in version 2.2.0* - operationId: delete_user + Get the status of Airflow's metadatabase, triggerer and scheduler. It includes info about + metadatabase and last heartbeat of scheduler and triggerer. + operationId: get_health + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthInfo' + description: Success. + summary: Get instance status + tags: + - Monitoring + x-openapi-router-controller: airflow.api_connexion.endpoints.health_endpoint + /importErrors: + get: + operationId: get_import_errors parameters: + - description: The numbers of items to return. + explode: true + in: query + name: limit + required: false + schema: + default: 100 + type: integer + style: form + - description: The number of items to skip before starting to collect the result + set. + explode: true + in: query + name: offset + required: false + schema: + minimum: 0 + type: integer + style: form - description: | - The username of the user. + The name of the field to order the results by. + Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* - explode: false - in: path - name: username - required: true + explode: true + in: query + name: order_by + required: false schema: type: string - style: simple + style: form responses: - "204": - description: Success. - "400": + "200": content: application/json: schema: - $ref: '#/components/schemas/Error' - description: Client specified an invalid argument. + $ref: '#/components/schemas/ImportErrorCollection' + description: Success. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: schema: $ref: '#/components/schemas/Error' description: Client does not have sufficient permission. - "404": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: A specified resource is not found. - summary: Delete a user + summary: List import errors tags: - - User - x-openapi-router-controller: airflow.api_connexion.endpoints.user_endpoint + - ImportError + x-openapi-router-controller: airflow.api_connexion.endpoints.import_error_endpoint + /importErrors/{import_error_id}: get: - description: | - Get a user with a specific username. - - *New in version 2.1.0* - operationId: get_user + operationId: get_import_error parameters: - - description: | - The username of the user. - - *New in version 2.1.0* + - description: The import error ID. explode: false in: path - name: username + name: import_error_id required: true schema: - type: string + type: integer style: simple responses: "200": content: application/json: schema: - $ref: '#/components/schemas/UserCollectionItem' + $ref: '#/components/schemas/ImportError' description: Success. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -4726,66 +4928,37 @@ paths: schema: $ref: '#/components/schemas/Error' description: A specified resource is not found. - summary: Get a user + summary: Get an import error tags: - - User - x-openapi-router-controller: airflow.api_connexion.endpoints.user_endpoint - patch: + - ImportError + x-openapi-router-controller: airflow.api_connexion.endpoints.import_error_endpoint + /parseDagFile/{file_token}: + put: description: | - Update fields for a user. - - *New in version 2.2.0* - operationId: patch_user + Request re-parsing of existing DAG files using a file token. + operationId: reparse_dag_file parameters: - description: | - The username of the user. - - *New in version 2.1.0* + The key containing the encrypted path to the file. Encryption and decryption take place only on + the server. This prevents the client from reading an non-DAG file. This also ensures API + extensibility, because the format of encrypted data may change. explode: false in: path - name: username + name: file_token required: true schema: type: string style: simple - - description: | - The fields to update on the resource. If absent or empty, all modifiable fields are updated. - A comma-separated list of fully qualified names of fields. - explode: false - in: query - name: update_mask - required: false - schema: - items: - type: string - type: array - style: form - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Role' + "201": description: Success. - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Client specified an invalid argument. "401": content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." "403": content: application/json: @@ -4798,58 +4971,1256 @@ paths: schema: $ref: '#/components/schemas/Error' description: A specified resource is not found. - summary: Update a user + summary: Request re-parsing of a DAG file tags: - - User - x-openapi-router-controller: airflow.api_connexion.endpoints.user_endpoint -components: - callbacks: {} - examples: {} - headers: {} - links: {} + - DAG + x-openapi-router-controller: airflow.api_connexion.endpoints.dag_parsing + /permissions: + get: + deprecated: true + description: | + Get a list of permissions. + + *This API endpoint is deprecated, please use the endpoint `/auth/fab/v1` for this operation instead.* + operationId: get_permissions + parameters: + - description: The numbers of items to return. + explode: true + in: query + name: limit + required: false + schema: + default: 100 + type: integer + style: form + - description: The number of items to skip before starting to collect the result + set. + explode: true + in: query + name: offset + required: false + schema: + minimum: 0 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ActionCollection' + description: Success. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + summary: List permissions + tags: + - Permission + x-openapi-router-controller: airflow.api_connexion.endpoints.forward_to_fab_endpoint + /plugins: + get: + description: | + Get a list of loaded plugins. + + *New in version 2.1.0* + operationId: get_plugins + parameters: + - description: The numbers of items to return. + explode: true + in: query + name: limit + required: false + schema: + default: 100 + type: integer + style: form + - description: The number of items to skip before starting to collect the result + set. + explode: true + in: query + name: offset + required: false + schema: + minimum: 0 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PluginCollection' + description: Success + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Get a list of loaded plugins + tags: + - Plugin + x-openapi-router-controller: airflow.api_connexion.endpoints.plugin_endpoint + /pools: + get: + operationId: get_pools + parameters: + - description: The numbers of items to return. + explode: true + in: query + name: limit + required: false + schema: + default: 100 + type: integer + style: form + - description: The number of items to skip before starting to collect the result + set. + explode: true + in: query + name: offset + required: false + schema: + minimum: 0 + type: integer + style: form + - description: | + The name of the field to order the results by. + Prefix a field name with `-` to reverse the sort order. + + *New in version 2.1.0* + explode: true + in: query + name: order_by + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/PoolCollection' + description: List of pools. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + summary: List pools + tags: + - Pool + x-openapi-router-controller: airflow.api_connexion.endpoints.pool_endpoint + post: + operationId: post_pool + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pool' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Pool' + description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + summary: Create a pool + tags: + - Pool + x-openapi-router-controller: airflow.api_connexion.endpoints.pool_endpoint + /pools/{pool_name}: + delete: + operationId: delete_pool + parameters: + - description: The pool name. + explode: false + in: path + name: pool_name + required: true + schema: + type: string + style: simple + responses: + "204": + description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Delete a pool + tags: + - Pool + x-openapi-router-controller: airflow.api_connexion.endpoints.pool_endpoint + get: + operationId: get_pool + parameters: + - description: The pool name. + explode: false + in: path + name: pool_name + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Pool' + description: Success. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Get a pool + tags: + - Pool + x-openapi-router-controller: airflow.api_connexion.endpoints.pool_endpoint + patch: + operationId: patch_pool + parameters: + - description: The pool name. + explode: false + in: path + name: pool_name + required: true + schema: + type: string + style: simple + - description: | + The fields to update on the resource. If absent or empty, all modifiable fields are updated. + A comma-separated list of fully qualified names of fields. + explode: false + in: query + name: update_mask + required: false + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pool' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Pool' + description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: An existing resource conflicts with the request. + summary: Update a pool + tags: + - Pool + x-openapi-router-controller: airflow.api_connexion.endpoints.pool_endpoint + /providers: + get: + description: | + Get a list of providers. + + *New in version 2.1.0* + operationId: get_providers + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/get_providers_200_response' + description: List of providers. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + summary: List providers + tags: + - Provider + x-openapi-router-controller: airflow.api_connexion.endpoints.provider_endpoint + /roles: + get: + deprecated: true + description: | + Get a list of roles. + + *This API endpoint is deprecated, please use the endpoint `/auth/fab/v1` for this operation instead.* + operationId: get_roles + parameters: + - description: The numbers of items to return. + explode: true + in: query + name: limit + required: false + schema: + default: 100 + type: integer + style: form + - description: The number of items to skip before starting to collect the result + set. + explode: true + in: query + name: offset + required: false + schema: + minimum: 0 + type: integer + style: form + - description: | + The name of the field to order the results by. + Prefix a field name with `-` to reverse the sort order. + + *New in version 2.1.0* + explode: true + in: query + name: order_by + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RoleCollection' + description: Success. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + summary: List roles + tags: + - Role + x-openapi-router-controller: airflow.api_connexion.endpoints.forward_to_fab_endpoint + post: + deprecated: true + description: | + Create a new role. + + *This API endpoint is deprecated, please use the endpoint `/auth/fab/v1` for this operation instead.* + operationId: post_role + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Role' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Role' + description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + summary: Create a role + tags: + - Role + x-openapi-router-controller: airflow.api_connexion.endpoints.forward_to_fab_endpoint + /roles/{role_name}: + delete: + deprecated: true + description: | + Delete a role. + + *This API endpoint is deprecated, please use the endpoint `/auth/fab/v1` for this operation instead.* + operationId: delete_role + parameters: + - description: The role name + explode: false + in: path + name: role_name + required: true + schema: + type: string + style: simple + responses: + "204": + description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Delete a role + tags: + - Role + x-openapi-router-controller: airflow.api_connexion.endpoints.forward_to_fab_endpoint + get: + deprecated: true + description: | + Get a role. + + *This API endpoint is deprecated, please use the endpoint `/auth/fab/v1` for this operation instead.* + operationId: get_role + parameters: + - description: The role name + explode: false + in: path + name: role_name + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Role' + description: Success. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Get a role + tags: + - Role + x-openapi-router-controller: airflow.api_connexion.endpoints.forward_to_fab_endpoint + patch: + deprecated: true + description: | + Update a role. + + *This API endpoint is deprecated, please use the endpoint `/auth/fab/v1` for this operation instead.* + operationId: patch_role + parameters: + - description: The role name + explode: false + in: path + name: role_name + required: true + schema: + type: string + style: simple + - description: | + The fields to update on the resource. If absent or empty, all modifiable fields are updated. + A comma-separated list of fully qualified names of fields. + explode: false + in: query + name: update_mask + required: false + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Role' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Role' + description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Update a role + tags: + - Role + x-openapi-router-controller: airflow.api_connexion.endpoints.forward_to_fab_endpoint + /users: + get: + deprecated: true + description: | + Get a list of users. + + *This API endpoint is deprecated, please use the endpoint `/auth/fab/v1` for this operation instead.* + operationId: get_users + parameters: + - description: The numbers of items to return. + explode: true + in: query + name: limit + required: false + schema: + default: 100 + type: integer + style: form + - description: The number of items to skip before starting to collect the result + set. + explode: true + in: query + name: offset + required: false + schema: + minimum: 0 + type: integer + style: form + - description: | + The name of the field to order the results by. + Prefix a field name with `-` to reverse the sort order. + + *New in version 2.1.0* + explode: true + in: query + name: order_by + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UserCollection' + description: Success. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + summary: List users + tags: + - User + x-openapi-router-controller: airflow.api_connexion.endpoints.forward_to_fab_endpoint + post: + deprecated: true + description: | + Create a new user with unique username and email. + + *This API endpoint is deprecated, please use the endpoint `/auth/fab/v1` for this operation instead.* + operationId: post_user + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: An existing resource conflicts with the request. + summary: Create a user + tags: + - User + x-openapi-router-controller: airflow.api_connexion.endpoints.forward_to_fab_endpoint + /users/{username}: + delete: + deprecated: true + description: | + Delete a user with a specific username. + + *This API endpoint is deprecated, please use the endpoint `/auth/fab/v1` for this operation instead.* + operationId: delete_user + parameters: + - description: | + The username of the user. + + *New in version 2.1.0* + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "204": + description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Delete a user + tags: + - User + x-openapi-router-controller: airflow.api_connexion.endpoints.forward_to_fab_endpoint + get: + deprecated: true + description: | + Get a user with a specific username. + + *This API endpoint is deprecated, please use the endpoint `/auth/fab/v1` for this operation instead.* + operationId: get_user + parameters: + - description: | + The username of the user. + + *New in version 2.1.0* + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UserCollectionItem' + description: Success. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Get a user + tags: + - User + x-openapi-router-controller: airflow.api_connexion.endpoints.forward_to_fab_endpoint + patch: + deprecated: true + description: | + Update fields for a user. + + *This API endpoint is deprecated, please use the endpoint `/auth/fab/v1` for this operation instead.* + operationId: patch_user + parameters: + - description: | + The username of the user. + + *New in version 2.1.0* + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + - description: | + The fields to update on the resource. If absent or empty, all modifiable fields are updated. + A comma-separated list of fully qualified names of fields. + explode: false + in: query + name: update_mask + required: false + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UserCollectionItem' + description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Update a user + tags: + - User + x-openapi-router-controller: airflow.api_connexion.endpoints.forward_to_fab_endpoint + /variables: + get: + description: "The collection does not contain data. To get data, you must get\ + \ a single entity." + operationId: get_variables + parameters: + - description: The numbers of items to return. + explode: true + in: query + name: limit + required: false + schema: + default: 100 + type: integer + style: form + - description: The number of items to skip before starting to collect the result + set. + explode: true + in: query + name: offset + required: false + schema: + minimum: 0 + type: integer + style: form + - description: | + The name of the field to order the results by. + Prefix a field name with `-` to reverse the sort order. + + *New in version 2.1.0* + explode: true + in: query + name: order_by + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/VariableCollection' + description: Success. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + summary: List variables + tags: + - Variable + x-openapi-router-controller: airflow.api_connexion.endpoints.variable_endpoint + post: + operationId: post_variables + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + summary: Create a variable + tags: + - Variable + x-openapi-router-controller: airflow.api_connexion.endpoints.variable_endpoint + /variables/{variable_key}: + delete: + operationId: delete_variable + parameters: + - description: The variable Key. + explode: false + in: path + name: variable_key + required: true + schema: + format: path + type: string + style: simple + responses: + "204": + description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Delete a variable + tags: + - Variable + x-openapi-router-controller: airflow.api_connexion.endpoints.variable_endpoint + get: + description: Get a variable by key. + operationId: get_variable + parameters: + - description: The variable Key. + explode: false + in: path + name: variable_key + required: true + schema: + format: path + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + description: Success. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Get a variable + tags: + - Variable + x-openapi-router-controller: airflow.api_connexion.endpoints.variable_endpoint + patch: + description: Update a variable by key. + operationId: patch_variable + parameters: + - description: The variable Key. + explode: false + in: path + name: variable_key + required: true + schema: + format: path + type: string + style: simple + - description: | + The fields to update on the resource. If absent or empty, all modifiable fields are updated. + A comma-separated list of fully qualified names of fields. + explode: false + in: query + name: update_mask + required: false + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Variable' + description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Update a variable + tags: + - Variable + x-openapi-router-controller: airflow.api_connexion.endpoints.variable_endpoint + /version: + get: + operationId: get_version + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/VersionInfo' + description: Success. + summary: Get version information + tags: + - Monitoring + x-openapi-router-controller: airflow.api_connexion.endpoints.version_endpoint +components: + callbacks: {} + examples: {} + headers: {} + links: {} parameters: - PageOffset: - description: The number of items to skip before starting to collect the result - set. + After: + description: Timestamp to select event logs occurring after. explode: true in: query - name: offset + name: after required: false schema: - minimum: 0 - type: integer + format: date-time + type: string style: form - PageLimit: - description: The numbers of items to return. + Before: + description: Timestamp to select event logs occurring before. explode: true in: query - name: limit + name: before required: false schema: - default: 100 - type: integer - style: form - Username: - description: | - The username of the user. - - *New in version 2.1.0* - explode: false - in: path - name: username - required: true - schema: - type: string - style: simple - RoleName: - description: The role name - explode: false - in: path - name: role_name - required: true - schema: + format: date-time type: string - style: simple + style: form ConnectionID: description: The connection ID. explode: false @@ -4859,6 +6230,17 @@ components: schema: type: string style: simple + ContinuationToken: + description: | + A token that allows you to continue fetching logs. + If passed, it will specify the location from which the download should be continued. + explode: true + in: query + name: token + required: false + schema: + type: string + style: form DAGID: description: The DAG ID. explode: false @@ -4868,24 +6250,6 @@ components: schema: type: string style: simple - TaskID: - description: The task ID. - explode: false - in: path - name: task_id - required: true - schema: - type: string - style: simple - MapIndex: - description: The map index. - explode: false - in: path - name: map_index - required: true - schema: - type: integer - style: simple DAGRunID: description: The DAG run ID. explode: false @@ -4895,144 +6259,87 @@ components: schema: type: string style: simple - TaskTryNumber: - description: The task try number. - explode: false - in: path - name: task_try_number - required: true - schema: - type: integer - style: simple - EventLogID: - description: The event log ID. - explode: false - in: path - name: event_log_id - required: true - schema: - type: integer - style: simple - ImportErrorID: - description: The import error ID. - explode: false - in: path - name: import_error_id - required: true - schema: - type: integer - style: simple DatasetURI: description: The encoded Dataset URI explode: false in: path name: uri - required: true - schema: - format: path - type: string - style: simple - PoolName: - description: The pool name. - explode: false - in: path - name: pool_name - required: true - schema: - type: string - style: simple - VariableKey: - description: The variable Key. - explode: false - in: path - name: variable_key - required: true - schema: - format: path - type: string - style: simple - FullContent: - description: | - A full content will be returned. - By default, only the first fragment will be returned. - explode: true - in: query - name: full_content - required: false + required: true schema: - type: boolean - style: form - ContinuationToken: - description: | - A token that allows you to continue fetching logs. - If passed, it will specify the location from which the download should be continued. + format: path + type: string + style: simple + Event: + description: The name of event log. explode: true in: query - name: token + name: event required: false schema: type: string style: form - XComKey: - description: The XCom key. + EventLogID: + description: The event log ID. explode: false in: path - name: xcom_key + name: event_log_id required: true schema: - type: string + type: integer style: simple - FilterExecutionDateGTE: + FileToken: description: | - Returns objects greater or equal to the specified date. - - This can be combined with execution_date_lte parameter to receive only the selected period. + The key containing the encrypted path to the file. Encryption and decryption take place only on + the server. This prevents the client from reading an non-DAG file. This also ensures API + extensibility, because the format of encrypted data may change. + explode: false + in: path + name: file_token + required: true + schema: + type: string + style: simple + FilterDAGID: + description: Returns objects matched by the DAG ID. explode: true in: query - name: execution_date_gte + name: dag_id required: false schema: - format: date-time type: string style: form - FilterExecutionDateLTE: - description: | - Returns objects less than or equal to the specified date. - - This can be combined with execution_date_gte parameter to receive only the selected period. + FilterDatasetID: + description: The Dataset ID that updated the dataset. explode: true in: query - name: execution_date_lte + name: dataset_id required: false schema: - format: date-time - type: string + type: integer style: form - FilterStartDateGTE: + FilterDurationGTE: description: | - Returns objects greater or equal the specified date. + Returns objects greater than or equal to the specified values. - This can be combined with start_date_lte parameter to receive only the selected period. + This can be combined with duration_lte parameter to receive only the selected period. explode: true in: query - name: start_date_gte + name: duration_gte required: false schema: - format: date-time - type: string + type: number style: form - FilterStartDateLTE: + FilterDurationLTE: description: | - Returns objects less or equal the specified date. + Returns objects less than or equal to the specified values. - This can be combined with start_date_gte parameter to receive only the selected period. + This can be combined with duration_gte parameter to receive only the selected range. explode: true in: query - name: start_date_lte + name: duration_lte required: false schema: - format: date-time - type: string + type: number style: form FilterEndDateGTE: description: | @@ -5060,42 +6367,53 @@ components: format: date-time type: string style: form - FilterDurationGTE: + FilterExecutionDateGTE: description: | - Returns objects greater than or equal to the specified values. + Returns objects greater or equal to the specified date. - This can be combined with duration_lte parameter to receive only the selected period. + This can be combined with execution_date_lte parameter to receive only the selected period. explode: true in: query - name: duration_gte + name: execution_date_gte required: false schema: - type: number + format: date-time + type: string style: form - FilterDurationLTE: + FilterExecutionDateLTE: description: | - Returns objects less than or equal to the specified values. + Returns objects less than or equal to the specified date. - This can be combined with duration_gte parameter to receive only the selected range. + This can be combined with execution_date_gte parameter to receive only the selected period. explode: true in: query - name: duration_lte + name: execution_date_lte required: false schema: - type: number + format: date-time + type: string style: form - FilterState: + FilterExecutor: description: The value can be repeated to retrieve multiple matching values (OR condition). explode: true in: query - name: state + name: executor required: false schema: items: type: string type: array style: form + FilterMapIndex: + description: Filter on map index for mapped task. + explode: true + in: query + name: map_index + required: false + schema: + type: integer + style: form FilterPool: description: The value can be repeated to retrieve multiple matching values (OR condition). @@ -5120,6 +6438,89 @@ components: type: string type: array style: form + FilterRunID: + description: Returns objects matched by the Run ID. + explode: true + in: query + name: run_id + required: false + schema: + type: string + style: form + FilterSourceDAGID: + description: The DAG ID that updated the dataset. + explode: true + in: query + name: source_dag_id + required: false + schema: + type: string + style: form + FilterSourceMapIndex: + description: The map index that updated the dataset. + explode: true + in: query + name: source_map_index + required: false + schema: + type: integer + style: form + FilterSourceRunID: + description: The DAG run ID that updated the dataset. + explode: true + in: query + name: source_run_id + required: false + schema: + type: string + style: form + FilterSourceTaskID: + description: The task ID that updated the dataset. + explode: true + in: query + name: source_task_id + required: false + schema: + type: string + style: form + FilterStartDateGTE: + description: | + Returns objects greater or equal the specified date. + + This can be combined with start_date_lte parameter to receive only the selected period. + explode: true + in: query + name: start_date_gte + required: false + schema: + format: date-time + type: string + style: form + FilterStartDateLTE: + description: | + Returns objects less or equal the specified date. + + This can be combined with start_date_gte parameter to receive only the selected period. + explode: true + in: query + name: start_date_lte + required: false + schema: + format: date-time + type: string + style: form + FilterState: + description: The value can be repeated to retrieve multiple matching values + (OR condition). + explode: true + in: query + name: state + required: false + schema: + items: + type: string + type: array + style: form FilterTags: description: | List of tags to filter results. @@ -5134,98 +6535,208 @@ components: type: string type: array style: form - FilterDatasetID: - description: The Dataset ID that updated the dataset. + FilterTaskID: + description: Returns objects matched by the Task ID. explode: true in: query - name: dataset_id + name: task_id + required: false + schema: + type: string + style: form + FilterTryNumber: + description: Filter on try_number for task instance. + explode: true + in: query + name: try_number required: false schema: type: integer style: form - FilterSourceDAGID: - description: The DAG ID that updated the dataset. + FilterUpdatedAtGTE: + description: | + Returns objects greater or equal the specified date. + + This can be combined with updated_at_lte parameter to receive only the selected period. + + *New in version 2.6.0* + explode: true + in: query + name: updated_at_gte + required: false + schema: + format: date-time + type: string + style: form + FilterUpdatedAtLTE: + description: | + Returns objects less or equal the specified date. + + This can be combined with updated_at_gte parameter to receive only the selected period. + + *New in version 2.6.0* + explode: true + in: query + name: updated_at_lte + required: false + schema: + format: date-time + type: string + style: form + FilterXcomKey: + description: Only filter the XCom records which have the provided key. + explode: true + in: query + name: xcom_key + required: false + schema: + type: string + style: form + FullContent: + description: | + A full content will be returned. + By default, only the first fragment will be returned. + explode: true + in: query + name: full_content + required: false + schema: + type: boolean + style: form + ImportErrorID: + description: The import error ID. + explode: false + in: path + name: import_error_id + required: true + schema: + type: integer + style: simple + MapIndex: + description: The map index. + explode: false + in: path + name: map_index + required: true + schema: + type: integer + style: simple + OnlyActive: + description: | + Only filter active DAGs. + + *New in version 2.1.1* explode: true in: query - name: source_dag_id + name: only_active required: false schema: - type: string + default: true + type: boolean style: form - FilterSourceTaskID: - description: The task ID that updated the dataset. + OrderBy: + description: | + The name of the field to order the results by. + Prefix a field name with `-` to reverse the sort order. + + *New in version 2.1.0* explode: true in: query - name: source_task_id + name: order_by required: false schema: type: string style: form - FilterSourceRunID: - description: The DAG run ID that updated the dataset. + Owner: + description: The owner's name of event log. explode: true in: query - name: source_run_id + name: owner required: false schema: type: string style: form - FilterSourceMapIndex: - description: The map index that updated the dataset. + PageLimit: + description: The numbers of items to return. explode: true in: query - name: source_map_index + name: limit required: false schema: + default: 100 type: integer style: form - FilterMapIndex: - description: Filter on map index for mapped task. + PageOffset: + description: The number of items to skip before starting to collect the result + set. explode: true in: query - name: map_index + name: offset required: false schema: + minimum: 0 type: integer style: form - OrderBy: + Paused: description: | - The name of the field to order the results by. - Prefix a field name with `-` to reverse the sort order. + Only filter paused/unpaused DAGs. If absent or null, it returns paused and unpaused DAGs. - *New in version 2.1.0* + *New in version 2.6.0* explode: true in: query - name: order_by + name: paused required: false schema: - type: string + type: boolean style: form - OnlyActive: + PoolName: + description: The pool name. + explode: false + in: path + name: pool_name + required: true + schema: + type: string + style: simple + ReturnFields: description: | - Only filter active DAGs. - - *New in version 2.1.1* + List of field for return. explode: true in: query - name: only_active + name: fields required: false schema: - default: true - type: boolean + items: + type: string + type: array style: form - FileToken: - description: | - The key containing the encrypted path to the file. Encryption and decryption take place only on - the server. This prevents the client from reading an non-DAG file. This also ensures API - extensibility, because the format of encrypted data may change. + RoleName: + description: The role name explode: false in: path - name: file_token + name: role_name + required: true + schema: + type: string + style: simple + TaskID: + description: The task ID. + explode: false + in: path + name: task_id required: true schema: type: string style: simple + TaskTryNumber: + description: The task try number. + explode: false + in: path + name: task_try_number + required: true + schema: + type: integer + style: simple UpdateMask: description: | The fields to update on the resource. If absent or empty, all modifiable fields are updated. @@ -5239,52 +6750,84 @@ components: type: string type: array style: form + Username: + description: | + The username of the user. + + *New in version 2.1.0* + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + VariableKey: + description: The variable Key. + explode: false + in: path + name: variable_key + required: true + schema: + format: path + type: string + style: simple + XComKey: + description: The XCom key. + explode: false + in: path + name: xcom_key + required: true + schema: + format: path + type: string + style: simple requestBodies: {} responses: - BadRequest: + AlreadyExists: content: application/json: schema: $ref: '#/components/schemas/Error' - description: Client specified an invalid argument. - Unauthenticated: + description: An existing resource conflicts with the request. + BadRequest: content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request not authenticated due to missing, invalid, authentication - info. - PermissionDenied: + description: Client specified an invalid argument. + MethodNotAllowed: content: application/json: schema: $ref: '#/components/schemas/Error' - description: Client does not have sufficient permission. - NotFound: + description: Request method is known by the server but is not supported by the + target resource. + NotAcceptable: content: application/json: schema: $ref: '#/components/schemas/Error' - description: A specified resource is not found. - MethodNotAllowed: + description: A specified Accept header is not allowed. + NotFound: content: application/json: schema: $ref: '#/components/schemas/Error' - description: Request method is known by the server but is not supported by the - target resource. - NotAcceptable: + description: A specified resource is not found. + PermissionDenied: content: application/json: schema: $ref: '#/components/schemas/Error' - description: A specified Accept header is not allowed. - AlreadyExists: + description: Client does not have sufficient permission. + Unauthenticated: content: application/json: schema: $ref: '#/components/schemas/Error' - description: An existing resource conflicts with the request. + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." Unknown: content: application/json: @@ -5292,123 +6835,359 @@ components: $ref: '#/components/schemas/Error' description: Unknown server error. schemas: - UserCollectionItem: + Action: description: | - A user object. + An action Item. *New in version 2.1.0* example: - login_count: 0 - failed_login_count: 6 - created_on: created_on - last_login: last_login - roles: + name: name + properties: + name: + description: The name of the permission "action" + nullable: false + type: string + type: object + ActionCollection: + allOf: + - properties: + actions: + items: + $ref: '#/components/schemas/Action' + type: array + type: object + - $ref: '#/components/schemas/CollectionInfo' + description: | + A collection of actions. + + *New in version 2.1.0* + example: + actions: - name: name - name: name - last_name: last_name - active: true - first_name: first_name - email: email - changed_on: changed_on - username: username + total_entries: 0 + type: object + ActionResource: + description: | + The Action-Resource item. + + *New in version 2.1.0* + example: + resource: + name: name + action: + name: name properties: - first_name: + action: + $ref: '#/components/schemas/Action' + resource: + $ref: '#/components/schemas/Resource' + type: object + BasicDAGRun: + example: + end_date: 2000-01-23T04:56:07.000+00:00 + data_interval_end: 2000-01-23T04:56:07.000+00:00 + run_id: run_id + dag_id: dag_id + data_interval_start: 2000-01-23T04:56:07.000+00:00 + logical_date: 2000-01-23T04:56:07.000+00:00 + state: queued + start_date: 2000-01-23T04:56:07.000+00:00 + properties: + dag_id: + readOnly: true + type: string + data_interval_end: + format: date-time + nullable: true + readOnly: true + type: string + data_interval_start: + format: date-time + nullable: true + readOnly: true + type: string + end_date: + format: date-time + nullable: true + readOnly: true + type: string + logical_date: description: | - The user's first name. + The logical date (previously called execution date). This is the time or interval covered by + this DAG run, according to the DAG definition. - *Changed in version 2.4.0*: The requirement for this to be non-empty was removed. + The value of this field can be set only when creating the object. If you try to modify the + field of an existing object, the request fails with an BAD_REQUEST error. + + This together with DAG_ID are a unique key. + + *New in version 2.2.0* + format: date-time + type: string + run_id: + description: | + Run ID. + type: string + start_date: + description: | + The start time. The time when DAG run was actually created. + + *Changed in version 2.1.3*: Field becomes nullable. + format: date-time + nullable: true + readOnly: true + type: string + state: + $ref: '#/components/schemas/DagState' + type: object + ClassReference: + description: Class reference + example: + class_name: class_name + module_path: module_path + properties: + class_name: + readOnly: true type: string - last_name: - description: | - The user's last name. - - *Changed in version 2.4.0*: The requirement for this to be non-empty was removed. + module_path: + readOnly: true type: string - username: + type: object + ClearDagRun: + example: + dry_run: true + properties: + dry_run: + default: true description: | - The username. - - *Changed in version 2.2.0*: A minimum character length requirement ('minLength') is added. - minLength: 1 + If set, don't actually run this operation. The response will contain a list of task instances + planned to be cleaned, but not modified in any way. + type: boolean + type: object + ClearTaskInstances: + example: + end_date: end_date + include_future: false + include_past: false + reset_dag_runs: true + include_parentdag: true + include_subdags: true + task_ids: + - task_ids + - task_ids + include_downstream: false + only_running: false + dag_run_id: dag_run_id + include_upstream: false + dry_run: true + only_failed: true + start_date: start_date + properties: + dag_run_id: + description: The DagRun ID for this task instance + nullable: true type: string - email: + dry_run: + default: true description: | - The user's email. - - *Changed in version 2.2.0*: A minimum character length requirement ('minLength') is added. - minLength: 1 + If set, don't actually run this operation. The response will contain a list of task instances + planned to be cleaned, but not modified in any way. + type: boolean + end_date: + description: The maximum execution date to clear. + format: datetime type: string - active: - description: Whether the user is active - nullable: true - readOnly: true + include_downstream: + default: false + description: "If set to true, downstream tasks are also affected." type: boolean - last_login: - description: The last user login + include_future: + default: false + description: "If set to True, also tasks from future DAG Runs are affected." + type: boolean + include_parentdag: + description: Clear tasks in the parent dag of the subdag. + type: boolean + include_past: + default: false + description: "If set to True, also tasks from past DAG Runs are affected." + type: boolean + include_subdags: + description: Clear tasks in subdags and clear external tasks indicated by + ExternalTaskMarker. + type: boolean + include_upstream: + default: false + description: "If set to true, upstream tasks are also affected." + type: boolean + only_failed: + default: true + description: Only clear failed tasks. + type: boolean + only_running: + default: false + description: Only clear running tasks. + type: boolean + reset_dag_runs: + description: Set state of DAG runs to RUNNING. + type: boolean + start_date: + description: The minimum execution date to clear. format: datetime - nullable: true - readOnly: true type: string - login_count: - description: The login count - nullable: true - readOnly: true - type: integer - failed_login_count: - description: The number of times the login failed - nullable: true - readOnly: true - type: integer - roles: + task_ids: description: | - User roles. + A list of task ids to clear. - *Changed in version 2.2.0*: Field is no longer read-only. + *New in version 2.1.0* items: - $ref: '#/components/schemas/UserCollectionItem_roles' + type: string + minItems: 1 type: array - created_on: - description: The date user was created - format: datetime - nullable: true + type: object + CollectionInfo: + description: Metadata about collection. + properties: + total_entries: + description: | + Count of total objects in the current result set before pagination parameters + (limit, offset) are applied. + type: integer + type: object + Color: + description: Color in hexadecimal notation. + pattern: "^#[a-fA-F0-9]{3,6}$" + type: string + Config: + description: The configuration. + example: + sections: + - name: name + options: + - value: value + key: key + - value: value + key: key + - name: name + options: + - value: value + key: key + - value: value + key: key + properties: + sections: + items: + $ref: '#/components/schemas/ConfigSection' + type: array + type: object + ConfigOption: + description: The option of configuration. + example: + value: value + key: key + properties: + key: readOnly: true type: string - changed_on: - description: The date user was changed - format: datetime - nullable: true + value: readOnly: true type: string type: object - User: - allOf: - - $ref: '#/components/schemas/UserCollectionItem' - - $ref: '#/components/schemas/User_allOf' - description: | - A user object with sensitive data. - - *New in version 2.1.0* + ConfigSection: + description: The section of configuration. + example: + name: name + options: + - value: value + key: key + - value: value + key: key + properties: + name: + readOnly: true + type: string + options: + items: + $ref: '#/components/schemas/ConfigOption' + type: array type: object - UserCollection: + Connection: + allOf: + - $ref: '#/components/schemas/ConnectionCollectionItem' + - properties: + extra: + description: "Other values that cannot be put into another field, e.g.\ + \ RSA keys." + nullable: true + type: string + password: + description: Password of the connection. + format: password + type: string + writeOnly: true + type: object + description: Full representation of the connection. + example: + conn_type: conn_type + schema: schema + password: password + connection_id: connection_id + port: 0 + extra: extra + host: host + description: description + login: login + ConnectionCollection: allOf: - - $ref: '#/components/schemas/UserCollection_allOf' + - properties: + connections: + items: + $ref: '#/components/schemas/ConnectionCollectionItem' + type: array + type: object - $ref: '#/components/schemas/CollectionInfo' description: | - Collection of users. + Collection of connections. - *New in version 2.1.0* + *Changed in version 2.1.0*: 'total_entries' field is added. + example: + connections: + - conn_type: conn_type + schema: schema + connection_id: connection_id + port: 0 + host: host + description: description + login: login + - conn_type: conn_type + schema: schema + connection_id: connection_id + port: 0 + host: host + description: description + login: login + total_entries: 6 type: object ConnectionCollectionItem: description: | Connection collection item. The password and extra fields are only available when retrieving a single object due to the sensitivity of this data. + example: + conn_type: conn_type + schema: schema + connection_id: connection_id + port: 0 + host: host + description: description + login: login properties: - connection_id: - description: The connection ID. - type: string conn_type: description: The connection type. type: string + connection_id: + description: The connection ID. + type: string description: description: The description of the connection. nullable: true @@ -5421,29 +7200,15 @@ components: description: Login of the connection. nullable: true type: string - schema: - description: Schema of the connection. - nullable: true - type: string port: description: Port of the connection. nullable: true type: integer + schema: + description: Schema of the connection. + nullable: true + type: string type: object - ConnectionCollection: - allOf: - - $ref: '#/components/schemas/ConnectionCollection_allOf' - - $ref: '#/components/schemas/CollectionInfo' - description: | - Collection of connections. - - *Changed in version 2.1.0*: 'total_entries' field is added. - type: object - Connection: - allOf: - - $ref: '#/components/schemas/ConnectionCollectionItem' - - $ref: '#/components/schemas/Connection_allOf' - description: Full representation of the connection. ConnectionTest: description: | Connection test results. @@ -5453,25 +7218,55 @@ components: message: message status: true properties: - status: - description: The status of the request. - type: boolean - message: - description: The success or failure message of the request. + message: + description: The success or failure message of the request. + type: string + status: + description: The status of the request. + type: boolean + type: object + CreateDatasetEvent: + example: + dataset_uri: dataset_uri + extra: "{}" + properties: + dataset_uri: + description: The URI of the dataset + nullable: false + type: string + extra: + description: The dataset event extra + nullable: true + type: object + required: + - dataset_uri + type: object + CronExpression: + description: Cron expression + nullable: true + properties: + __type: type: string + value: + type: string + required: + - __type + - value type: object DAG: description: DAG example: + dag_display_name: dag_display_name description: description owners: - owners - owners fileloc: fileloc has_task_concurrency_limits: true + max_consecutive_failed_dag_runs: 1 root_dag_id: root_dag_id - last_pickled: 2000-01-23T04:56:07.000+00:00 has_import_errors: true + last_pickled: 2000-01-23T04:56:07.000+00:00 last_parsed_time: 2000-01-23T04:56:07.000+00:00 next_dagrun_create_after: 2000-01-23T04:56:07.000+00:00 dag_id: dag_id @@ -5481,31 +7276,72 @@ components: next_dagrun_data_interval_start: 2000-01-23T04:56:07.000+00:00 is_active: true last_expired: 2000-01-23T04:56:07.000+00:00 - max_active_runs: 6 + max_active_runs: 0 file_token: file_token - max_active_tasks: 0 + max_active_tasks: 6 pickle_id: pickle_id tags: - name: name - name: name timetable_description: timetable_description is_paused: true + schedule_interval: + seconds: 2 + __type: __type + days: 5 + microseconds: 5 is_subdag: true next_dagrun: 2000-01-23T04:56:07.000+00:00 properties: + dag_display_name: + description: | + Human centric display text for the DAG. + + *New in version 2.9.0* + readOnly: true + type: string dag_id: description: The ID of the DAG. readOnly: true type: string - root_dag_id: - description: If the DAG is SubDAG then it is the top level DAG identifier. - Otherwise, null. + default_view: + description: | + Default view of the DAG inside the webserver + + *New in version 2.3.0* nullable: true readOnly: true type: string - is_paused: - description: Whether the DAG is paused. + description: + description: | + User-provided DAG description, which can consist of several sentences or paragraphs that describe DAG contents. + nullable: true + readOnly: true + type: string + file_token: + description: | + The key containing the encrypted path to the file. Encryption and decryption take place only on the server. This prevents the client from reading an non-DAG file. This also ensures API extensibility, because the format of encrypted data may change. + readOnly: true + type: string + fileloc: + description: The absolute path to the file. + readOnly: true + type: string + has_import_errors: + description: | + Whether the DAG has import errors + + *New in version 2.3.0* + nullable: true + readOnly: true + type: boolean + has_task_concurrency_limits: + description: | + Whether the DAG has task concurrency limits + + *New in version 2.3.0* nullable: true + readOnly: true type: boolean is_active: description: | @@ -5517,10 +7353,24 @@ components: nullable: true readOnly: true type: boolean + is_paused: + description: Whether the DAG is paused. + nullable: true + type: boolean is_subdag: description: Whether the DAG is SubDAG. readOnly: true type: boolean + last_expired: + description: | + Time when the DAG last received a refresh signal + (e.g. the DAG's "refresh" button was clicked in the web UI) + + *New in version 2.3.0* + format: date-time + nullable: true + readOnly: true + type: string last_parsed_time: description: | The last time the DAG was parsed. @@ -5539,162 +7389,354 @@ components: nullable: true readOnly: true type: string - last_expired: + max_active_runs: description: | - Time when the DAG last received a refresh signal - (e.g. the DAG's "refresh" button was clicked in the web UI) + Maximum number of active DAG runs for the DAG *New in version 2.3.0* - format: date-time nullable: true readOnly: true - type: string - scheduler_lock: + type: integer + max_active_tasks: description: | - Whether (one of) the scheduler is scheduling this DAG at the moment + Maximum number of active tasks that can be run on the DAG *New in version 2.3.0* nullable: true readOnly: true - type: boolean - pickle_id: + type: integer + max_consecutive_failed_dag_runs: description: | - Foreign key to the latest pickle_id + (experimental) The maximum number of consecutive DAG failures before DAG is automatically paused. - *New in version 2.3.0* + *New in version 2.9.0* nullable: true readOnly: true - type: string - default_view: + type: integer + next_dagrun: description: | - Default view of the DAG inside the webserver + The logical date of the next dag run. *New in version 2.3.0* + format: date-time nullable: true readOnly: true type: string - fileloc: - description: The absolute path to the file. - readOnly: true - type: string - file_token: + next_dagrun_create_after: description: | - The key containing the encrypted path to the file. Encryption and decryption take place only on the server. This prevents the client from reading an non-DAG file. This also ensures API extensibility, because the format of encrypted data may change. + Earliest time at which this ``next_dagrun`` can be created. + + *New in version 2.3.0* + format: date-time + nullable: true readOnly: true type: string - owners: - items: - type: string - readOnly: true - type: array - description: + next_dagrun_data_interval_end: description: | - User-provided DAG description, which can consist of several sentences or paragraphs that describe DAG contents. + The end of the interval of the next dag run. + + *New in version 2.3.0* + format: date-time nullable: true readOnly: true type: string - schedule_interval: - $ref: '#/components/schemas/ScheduleInterval' - timetable_description: + next_dagrun_data_interval_start: description: | - Timetable/Schedule Interval description. + The start of the interval of the next dag run. *New in version 2.3.0* + format: date-time nullable: true readOnly: true type: string - tags: - description: List of tags. + owners: items: - $ref: '#/components/schemas/Tag' - nullable: true + type: string readOnly: true type: array - max_active_tasks: + pickle_id: description: | - Maximum number of active tasks that can be run on the DAG + Foreign key to the latest pickle_id *New in version 2.3.0* nullable: true readOnly: true - type: integer - max_active_runs: - description: | - Maximum number of active DAG runs for the DAG - - *New in version 2.3.0* + type: string + root_dag_id: + description: "If the DAG is SubDAG then it is the top level DAG identifier.\ + \ Otherwise, null." nullable: true readOnly: true - type: integer - has_task_concurrency_limits: + type: string + schedule_interval: + $ref: '#/components/schemas/ScheduleInterval' + scheduler_lock: description: | - Whether the DAG has task concurrency limits + Whether (one of) the scheduler is scheduling this DAG at the moment *New in version 2.3.0* nullable: true readOnly: true type: boolean - has_import_errors: - description: | - Whether the DAG has import errors - - *New in version 2.3.0* + tags: + description: List of tags. + items: + $ref: '#/components/schemas/Tag' nullable: true readOnly: true - type: boolean - next_dagrun: + type: array + timetable_description: description: | - The logical date of the next dag run. + Timetable/Schedule Interval description. *New in version 2.3.0* - format: date-time nullable: true readOnly: true type: string - next_dagrun_data_interval_start: - description: | - The start of the interval of the next dag run. + type: object + DAGCollection: + allOf: + - properties: + dags: + items: + $ref: '#/components/schemas/DAG' + type: array + type: object + - $ref: '#/components/schemas/CollectionInfo' + description: | + Collection of DAGs. + + *Changed in version 2.1.0*: 'total_entries' field is added. + example: + dags: + - dag_display_name: dag_display_name + description: description + owners: + - owners + - owners + fileloc: fileloc + has_task_concurrency_limits: true + max_consecutive_failed_dag_runs: 1 + root_dag_id: root_dag_id + has_import_errors: true + last_pickled: 2000-01-23T04:56:07.000+00:00 + last_parsed_time: 2000-01-23T04:56:07.000+00:00 + next_dagrun_create_after: 2000-01-23T04:56:07.000+00:00 + dag_id: dag_id + scheduler_lock: true + default_view: default_view + next_dagrun_data_interval_end: 2000-01-23T04:56:07.000+00:00 + next_dagrun_data_interval_start: 2000-01-23T04:56:07.000+00:00 + is_active: true + last_expired: 2000-01-23T04:56:07.000+00:00 + max_active_runs: 0 + file_token: file_token + max_active_tasks: 6 + pickle_id: pickle_id + tags: + - name: name + - name: name + timetable_description: timetable_description + is_paused: true + schedule_interval: + seconds: 2 + __type: __type + days: 5 + microseconds: 5 + is_subdag: true + next_dagrun: 2000-01-23T04:56:07.000+00:00 + - dag_display_name: dag_display_name + description: description + owners: + - owners + - owners + fileloc: fileloc + has_task_concurrency_limits: true + max_consecutive_failed_dag_runs: 1 + root_dag_id: root_dag_id + has_import_errors: true + last_pickled: 2000-01-23T04:56:07.000+00:00 + last_parsed_time: 2000-01-23T04:56:07.000+00:00 + next_dagrun_create_after: 2000-01-23T04:56:07.000+00:00 + dag_id: dag_id + scheduler_lock: true + default_view: default_view + next_dagrun_data_interval_end: 2000-01-23T04:56:07.000+00:00 + next_dagrun_data_interval_start: 2000-01-23T04:56:07.000+00:00 + is_active: true + last_expired: 2000-01-23T04:56:07.000+00:00 + max_active_runs: 0 + file_token: file_token + max_active_tasks: 6 + pickle_id: pickle_id + tags: + - name: name + - name: name + timetable_description: timetable_description + is_paused: true + schedule_interval: + seconds: 2 + __type: __type + days: 5 + microseconds: 5 + is_subdag: true + next_dagrun: 2000-01-23T04:56:07.000+00:00 + total_entries: 7 + type: object + DAGDetail: + allOf: + - $ref: '#/components/schemas/DAG' + - properties: + catchup: + nullable: true + readOnly: true + type: boolean + concurrency: + nullable: true + readOnly: true + type: number + dag_run_timeout: + $ref: '#/components/schemas/TimeDelta' + dataset_expression: + $ref: '#/components/schemas/DAGDetail_allOf_dataset_expression' + default_view: + nullable: true + readOnly: true + type: string + doc_md: + nullable: true + readOnly: true + type: string + end_date: + description: | + The DAG's end date. - *New in version 2.3.0* - format: date-time - nullable: true - readOnly: true - type: string - next_dagrun_data_interval_end: - description: | - The end of the interval of the next dag run. + *New in version 2.3.0*. + format: date-time + nullable: true + readOnly: true + type: string + is_paused_upon_creation: + description: | + Whether the DAG is paused upon creation. - *New in version 2.3.0* - format: date-time - nullable: true - readOnly: true - type: string - next_dagrun_create_after: - description: | - Earliest time at which this ``next_dagrun`` can be created. + *New in version 2.3.0* + nullable: true + readOnly: true + type: boolean + last_parsed: + description: | + The last time the DAG was parsed. + + *New in version 2.3.0* + format: date-time + nullable: true + readOnly: true + type: string + orientation: + nullable: true + readOnly: true + type: string + params: + $ref: '#/components/schemas/DAGDetail_allOf_params' + render_template_as_native_obj: + description: | + Whether to render templates as native Python objects. - *New in version 2.3.0* - format: date-time - nullable: true - readOnly: true - type: string - type: object - DAGCollection: - allOf: - - $ref: '#/components/schemas/DAGCollection_allOf' - - $ref: '#/components/schemas/CollectionInfo' + *New in version 2.3.0* + nullable: true + readOnly: true + type: boolean + start_date: + description: | + The DAG's start date. + + *Changed in version 2.0.1*: Field becomes nullable. + format: date-time + nullable: true + readOnly: true + type: string + template_search_path: + description: | + The template search path. + + *New in version 2.3.0* + items: + type: string + nullable: true + type: array + timezone: + $ref: '#/components/schemas/Timezone' + type: object description: | - Collection of DAGs. + DAG details. - *Changed in version 2.1.0*: 'total_entries' field is added. - type: object + For details see: + [airflow.models.dag.DAG](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/models/dag/index.html#airflow.models.dag.DAG) + example: + dag_display_name: dag_display_name + end_date: 2000-01-23T04:56:07.000+00:00 + timezone: null + description: description + dag_run_timeout: + seconds: 2 + __type: __type + days: 5 + microseconds: 5 + owners: + - owners + - owners + fileloc: fileloc + render_template_as_native_obj: true + has_task_concurrency_limits: true + max_consecutive_failed_dag_runs: 1 + doc_md: doc_md + root_dag_id: root_dag_id + has_import_errors: true + last_pickled: 2000-01-23T04:56:07.000+00:00 + last_parsed_time: 2000-01-23T04:56:07.000+00:00 + next_dagrun_create_after: 2000-01-23T04:56:07.000+00:00 + dag_id: dag_id + scheduler_lock: true + default_view: default_view + next_dagrun_data_interval_end: 2000-01-23T04:56:07.000+00:00 + start_date: 2000-01-23T04:56:07.000+00:00 + next_dagrun_data_interval_start: 2000-01-23T04:56:07.000+00:00 + orientation: orientation + is_active: true + last_expired: 2000-01-23T04:56:07.000+00:00 + max_active_runs: 0 + is_paused_upon_creation: true + file_token: file_token + last_parsed: 2000-01-23T04:56:07.000+00:00 + max_active_tasks: 6 + pickle_id: pickle_id + params: null + tags: + - name: name + - name: name + concurrency: 5.962133916683182 + timetable_description: timetable_description + is_paused: true + catchup: true + template_search_path: + - template_search_path + - template_search_path + schedule_interval: + seconds: 2 + __type: __type + days: 5 + microseconds: 5 + is_subdag: true + next_dagrun: 2000-01-23T04:56:07.000+00:00 + dataset_expression: null DAGRun: example: end_date: 2000-01-23T04:56:07.000+00:00 note: note execution_date: 2000-01-23T04:56:07.000+00:00 external_trigger: true - conf: '{}' + conf: "{}" data_interval_start: 2000-01-23T04:56:07.000+00:00 run_type: backfill data_interval_end: 2000-01-23T04:56:07.000+00:00 @@ -5702,8 +7744,19 @@ components: dag_run_id: dag_run_id dag_id: dag_id logical_date: 2000-01-23T04:56:07.000+00:00 + state: queued start_date: 2000-01-23T04:56:07.000+00:00 properties: + conf: + description: | + JSON object describing additional configuration parameters. + + The value of this field can be set only when creating the object. If you try to modify the + field of an existing object, the request fails with an BAD_REQUEST error. + type: object + dag_id: + readOnly: true + type: string dag_run_id: description: | Run ID. @@ -5718,22 +7771,22 @@ components: This together with DAG_ID are a unique key. nullable: true type: string - dag_id: - readOnly: true + data_interval_end: + description: | + The end of the interval the DAG run covers. + format: date-time + nullable: true type: string - logical_date: + data_interval_start: description: | - The logical date (previously called execution date). This is the time or interval covered by - this DAG run, according to the DAG definition. - - The value of this field can be set only when creating the object. If you try to modify the - field of an existing object, the request fails with an BAD_REQUEST error. - - This together with DAG_ID are a unique key. - - *New in version 2.2.0* + The beginning of the interval the DAG run covers. + format: date-time + nullable: true + type: string + end_date: format: date-time nullable: true + readOnly: true type: string execution_date: deprecated: true @@ -5748,34 +7801,34 @@ components: format: date-time nullable: true type: string - start_date: - description: | - The start time. The time when DAG run was actually created. - - *Changed in version 2.1.3*: Field becomes nullable. - format: date-time - nullable: true - readOnly: true - type: string - end_date: - format: date-time - nullable: true + external_trigger: readOnly: true - type: string - data_interval_start: + type: boolean + last_scheduling_decision: format: date-time nullable: true readOnly: true type: string - data_interval_end: + logical_date: + description: | + The logical date (previously called execution date). This is the time or interval covered by + this DAG run, according to the DAG definition. + + The value of this field can be set only when creating the object. If you try to modify the + field of an existing object, the request fails with an BAD_REQUEST error. + + This together with DAG_ID are a unique key. + + *New in version 2.2.0* format: date-time nullable: true - readOnly: true type: string - last_scheduling_decision: - format: date-time + note: + description: | + Contains manually entered notes by the user about the DagRun. + + *New in version 2.5.0* nullable: true - readOnly: true type: string run_type: enum: @@ -5785,1003 +7838,1174 @@ components: - dataset_triggered readOnly: true type: string - state: - $ref: '#/components/schemas/DagState' - external_trigger: - default: true - readOnly: true - type: boolean - conf: - description: | - JSON object describing additional configuration parameters. - - The value of this field can be set only when creating the object. If you try to modify the - field of an existing object, the request fails with an BAD_REQUEST error. - type: object - note: + start_date: description: | - Contains manually entered notes by the user about the DagRun. + The start time. The time when DAG run was actually created. - *New in version 2.5.0* + *Changed in version 2.1.3*: Field becomes nullable. + format: date-time nullable: true + readOnly: true type: string - type: object - UpdateDagRunState: - description: | - Modify the state of a DAG run. - - *New in version 2.2.0* - example: - state: success - properties: state: - description: The state to set this DagRun - enum: - - success - - failed - - queued - type: string + $ref: '#/components/schemas/DagState' type: object DAGRunCollection: allOf: - - $ref: '#/components/schemas/DAGRunCollection_allOf' + - properties: + dag_runs: + items: + $ref: '#/components/schemas/DAGRun' + type: array + type: object - $ref: '#/components/schemas/CollectionInfo' description: | Collection of DAG runs. *Changed in version 2.1.0*: 'total_entries' field is added. + example: + dag_runs: + - end_date: 2000-01-23T04:56:07.000+00:00 + note: note + execution_date: 2000-01-23T04:56:07.000+00:00 + external_trigger: true + conf: "{}" + data_interval_start: 2000-01-23T04:56:07.000+00:00 + run_type: backfill + data_interval_end: 2000-01-23T04:56:07.000+00:00 + last_scheduling_decision: 2000-01-23T04:56:07.000+00:00 + dag_run_id: dag_run_id + dag_id: dag_id + logical_date: 2000-01-23T04:56:07.000+00:00 + state: queued + start_date: 2000-01-23T04:56:07.000+00:00 + - end_date: 2000-01-23T04:56:07.000+00:00 + note: note + execution_date: 2000-01-23T04:56:07.000+00:00 + external_trigger: true + conf: "{}" + data_interval_start: 2000-01-23T04:56:07.000+00:00 + run_type: backfill + data_interval_end: 2000-01-23T04:56:07.000+00:00 + last_scheduling_decision: 2000-01-23T04:56:07.000+00:00 + dag_run_id: dag_run_id + dag_id: dag_id + logical_date: 2000-01-23T04:56:07.000+00:00 + state: queued + start_date: 2000-01-23T04:56:07.000+00:00 + total_entries: 0 type: object - DagWarning: + DagProcessorStatus: + description: | + The status and the latest dag processor heartbeat. + + *New in version 2.6.3* + example: + latest_dag_processor_heartbeat: latest_dag_processor_heartbeat + status: healthy properties: - dag_id: - description: The dag_id. + latest_dag_processor_heartbeat: + description: The time the dag processor last did a heartbeat. + format: datetime + nullable: true readOnly: true type: string - warning_type: - description: The warning type for the dag warning. - readOnly: true + status: + $ref: '#/components/schemas/HealthStatus' + type: object + DagScheduleDatasetReference: + description: | + A datasets reference to a downstream DAG. + + *New in version 2.4.0* + example: + updated_at: updated_at + created_at: created_at + dag_id: dag_id + properties: + created_at: + description: The dataset reference creation time + nullable: false type: string - message: - description: The message for the dag warning. - readOnly: true + dag_id: + description: The DAG ID that depends on the dataset. + nullable: true type: string - timestamp: - description: The time when this warning was logged. - format: datetime - readOnly: true + updated_at: + description: The dataset reference update time + nullable: false + type: string + type: object + DagState: + description: | + DAG State. + + *Changed in version 2.1.3*: 'queued' is added as a possible value. + enum: + - queued + - running + - success + - failed + readOnly: true + type: string + DagStatsCollectionItem: + description: DagStats entry collection item. + example: + stats: + - count: 0 + state: state + - count: 0 + state: state + dag_id: dag_id + properties: + dag_id: + description: The DAG ID. type: string + stats: + items: + $ref: '#/components/schemas/DagStatsStateCollectionItem' + nullable: true + type: array type: object - DagWarningCollection: + DagStatsCollectionSchema: allOf: - - $ref: '#/components/schemas/DagWarningCollection_allOf' + - properties: + dags: + items: + $ref: '#/components/schemas/DagStatsCollectionItem' + type: array + type: object - $ref: '#/components/schemas/CollectionInfo' description: | - Collection of DAG warnings. + Collection of Dag statistics. + example: + dags: + - stats: + - count: 0 + state: state + - count: 0 + state: state + dag_id: dag_id + - stats: + - count: 0 + state: state + - count: 0 + state: state + dag_id: dag_id + total_entries: 6 type: object - SetDagRunNote: + DagStatsStateCollectionItem: + description: DagStatsState entry collection item. example: - note: note + count: 0 + state: state properties: - note: - description: Custom notes left by users for this Dag Run. + count: + description: The DAG state count. + type: integer + state: + description: The DAG state. type: string type: object - EventLog: - description: Log of user operations via CLI or Web UI. + DagWarning: example: - owner: owner - execution_date: 2000-01-23T04:56:07.000+00:00 - extra: extra - event_log_id: 0 - task_id: task_id + warning_type: warning_type dag_id: dag_id - event: event - when: 2000-01-23T04:56:07.000+00:00 + message: message + timestamp: timestamp properties: - event_log_id: - description: The event log ID - readOnly: true - type: integer - when: - description: The time when these events happened. - format: date-time - readOnly: true - type: string dag_id: - description: The DAG ID - nullable: true - readOnly: true - type: string - task_id: - description: The DAG ID - nullable: true - readOnly: true - type: string - event: - description: A key describing the type of event. + description: The dag_id. readOnly: true type: string - execution_date: - description: | - When the event was dispatched for an object having execution_date, the value of this field. - format: date-time - nullable: true + message: + description: The message for the dag warning. readOnly: true type: string - owner: - description: Name of the user who triggered these events a. + timestamp: + description: The time when this warning was logged. + format: datetime readOnly: true type: string - extra: - description: | - Other information that was not included in the other fields, e.g. the complete CLI command. - nullable: true + warning_type: + description: The warning type for the dag warning. readOnly: true type: string type: object - EventLogCollection: + DagWarningCollection: allOf: - - $ref: '#/components/schemas/EventLogCollection_allOf' + - properties: + dag_warnings: + items: + $ref: '#/components/schemas/DagWarning' + type: array + type: object - $ref: '#/components/schemas/CollectionInfo' description: | - Collection of event logs. - - *Changed in version 2.1.0*: 'total_entries' field is added. + Collection of DAG warnings. + example: + dag_warnings: + - warning_type: warning_type + dag_id: dag_id + message: message + timestamp: timestamp + - warning_type: warning_type + dag_id: dag_id + message: message + timestamp: timestamp + total_entries: 0 type: object - ImportError: + Dataset: + description: | + A dataset item. + + *New in version 2.4.0* example: - filename: filename - stack_trace: stack_trace - import_error_id: 0 - timestamp: timestamp + consuming_dags: + - updated_at: updated_at + created_at: created_at + dag_id: dag_id + - updated_at: updated_at + created_at: created_at + dag_id: dag_id + updated_at: updated_at + extra: "{}" + producing_tasks: + - updated_at: updated_at + created_at: created_at + task_id: task_id + dag_id: dag_id + - updated_at: updated_at + created_at: created_at + task_id: task_id + dag_id: dag_id + created_at: created_at + id: 0 + uri: uri properties: - import_error_id: - description: The import error ID. - readOnly: true - type: integer - timestamp: - description: The time when this error was created. - format: datetime - readOnly: true + consuming_dags: + items: + $ref: '#/components/schemas/DagScheduleDatasetReference' + type: array + created_at: + description: The dataset creation time + nullable: false type: string - filename: - description: The filename - readOnly: true + extra: + description: The dataset extra + nullable: true + type: object + id: + description: The dataset id + type: integer + producing_tasks: + items: + $ref: '#/components/schemas/TaskOutletDatasetReference' + type: array + updated_at: + description: The dataset update time + nullable: false type: string - stack_trace: - description: The full stackstrace.. - readOnly: true + uri: + description: The dataset uri + nullable: false type: string type: object - ImportErrorCollection: + DatasetCollection: allOf: - - $ref: '#/components/schemas/ImportErrorCollection_allOf' + - properties: + datasets: + items: + $ref: '#/components/schemas/Dataset' + type: array + type: object - $ref: '#/components/schemas/CollectionInfo' description: | - Collection of import errors. + A collection of datasets. - *Changed in version 2.1.0*: 'total_entries' field is added. - type: object - HealthInfo: - description: Instance status information. + *New in version 2.4.0* example: - scheduler: - latest_scheduler_heartbeat: latest_scheduler_heartbeat - metadatabase: {} - properties: - metadatabase: - $ref: '#/components/schemas/MetadatabaseStatus' - scheduler: - $ref: '#/components/schemas/SchedulerStatus' - type: object - MetadatabaseStatus: - description: The status of the metadatabase. - example: {} - properties: - status: - $ref: '#/components/schemas/HealthStatus' + datasets: + - consuming_dags: + - updated_at: updated_at + created_at: created_at + dag_id: dag_id + - updated_at: updated_at + created_at: created_at + dag_id: dag_id + updated_at: updated_at + extra: "{}" + producing_tasks: + - updated_at: updated_at + created_at: created_at + task_id: task_id + dag_id: dag_id + - updated_at: updated_at + created_at: created_at + task_id: task_id + dag_id: dag_id + created_at: created_at + id: 0 + uri: uri + - consuming_dags: + - updated_at: updated_at + created_at: created_at + dag_id: dag_id + - updated_at: updated_at + created_at: created_at + dag_id: dag_id + updated_at: updated_at + extra: "{}" + producing_tasks: + - updated_at: updated_at + created_at: created_at + task_id: task_id + dag_id: dag_id + - updated_at: updated_at + created_at: created_at + task_id: task_id + dag_id: dag_id + created_at: created_at + id: 0 + uri: uri + total_entries: 6 type: object - SchedulerStatus: - description: The status and the latest scheduler heartbeat. + DatasetEvent: + description: | + A dataset event. + + *New in version 2.4.0* example: - latest_scheduler_heartbeat: latest_scheduler_heartbeat + created_dagruns: + - end_date: 2000-01-23T04:56:07.000+00:00 + data_interval_end: 2000-01-23T04:56:07.000+00:00 + run_id: run_id + dag_id: dag_id + data_interval_start: 2000-01-23T04:56:07.000+00:00 + logical_date: 2000-01-23T04:56:07.000+00:00 + state: queued + start_date: 2000-01-23T04:56:07.000+00:00 + - end_date: 2000-01-23T04:56:07.000+00:00 + data_interval_end: 2000-01-23T04:56:07.000+00:00 + run_id: run_id + dag_id: dag_id + data_interval_start: 2000-01-23T04:56:07.000+00:00 + logical_date: 2000-01-23T04:56:07.000+00:00 + state: queued + start_date: 2000-01-23T04:56:07.000+00:00 + source_dag_id: source_dag_id + source_run_id: source_run_id + dataset_uri: dataset_uri + dataset_id: 0 + extra: "{}" + source_task_id: source_task_id + source_map_index: 6 + timestamp: timestamp properties: - status: - $ref: '#/components/schemas/HealthStatus' - latest_scheduler_heartbeat: - description: The time the scheduler last do a heartbeat. - format: datetime - nullable: true - readOnly: true + created_dagruns: + items: + $ref: '#/components/schemas/BasicDAGRun' + type: array + dataset_id: + description: The dataset id + type: integer + dataset_uri: + description: The URI of the dataset + nullable: false type: string - type: object - Pool: - description: The pool - example: - queued_slots: 5 - open_slots: 5 - slots: 0 - name: name - description: description - used_slots: 1 - occupied_slots: 6 - properties: - name: - description: The name of pool. + extra: + description: The dataset event extra + nullable: true + type: object + source_dag_id: + description: The DAG ID that updated the dataset. + nullable: true type: string - slots: - description: | - The maximum number of slots that can be assigned to tasks. One job may occupy one or more slots. - type: integer - occupied_slots: - description: The number of slots used by running/queued tasks at the moment. - readOnly: true - type: integer - used_slots: - description: The number of slots used by running tasks at the moment. - readOnly: true - type: integer - queued_slots: - description: The number of slots used by queued tasks at the moment. - readOnly: true - type: integer - open_slots: - description: The number of free slots at the moment. - readOnly: true + source_map_index: + description: The task map index that updated the dataset. + nullable: true type: integer - description: - description: | - The description of the pool. - - *New in version 2.3.0* + source_run_id: + description: The DAG run ID that updated the dataset. + nullable: true + type: string + source_task_id: + description: The task ID that updated the dataset. nullable: true type: string + timestamp: + description: The dataset event creation time + nullable: false + type: string type: object - PoolCollection: + DatasetEventCollection: allOf: - - $ref: '#/components/schemas/PoolCollection_allOf' + - properties: + dataset_events: + items: + $ref: '#/components/schemas/DatasetEvent' + type: array + type: object - $ref: '#/components/schemas/CollectionInfo' description: | - Collection of pools. + A collection of dataset events. - *Changed in version 2.1.0*: 'total_entries' field is added. + *New in version 2.4.0* + example: + dataset_events: + - created_dagruns: + - end_date: 2000-01-23T04:56:07.000+00:00 + data_interval_end: 2000-01-23T04:56:07.000+00:00 + run_id: run_id + dag_id: dag_id + data_interval_start: 2000-01-23T04:56:07.000+00:00 + logical_date: 2000-01-23T04:56:07.000+00:00 + state: queued + start_date: 2000-01-23T04:56:07.000+00:00 + - end_date: 2000-01-23T04:56:07.000+00:00 + data_interval_end: 2000-01-23T04:56:07.000+00:00 + run_id: run_id + dag_id: dag_id + data_interval_start: 2000-01-23T04:56:07.000+00:00 + logical_date: 2000-01-23T04:56:07.000+00:00 + state: queued + start_date: 2000-01-23T04:56:07.000+00:00 + source_dag_id: source_dag_id + source_run_id: source_run_id + dataset_uri: dataset_uri + dataset_id: 0 + extra: "{}" + source_task_id: source_task_id + source_map_index: 6 + timestamp: timestamp + - created_dagruns: + - end_date: 2000-01-23T04:56:07.000+00:00 + data_interval_end: 2000-01-23T04:56:07.000+00:00 + run_id: run_id + dag_id: dag_id + data_interval_start: 2000-01-23T04:56:07.000+00:00 + logical_date: 2000-01-23T04:56:07.000+00:00 + state: queued + start_date: 2000-01-23T04:56:07.000+00:00 + - end_date: 2000-01-23T04:56:07.000+00:00 + data_interval_end: 2000-01-23T04:56:07.000+00:00 + run_id: run_id + dag_id: dag_id + data_interval_start: 2000-01-23T04:56:07.000+00:00 + logical_date: 2000-01-23T04:56:07.000+00:00 + state: queued + start_date: 2000-01-23T04:56:07.000+00:00 + source_dag_id: source_dag_id + source_run_id: source_run_id + dataset_uri: dataset_uri + dataset_id: 0 + extra: "{}" + source_task_id: source_task_id + source_map_index: 6 + timestamp: timestamp + total_entries: 1 type: object - Provider: + Error: description: | - The provider - - *New in version 2.1.0* + [RFC7807](https://tools.ietf.org/html/rfc7807) compliant response. + example: + instance: instance + detail: detail + title: title + type: type + status: 0.8008281904610115 properties: - package_name: - description: The package name of the provider. + detail: + description: A human-readable explanation specific to this occurrence of + the problem. type: string - description: - description: The description of the provider. + instance: + description: | + A URI reference that identifies the specific occurrence of the problem. It may or may + not yield further information if dereferenced. type: string - version: - description: The version of the provider. + status: + description: The HTTP status code generated by the API server for this occurrence + of the problem. + type: number + title: + description: "A short, human-readable summary of the problem type." type: string + type: + description: | + A URI reference [RFC3986] that identifies the problem type. This specification + encourages that, when dereferenced, it provide human-readable documentation for + the problem type. + type: string + required: + - status + - title + - type type: object - ProviderCollection: - description: | - Collection of providers. - - *New in version 2.1.0* - properties: - providers: - items: - $ref: '#/components/schemas/Provider' - type: array - type: object - SLAMiss: + EventLog: + description: Log of user operations via CLI or Web UI. example: - notification_sent: true - email_sent: true - execution_date: execution_date - description: description + owner: owner + run_id: run_id + execution_date: 2000-01-23T04:56:07.000+00:00 + extra: extra + event_log_id: 0 + map_index: 6 task_id: task_id + try_number: 1 dag_id: dag_id - timestamp: timestamp - nullable: true + event: event + when: 2000-01-23T04:56:07.000+00:00 properties: - task_id: - description: The task ID. + dag_id: + description: The DAG ID + nullable: true readOnly: true type: string - dag_id: - description: The DAG ID. + event: + description: A key describing the type of event. + readOnly: true type: string + event_log_id: + description: The event log ID + readOnly: true + type: integer execution_date: - format: datetime - type: string - email_sent: - type: boolean - timestamp: - format: datetime - type: string - description: + description: | + When the event was dispatched for an object having execution_date, the value of this field. + format: date-time nullable: true + readOnly: true type: string - notification_sent: - type: boolean - type: object - Trigger: - example: - classpath: classpath - kwargs: kwargs - id: 9 - created_date: created_date - triggerer_id: 3 - properties: - id: - type: integer - classpath: - type: string - kwargs: - type: string - created_date: - format: datetime + extra: + description: | + Other information that was not included in the other fields, e.g. the complete CLI command. + nullable: true + readOnly: true type: string - triggerer_id: + map_index: + description: The Map Index nullable: true + readOnly: true type: integer - type: object - Job: - example: - job_type: job_type - end_date: end_date - unixname: unixname - latest_heartbeat: latest_heartbeat - hostname: hostname - id: 2 - dag_id: dag_id - state: state - executor_class: executor_class - start_date: start_date - properties: - id: - type: integer - dag_id: + owner: + description: Name of the user who triggered these events a. nullable: true + readOnly: true type: string - state: + run_id: + description: The DAG Run ID nullable: true + readOnly: true type: string - job_type: + task_id: + description: The Task ID nullable: true + readOnly: true type: string - start_date: - format: datetime + try_number: + description: The Try Number nullable: true + readOnly: true + type: integer + when: + description: The time when these events happened. + format: date-time + readOnly: true type: string - end_date: - format: datetime - nullable: true + type: object + EventLogCollection: + allOf: + - properties: + event_logs: + items: + $ref: '#/components/schemas/EventLog' + type: array + type: object + - $ref: '#/components/schemas/CollectionInfo' + description: | + Collection of event logs. + + *Changed in version 2.1.0*: 'total_entries' field is added. + *Changed in version 2.10.0*: 'try_number' and 'map_index' fields are added. + example: + event_logs: + - owner: owner + run_id: run_id + execution_date: 2000-01-23T04:56:07.000+00:00 + extra: extra + event_log_id: 0 + map_index: 6 + task_id: task_id + try_number: 1 + dag_id: dag_id + event: event + when: 2000-01-23T04:56:07.000+00:00 + - owner: owner + run_id: run_id + execution_date: 2000-01-23T04:56:07.000+00:00 + extra: extra + event_log_id: 0 + map_index: 6 + task_id: task_id + try_number: 1 + dag_id: dag_id + event: event + when: 2000-01-23T04:56:07.000+00:00 + total_entries: 5 + type: object + ExtraLink: + description: Additional links containing additional information about the task. + example: + name: name + href: href + class_ref: + class_name: class_name + module_path: module_path + properties: + class_ref: + $ref: '#/components/schemas/ClassReference' + href: + readOnly: true type: string - latest_heartbeat: - format: datetime - nullable: true + name: + readOnly: true type: string - executor_class: - nullable: true + type: object + ExtraLinkCollection: + description: The collection of extra links. + example: + extra_links: + - name: name + href: href + class_ref: + class_name: class_name + module_path: module_path + - name: name + href: href + class_ref: + class_name: class_name + module_path: module_path + properties: + extra_links: + items: + $ref: '#/components/schemas/ExtraLink' + type: array + type: object + HealthInfo: + description: Instance status information. + example: + scheduler: + latest_scheduler_heartbeat: latest_scheduler_heartbeat + status: null + triggerer: + latest_triggerer_heartbeat: latest_triggerer_heartbeat + status: null + metadatabase: + status: null + dag_processor: + latest_dag_processor_heartbeat: latest_dag_processor_heartbeat + status: healthy + properties: + dag_processor: + $ref: '#/components/schemas/DagProcessorStatus' + metadatabase: + $ref: '#/components/schemas/MetadatabaseStatus' + scheduler: + $ref: '#/components/schemas/SchedulerStatus' + triggerer: + $ref: '#/components/schemas/TriggererStatus' + type: object + HealthStatus: + description: Health status + enum: + - healthy + - unhealthy + nullable: true + type: string + ImportError: + example: + filename: filename + stack_trace: stack_trace + import_error_id: 0 + timestamp: timestamp + properties: + filename: + description: The filename + readOnly: true type: string - hostname: - nullable: true + import_error_id: + description: The import error ID. + readOnly: true + type: integer + stack_trace: + description: The full stackstrace. + readOnly: true type: string - unixname: - nullable: true + timestamp: + description: The time when this error was created. + format: datetime + readOnly: true type: string type: object - TaskInstance: + ImportErrorCollection: + allOf: + - properties: + import_errors: + items: + $ref: '#/components/schemas/ImportError' + type: array + type: object + - $ref: '#/components/schemas/CollectionInfo' + description: | + Collection of import errors. + + *Changed in version 2.1.0*: 'total_entries' field is added. + example: + import_errors: + - filename: filename + stack_trace: stack_trace + import_error_id: 0 + timestamp: timestamp + - filename: filename + stack_trace: stack_trace + import_error_id: 0 + timestamp: timestamp + total_entries: 6 + type: object + Job: example: end_date: end_date + job_type: job_type unixname: unixname - note: note - rendered_fields: '{}' - task_id: task_id - pid: 7 - operator: operator - sla_miss: - notification_sent: true - email_sent: true - execution_date: execution_date - description: description - task_id: task_id - dag_id: dag_id - timestamp: timestamp - duration: 0.8008281904610115 hostname: hostname + latest_heartbeat: latest_heartbeat dag_id: dag_id - priority_weight: 2 + id: 3 + state: state + executor_class: executor_class start_date: start_date - queued_when: queued_when - triggerer_job: - job_type: job_type - end_date: end_date - unixname: unixname - latest_heartbeat: latest_heartbeat - hostname: hostname - id: 2 - dag_id: dag_id - state: state - executor_class: executor_class - start_date: start_date - execution_date: execution_date - pool_slots: 5 - pool: pool - map_index: 1 - max_tries: 5 - trigger: - classpath: classpath - kwargs: kwargs - id: 9 - created_date: created_date - triggerer_id: 3 - executor_config: executor_config - dag_run_id: dag_run_id - try_number: 6 - queue: queue + nullable: true properties: - task_id: - type: string dag_id: - type: string - dag_run_id: - description: | - The DagRun ID for this task instance - - *New in version 2.3.0* - type: string - execution_date: - format: datetime - type: string - start_date: - format: datetime nullable: true type: string end_date: format: datetime nullable: true type: string - duration: + executor_class: nullable: true - type: number - state: - $ref: '#/components/schemas/TaskState' - try_number: - type: integer - map_index: - type: integer - max_tries: - type: integer - hostname: - type: string - unixname: - type: string - pool: type: string - pool_slots: - type: integer - queue: + hostname: nullable: true type: string - priority_weight: - nullable: true + id: type: integer - operator: - description: | - *Changed in version 2.1.1*: Field becomes nullable. + job_type: nullable: true type: string - queued_when: + latest_heartbeat: + format: datetime nullable: true type: string - pid: + start_date: + format: datetime nullable: true - type: integer - executor_config: type: string - sla_miss: - $ref: '#/components/schemas/SLAMiss' - rendered_fields: - description: | - JSON object describing rendered fields. - - *New in version 2.3.0* - type: object - trigger: - $ref: '#/components/schemas/Trigger' - triggerer_job: - $ref: '#/components/schemas/Job' - note: - description: | - Contains manually entered notes by the user about the TaskInstance. - - *New in version 2.5.0* + state: nullable: true type: string - type: object - TaskInstanceCollection: - allOf: - - $ref: '#/components/schemas/TaskInstanceCollection_allOf' - - $ref: '#/components/schemas/CollectionInfo' - description: | - Collection of task instances. - - *Changed in version 2.1.0*: 'total_entries' field is added. - type: object - TaskInstanceReference: - example: - execution_date: execution_date - dag_run_id: dag_run_id - task_id: task_id - dag_id: dag_id - properties: - task_id: - description: The task ID. - readOnly: true - type: string - dag_id: - description: The DAG ID. - readOnly: true - type: string - execution_date: - format: datetime - readOnly: true - type: string - dag_run_id: - description: The DAG run ID. - readOnly: true + unixname: + nullable: true type: string type: object - TaskInstanceReferenceCollection: + ListDagRunsForm: example: - task_instances: - - execution_date: execution_date - dag_run_id: dag_run_id - task_id: task_id - dag_id: dag_id - - execution_date: execution_date - dag_run_id: dag_run_id - task_id: task_id - dag_id: dag_id + end_date_lte: 2000-01-23T04:56:07.000+00:00 + start_date_gte: 2000-01-23T04:56:07.000+00:00 + execution_date_gte: 2000-01-23T04:56:07.000+00:00 + page_limit: 1 + execution_date_lte: 2000-01-23T04:56:07.000+00:00 + order_by: order_by + end_date_gte: 2000-01-23T04:56:07.000+00:00 + page_offset: 0 + start_date_lte: 2000-01-23T04:56:07.000+00:00 + dag_ids: + - dag_ids + - dag_ids + states: + - states + - states properties: - task_instances: + dag_ids: + description: |- + Return objects with specific DAG IDs. + The value can be repeated to retrieve multiple matching values (OR condition). items: - $ref: '#/components/schemas/TaskInstanceReference' + type: string type: array - type: object - VariableCollectionItem: - description: |- - XCom entry collection item. - The value field are only available when retrieving a single object due to the sensitivity of this data. - properties: - key: - type: string - description: + end_date_gte: description: | - The description of the variable. + Returns objects greater or equal the specified date. - *New in version 2.4.0* - nullable: true + This can be combined with end_date_lte parameter to receive only the selected period. + format: date-time type: string - type: object - VariableCollection: - allOf: - - $ref: '#/components/schemas/VariableCollection_allOf' - - $ref: '#/components/schemas/CollectionInfo' - description: | - Collection of variables. - - *Changed in version 2.1.0*: 'total_entries' field is added. - type: object - Variable: - allOf: - - $ref: '#/components/schemas/VariableCollectionItem' - - $ref: '#/components/schemas/Variable_allOf' - description: Full representation of Variable - XComCollectionItem: - description: | - XCom entry collection item. + end_date_lte: + description: | + Returns objects less than or equal to the specified date. - The value field is only available when reading a single object due to the size of the value. - properties: - key: - type: string - timestamp: - format: datetime - type: string - execution_date: - format: datetime + This can be combined with end_date_gte parameter to receive only the selected period. + format: date-time type: string - task_id: + execution_date_gte: + description: | + Returns objects greater or equal to the specified date. + + This can be combined with execution_date_lte key to receive only the selected period. + format: date-time type: string - dag_id: + execution_date_lte: + description: | + Returns objects less than or equal to the specified date. + + This can be combined with execution_date_gte key to receive only the selected period. + format: date-time type: string - type: object - XComCollection: - allOf: - - $ref: '#/components/schemas/XComCollection_allOf' - - $ref: '#/components/schemas/CollectionInfo' - description: | - Collection of XCom entries. + order_by: + description: | + The name of the field to order the results by. Prefix a field name + with `-` to reverse the sort order. - *Changed in version 2.1.0*: 'total_entries' field is added. - type: object - XCom: - allOf: - - $ref: '#/components/schemas/XComCollectionItem' - - $ref: '#/components/schemas/XCom_allOf' - description: Full representations of XCom entry. - DAGDetail: - allOf: - - $ref: '#/components/schemas/DAG' - - $ref: '#/components/schemas/DAGDetail_allOf' - description: | - DAG details. + *New in version 2.1.0* + type: string + page_limit: + default: 100 + description: The numbers of items to return. + minimum: 1 + type: integer + page_offset: + description: The number of items to skip before starting to collect the + result set. + minimum: 0 + type: integer + start_date_gte: + description: | + Returns objects greater or equal the specified date. - For details see: - [airflow.models.DAG](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/models/index.html#airflow.models.DAG) - ExtraLink: - description: Additional links containing additional information about the task. - example: - name: name - href: href - class_ref: - class_name: class_name - module_path: module_path - properties: - class_ref: - $ref: '#/components/schemas/ClassReference' - name: - readOnly: true + This can be combined with start_date_lte key to receive only the selected period. + format: date-time type: string - href: - readOnly: true + start_date_lte: + description: | + Returns objects less or equal the specified date. + + This can be combined with start_date_gte parameter to receive only the selected period + format: date-time type: string - type: object - ExtraLinkCollection: - description: The collection of extra links. - example: - extra_links: - - name: name - href: href - class_ref: - class_name: class_name - module_path: module_path - - name: name - href: href - class_ref: - class_name: class_name - module_path: module_path - properties: - extra_links: + states: + description: |- + Return objects with specific states. + The value can be repeated to retrieve multiple matching values (OR condition). items: - $ref: '#/components/schemas/ExtraLink' + type: string type: array type: object - Task: - description: | - For details see: - [airflow.models.BaseOperator](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/models/index.html#airflow.models.BaseOperator) + ListTaskInstanceForm: example: - owner: owner - end_date: 2000-01-23T04:56:07.000+00:00 - ui_fgcolor: ui_fgcolor - extra_links: - - class_ref: - class_name: class_name - module_path: module_path - - class_ref: - class_name: class_name - module_path: module_path - depends_on_past: true - ui_color: ui_color - pool_slots: 6.027456183070403 - pool: pool - task_id: task_id - retry_exponential_backoff: true - downstream_task_ids: - - downstream_task_ids - - downstream_task_ids - sub_dag: - description: description - owners: - - owners - - owners - fileloc: fileloc - has_task_concurrency_limits: true - root_dag_id: root_dag_id - last_pickled: 2000-01-23T04:56:07.000+00:00 - has_import_errors: true - last_parsed_time: 2000-01-23T04:56:07.000+00:00 - next_dagrun_create_after: 2000-01-23T04:56:07.000+00:00 - dag_id: dag_id - scheduler_lock: true - default_view: default_view - next_dagrun_data_interval_end: 2000-01-23T04:56:07.000+00:00 - next_dagrun_data_interval_start: 2000-01-23T04:56:07.000+00:00 - is_active: true - last_expired: 2000-01-23T04:56:07.000+00:00 - max_active_runs: 6 - file_token: file_token - max_active_tasks: 0 - pickle_id: pickle_id - tags: - - name: name - - name: name - timetable_description: timetable_description - is_paused: true - is_subdag: true - next_dagrun: 2000-01-23T04:56:07.000+00:00 - retries: 0.8008281904610115 - template_fields: - - template_fields - - template_fields - retry_delay: - seconds: 5 - __type: __type - days: 1 - microseconds: 5 - is_mapped: true - wait_for_downstream: true - priority_weight: 2.3021358869347655 - class_ref: - class_name: class_name - module_path: module_path - execution_timeout: - seconds: 5 - __type: __type - days: 1 - microseconds: 5 - queue: queue - start_date: 2000-01-23T04:56:07.000+00:00 + end_date_lte: 2000-01-23T04:56:07.000+00:00 + dag_run_ids: + - dag_run_ids + - dag_run_ids + duration_gte: 0.8008281904610115 + execution_date_gte: 2000-01-23T04:56:07.000+00:00 + pool: + - pool + - pool + page_offset: 0 + task_ids: + - task_ids + - task_ids + dag_ids: + - dag_ids + - dag_ids + start_date_gte: 2000-01-23T04:56:07.000+00:00 + executor: + - executor + - executor + page_limit: 1 + execution_date_lte: 2000-01-23T04:56:07.000+00:00 + duration_lte: 6.027456183070403 + end_date_gte: 2000-01-23T04:56:07.000+00:00 + state: + - null + - null + start_date_lte: 2000-01-23T04:56:07.000+00:00 + queue: + - queue + - queue properties: - class_ref: - $ref: '#/components/schemas/ClassReference' - task_id: - readOnly: true + dag_ids: + description: |- + Return objects with specific DAG IDs. + The value can be repeated to retrieve multiple matching values (OR condition). + items: + type: string + type: array + dag_run_ids: + description: |- + Return objects with specific DAG Run IDs. + The value can be repeated to retrieve multiple matching values (OR condition). + *New in version 2.7.1* + items: + type: string + type: array + duration_gte: + description: | + Returns objects greater than or equal to the specified values. + + This can be combined with duration_lte parameter to receive only the selected period. + type: number + duration_lte: + description: | + Returns objects less than or equal to the specified values. + + This can be combined with duration_gte parameter to receive only the selected range. + type: number + end_date_gte: + description: | + Returns objects greater or equal the specified date. + + This can be combined with start_date_lte parameter to receive only the selected period. + format: date-time type: string - owner: - readOnly: true + end_date_lte: + description: | + Returns objects less than or equal to the specified date. + + This can be combined with start_date_gte parameter to receive only the selected period. + format: date-time type: string - start_date: + execution_date_gte: + description: | + Returns objects greater or equal to the specified date. + + This can be combined with execution_date_lte parameter to receive only the selected period. format: date-time - readOnly: true type: string - end_date: + execution_date_lte: + description: | + Returns objects less than or equal to the specified date. + + This can be combined with execution_date_gte parameter to receive only the selected period. format: date-time - nullable: true - readOnly: true type: string - trigger_rule: - $ref: '#/components/schemas/TriggerRule' - extra_links: + executor: + description: The value can be repeated to retrieve multiple matching values + (OR condition). + items: + type: string + type: array + page_limit: + default: 100 + description: The numbers of items to return. + minimum: 1 + type: integer + page_offset: + description: The number of items to skip before starting to collect the + result set. + minimum: 0 + type: integer + pool: + description: The value can be repeated to retrieve multiple matching values + (OR condition). items: - $ref: '#/components/schemas/Task_extra_links' - readOnly: true + type: string type: array - depends_on_past: - readOnly: true - type: boolean - is_mapped: - readOnly: true - type: boolean - wait_for_downstream: - readOnly: true - type: boolean - retries: - readOnly: true - type: number queue: - nullable: true - readOnly: true - type: string - pool: - readOnly: true - type: string - pool_slots: - readOnly: true - type: number - execution_timeout: - $ref: '#/components/schemas/TimeDelta' - retry_delay: - $ref: '#/components/schemas/TimeDelta' - retry_exponential_backoff: - readOnly: true - type: boolean - priority_weight: - readOnly: true - type: number - weight_rule: - $ref: '#/components/schemas/WeightRule' - ui_color: - description: Color in hexadecimal notation. - pattern: ^#[a-fA-F0-9]{3,6}$ + description: The value can be repeated to retrieve multiple matching values + (OR condition). + items: + type: string + type: array + start_date_gte: + description: | + Returns objects greater or equal the specified date. + + This can be combined with start_date_lte parameter to receive only the selected period. + format: date-time type: string - ui_fgcolor: - description: Color in hexadecimal notation. - pattern: ^#[a-fA-F0-9]{3,6}$ + start_date_lte: + description: | + Returns objects less or equal the specified date. + + This can be combined with start_date_gte parameter to receive only the selected period. + format: date-time type: string - template_fields: + state: + description: The value can be repeated to retrieve multiple matching values + (OR condition). items: - type: string - readOnly: true + $ref: '#/components/schemas/TaskState' type: array - sub_dag: - $ref: '#/components/schemas/DAG' - downstream_task_ids: + task_ids: + description: |- + Return objects with specific task IDs. + The value can be repeated to retrieve multiple matching values (OR condition). + *New in version 2.7.1* items: type: string - readOnly: true type: array type: object - TaskCollection: - description: Collection of tasks. + MetadatabaseStatus: + description: The status of the metadatabase. example: - tasks: - - owner: owner - end_date: 2000-01-23T04:56:07.000+00:00 - ui_fgcolor: ui_fgcolor - extra_links: - - class_ref: - class_name: class_name - module_path: module_path - - class_ref: - class_name: class_name - module_path: module_path - depends_on_past: true - ui_color: ui_color - pool_slots: 6.027456183070403 - pool: pool - task_id: task_id - retry_exponential_backoff: true - downstream_task_ids: - - downstream_task_ids - - downstream_task_ids - sub_dag: - description: description - owners: - - owners - - owners - fileloc: fileloc - has_task_concurrency_limits: true - root_dag_id: root_dag_id - last_pickled: 2000-01-23T04:56:07.000+00:00 - has_import_errors: true - last_parsed_time: 2000-01-23T04:56:07.000+00:00 - next_dagrun_create_after: 2000-01-23T04:56:07.000+00:00 - dag_id: dag_id - scheduler_lock: true - default_view: default_view - next_dagrun_data_interval_end: 2000-01-23T04:56:07.000+00:00 - next_dagrun_data_interval_start: 2000-01-23T04:56:07.000+00:00 - is_active: true - last_expired: 2000-01-23T04:56:07.000+00:00 - max_active_runs: 6 - file_token: file_token - max_active_tasks: 0 - pickle_id: pickle_id - tags: - - name: name - - name: name - timetable_description: timetable_description - is_paused: true - is_subdag: true - next_dagrun: 2000-01-23T04:56:07.000+00:00 - retries: 0.8008281904610115 - template_fields: - - template_fields - - template_fields - retry_delay: - seconds: 5 - __type: __type - days: 1 - microseconds: 5 - is_mapped: true - wait_for_downstream: true - priority_weight: 2.3021358869347655 - class_ref: - class_name: class_name - module_path: module_path - execution_timeout: - seconds: 5 - __type: __type - days: 1 - microseconds: 5 - queue: queue - start_date: 2000-01-23T04:56:07.000+00:00 - - owner: owner - end_date: 2000-01-23T04:56:07.000+00:00 - ui_fgcolor: ui_fgcolor - extra_links: - - class_ref: - class_name: class_name - module_path: module_path - - class_ref: - class_name: class_name - module_path: module_path - depends_on_past: true - ui_color: ui_color - pool_slots: 6.027456183070403 - pool: pool - task_id: task_id - retry_exponential_backoff: true - downstream_task_ids: - - downstream_task_ids - - downstream_task_ids - sub_dag: - description: description - owners: - - owners - - owners - fileloc: fileloc - has_task_concurrency_limits: true - root_dag_id: root_dag_id - last_pickled: 2000-01-23T04:56:07.000+00:00 - has_import_errors: true - last_parsed_time: 2000-01-23T04:56:07.000+00:00 - next_dagrun_create_after: 2000-01-23T04:56:07.000+00:00 - dag_id: dag_id - scheduler_lock: true - default_view: default_view - next_dagrun_data_interval_end: 2000-01-23T04:56:07.000+00:00 - next_dagrun_data_interval_start: 2000-01-23T04:56:07.000+00:00 - is_active: true - last_expired: 2000-01-23T04:56:07.000+00:00 - max_active_runs: 6 - file_token: file_token - max_active_tasks: 0 - pickle_id: pickle_id - tags: - - name: name - - name: name - timetable_description: timetable_description - is_paused: true - is_subdag: true - next_dagrun: 2000-01-23T04:56:07.000+00:00 - retries: 0.8008281904610115 - template_fields: - - template_fields - - template_fields - retry_delay: - seconds: 5 - __type: __type - days: 1 - microseconds: 5 - is_mapped: true - wait_for_downstream: true - priority_weight: 2.3021358869347655 - class_ref: - class_name: class_name - module_path: module_path - execution_timeout: - seconds: 5 - __type: __type - days: 1 - microseconds: 5 - queue: queue - start_date: 2000-01-23T04:56:07.000+00:00 + status: null properties: - tasks: - items: - $ref: '#/components/schemas/Task' - type: array + status: + $ref: '#/components/schemas/HealthStatus' + type: object + PluginCollection: + allOf: + - properties: + plugins: + items: + $ref: '#/components/schemas/PluginCollectionItem' + type: array + type: object + - $ref: '#/components/schemas/CollectionInfo' + description: | + A collection of plugin. + + *New in version 2.1.0* + example: + plugins: + - macros: + - macros + - macros + listeners: + - listeners + - listeners + ti_deps: + - ti_deps + - ti_deps + flask_blueprints: + - flask_blueprints + - flask_blueprints + source: source + global_operator_extra_links: + - global_operator_extra_links + - global_operator_extra_links + appbuilder_menu_items: + - "{}" + - "{}" + timetables: + - timetables + - timetables + name: name + executors: + - executors + - executors + operator_extra_links: + - operator_extra_links + - operator_extra_links + appbuilder_views: + - "{}" + - "{}" + hooks: + - hooks + - hooks + - macros: + - macros + - macros + listeners: + - listeners + - listeners + ti_deps: + - ti_deps + - ti_deps + flask_blueprints: + - flask_blueprints + - flask_blueprints + source: source + global_operator_extra_links: + - global_operator_extra_links + - global_operator_extra_links + appbuilder_menu_items: + - "{}" + - "{}" + timetables: + - timetables + - timetables + name: name + executors: + - executors + - executors + operator_extra_links: + - operator_extra_links + - operator_extra_links + appbuilder_views: + - "{}" + - "{}" + hooks: + - hooks + - hooks + total_entries: 0 type: object PluginCollectionItem: description: | A plugin Item. *New in version 2.1.0* - properties: - name: - description: The name of the plugin - type: string + example: + macros: + - macros + - macros + listeners: + - listeners + - listeners + ti_deps: + - ti_deps + - ti_deps + flask_blueprints: + - flask_blueprints + - flask_blueprints + source: source + global_operator_extra_links: + - global_operator_extra_links + - global_operator_extra_links + appbuilder_menu_items: + - "{}" + - "{}" + timetables: + - timetables + - timetables + name: name + executors: + - executors + - executors + operator_extra_links: + - operator_extra_links + - operator_extra_links + appbuilder_views: + - "{}" + - "{}" hooks: - description: The plugin hooks + - hooks + - hooks + properties: + appbuilder_menu_items: + description: The Flask Appbuilder menu items items: nullable: true - type: string + type: object + type: array + appbuilder_views: + description: The appuilder views + items: + nullable: true + type: object type: array executors: description: The plugin executors @@ -6789,956 +9013,1330 @@ components: nullable: true type: string type: array - macros: - description: The plugin macros + flask_blueprints: + description: The flask blueprints items: nullable: true - type: object + type: string type: array - flask_blueprints: - description: The flask blueprints + global_operator_extra_links: + description: The global operator extra links items: nullable: true - type: object + type: string type: array - appbuilder_views: - description: The appuilder views + hooks: + description: The plugin hooks items: nullable: true - type: object + type: string type: array - appbuilder_menu_items: - description: The Flask Appbuilder menu items + listeners: + description: The plugin listeners items: - nullable: true - type: object + type: string type: array - global_operator_extra_links: - description: The global operator extra links + macros: + description: The plugin macros items: nullable: true - type: object + type: string type: array + name: + description: The name of the plugin + type: string operator_extra_links: description: Operator extra links items: nullable: true - type: object + type: string type: array source: description: The plugin source nullable: true type: string + ti_deps: + description: The plugin task instance dependencies + items: + type: string + type: array + timetables: + description: The plugin timetables + items: + type: string + type: array type: object - PluginCollection: - allOf: - - $ref: '#/components/schemas/PluginCollection_allOf' - - $ref: '#/components/schemas/CollectionInfo' - description: | - A collection of plugin. - - *New in version 2.1.0* - type: object - Role: - description: | - a role item. - - *New in version 2.1.0* + Pool: + description: The pool example: + open_slots: 1 + queued_slots: 5 + running_slots: 5 + slots: 7 + scheduled_slots: 2 name: name - actions: - - resource: - name: name - action: - name: name - - resource: - name: name - action: - name: name + description: description + deferred_slots: 0 + include_deferred: true + occupied_slots: 6 properties: - name: + deferred_slots: description: | - The name of the role + The number of slots used by deferred tasks at the moment. Relevant if 'include_deferred' is set to true. - *Changed in version 2.3.0*: A minimum character length requirement ('minLength') is added. - minLength: 1 - type: string - actions: - items: - $ref: '#/components/schemas/ActionResource' - type: array - type: object - RoleCollection: - allOf: - - $ref: '#/components/schemas/RoleCollection_allOf' - - $ref: '#/components/schemas/CollectionInfo' - description: | - A collection of roles. + *New in version 2.7.0* + readOnly: true + type: integer + description: + description: | + The description of the pool. - *New in version 2.1.0* - type: object - Action: - description: | - An action Item. + *New in version 2.3.0* + nullable: true + type: string + include_deferred: + description: | + If set to true, deferred tasks are considered when calculating open pool slots. - *New in version 2.1.0* - example: - name: name - properties: + *New in version 2.7.0* + type: boolean name: - description: The name of the permission "action" - nullable: false + description: The name of pool. type: string + occupied_slots: + description: The number of slots used by running/queued tasks at the moment. + May include deferred tasks if 'include_deferred' is set to true. + readOnly: true + type: integer + open_slots: + description: The number of free slots at the moment. + readOnly: true + type: integer + queued_slots: + description: The number of slots used by queued tasks at the moment. + readOnly: true + type: integer + running_slots: + description: The number of slots used by running tasks at the moment. + readOnly: true + type: integer + scheduled_slots: + description: The number of slots used by scheduled tasks at the moment. + readOnly: true + type: integer + slots: + description: | + The maximum number of slots that can be assigned to tasks. One job may occupy one or more slots. + type: integer type: object - ActionCollection: + PoolCollection: allOf: - - $ref: '#/components/schemas/ActionCollection_allOf' + - properties: + pools: + items: + $ref: '#/components/schemas/Pool' + type: array + type: object - $ref: '#/components/schemas/CollectionInfo' description: | - A collection of actions. + Collection of pools. - *New in version 2.1.0* + *Changed in version 2.1.0*: 'total_entries' field is added. + example: + pools: + - open_slots: 1 + queued_slots: 5 + running_slots: 5 + slots: 7 + scheduled_slots: 2 + name: name + description: description + deferred_slots: 0 + include_deferred: true + occupied_slots: 6 + - open_slots: 1 + queued_slots: 5 + running_slots: 5 + slots: 7 + scheduled_slots: 2 + name: name + description: description + deferred_slots: 0 + include_deferred: true + occupied_slots: 6 + total_entries: 9 type: object - Resource: + Provider: description: | - A resource on which permissions are granted. + The provider *New in version 2.1.0* example: - name: name + package_name: package_name + description: description + version: version properties: - name: - description: The name of the resource - nullable: false + description: + description: The description of the provider. + type: string + package_name: + description: The package name of the provider. + type: string + version: + description: The version of the provider. type: string type: object - ActionResource: + ProviderCollection: description: | - The Action-Resource item. + Collection of providers. *New in version 2.1.0* + properties: + providers: + items: + $ref: '#/components/schemas/Provider' + type: array + type: object + QueuedEvent: example: - resource: - name: name - action: - name: name + created_at: 2000-01-23T04:56:07.000+00:00 + dag_id: dag_id + uri: uri properties: - action: - $ref: '#/components/schemas/Action' - resource: - $ref: '#/components/schemas/Resource' + created_at: + description: The creation time of QueuedEvent + format: date-time + type: string + dag_id: + description: The DAG ID. + type: string + uri: + description: The datata uri. + type: string type: object - Dataset: + QueuedEventCollection: + allOf: + - properties: + datasets: + items: + $ref: '#/components/schemas/QueuedEvent' + type: array + type: object + - $ref: '#/components/schemas/CollectionInfo' description: | - A dataset item. + A collection of Dataset Dag Run Queues. - *New in version 2.4.0* + *New in version 2.9.0* example: - consuming_dags: - - updated_at: updated_at - created_at: created_at - dag_id: dag_id - - updated_at: updated_at - created_at: created_at - dag_id: dag_id - updated_at: updated_at - extra: '{}' - producing_tasks: - - updated_at: updated_at - created_at: created_at - task_id: task_id + datasets: + - created_at: 2000-01-23T04:56:07.000+00:00 dag_id: dag_id - - updated_at: updated_at - created_at: created_at - task_id: task_id + uri: uri + - created_at: 2000-01-23T04:56:07.000+00:00 dag_id: dag_id - created_at: created_at - id: 0 - uri: uri + uri: uri + total_entries: 0 + type: object + RelativeDelta: + description: Relative delta properties: - id: - description: The dataset id - type: integer - uri: - description: The dataset uri - nullable: false - type: string - extra: - description: The dataset extra - nullable: true - type: object - created_at: - description: The dataset creation time - nullable: false + __type: type: string - updated_at: - description: The dataset update time + day: + type: integer + days: + type: integer + hour: + type: integer + hours: + type: integer + leapdays: + type: integer + microsecond: + type: integer + microseconds: + type: integer + minute: + type: integer + minutes: + type: integer + month: + type: integer + months: + type: integer + second: + type: integer + seconds: + type: integer + year: + type: integer + years: + type: integer + required: + - __type + - day + - days + - hour + - hours + - leapdays + - microsecond + - microseconds + - minute + - minutes + - month + - months + - second + - seconds + - year + - years + type: object + Resource: + description: | + A resource on which permissions are granted. + + *New in version 2.1.0* + example: + name: name + properties: + name: + description: The name of the resource nullable: false type: string - consuming_dags: - items: - $ref: '#/components/schemas/DagScheduleDatasetReference' - type: array - producing_tasks: + type: object + Role: + description: | + a role item. + + *New in version 2.1.0* + example: + name: name + actions: + - resource: + name: name + action: + name: name + - resource: + name: name + action: + name: name + properties: + actions: items: - $ref: '#/components/schemas/TaskOutletDatasetReference' + $ref: '#/components/schemas/ActionResource' type: array + name: + description: | + The name of the role + + *Changed in version 2.3.0*: A minimum character length requirement ('minLength') is added. + minLength: 1 + type: string type: object - TaskOutletDatasetReference: + RoleCollection: + allOf: + - properties: + roles: + items: + $ref: '#/components/schemas/Role' + type: array + type: object + - $ref: '#/components/schemas/CollectionInfo' description: | - A datasets reference to an upstream task. + A collection of roles. - *New in version 2.4.0* + *New in version 2.1.0* example: - updated_at: updated_at - created_at: created_at + roles: + - name: name + actions: + - resource: + name: name + action: + name: name + - resource: + name: name + action: + name: name + - name: name + actions: + - resource: + name: name + action: + name: name + - resource: + name: name + action: + name: name + total_entries: 0 + type: object + SLAMiss: + example: + notification_sent: true + email_sent: true + execution_date: execution_date + description: description task_id: task_id dag_id: dag_id + timestamp: timestamp + nullable: true properties: dag_id: - description: The DAG ID that updates the dataset. - nullable: true + description: The DAG ID. type: string - task_id: - description: The task ID that updates the dataset. + description: nullable: true type: string - created_at: - description: The dataset creation time - nullable: false + email_sent: + type: boolean + execution_date: + format: datetime type: string - updated_at: - description: The dataset update time - nullable: false + notification_sent: + type: boolean + task_id: + description: The task ID. + readOnly: true + type: string + timestamp: + format: datetime type: string type: object - DagScheduleDatasetReference: + ScheduleInterval: + anyOf: + - $ref: '#/components/schemas/TimeDelta' + - $ref: '#/components/schemas/RelativeDelta' + - $ref: '#/components/schemas/CronExpression' description: | - A datasets reference to a downstream DAG. - - *New in version 2.4.0* + Schedule interval. Defines how often DAG runs, this object gets added to your latest task instance's + execution_date to figure out the next schedule. + discriminator: + propertyName: __type + nullable: true + readOnly: true + SchedulerStatus: + description: The status and the latest scheduler heartbeat. example: - updated_at: updated_at - created_at: created_at - dag_id: dag_id + latest_scheduler_heartbeat: latest_scheduler_heartbeat + status: null properties: - dag_id: - description: The DAG ID that depends on the dataset. + latest_scheduler_heartbeat: + description: The time the scheduler last did a heartbeat. + format: datetime nullable: true + readOnly: true type: string - created_at: - description: The dataset reference creation time - nullable: false - type: string - updated_at: - description: The dataset reference update time - nullable: false - type: string - type: object - DatasetCollection: - allOf: - - $ref: '#/components/schemas/DatasetCollection_allOf' - - $ref: '#/components/schemas/CollectionInfo' - description: | - A collection of datasets. - - *New in version 2.4.0* + status: + $ref: '#/components/schemas/HealthStatus' type: object - DatasetEvent: - description: | - A dataset event. - - *New in version 2.4.0* + SetDagRunNote: + example: + note: note properties: - dataset_id: - description: The dataset id - type: integer - dataset_uri: - description: The URI of the dataset - nullable: false - type: string - extra: - description: The dataset event extra - nullable: true - type: object - source_dag_id: - description: The DAG ID that updated the dataset. - nullable: true - type: string - source_task_id: - description: The task ID that updated the dataset. - nullable: true + note: + description: Custom notes left by users for this Dag Run. type: string - source_run_id: - description: The DAG run ID that updated the dataset. - nullable: true + type: object + SetTaskInstanceNote: + example: + note: note + properties: + note: + description: The custom note to set for this Task Instance. type: string - source_map_index: - description: The task map index that updated the dataset. - nullable: true - type: integer - created_dagruns: - items: - $ref: '#/components/schemas/BasicDAGRun' - type: array - timestamp: - description: The dataset event creation time - nullable: false + required: + - note + type: object + Tag: + description: Tag + example: + name: name + properties: + name: type: string type: object - BasicDAGRun: + Task: + description: | + For details see: + [airflow.models.baseoperator.BaseOperator](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/models/baseoperator/index.html#airflow.models.baseoperator.BaseOperator) + example: + end_date: 2000-01-23T04:56:07.000+00:00 + ui_fgcolor: ui_fgcolor + trigger_rule: all_success + task_display_name: task_display_name + retry_exponential_backoff: true + task_id: task_id + doc_md: doc_md + template_fields: + - template_fields + - template_fields + retry_delay: + seconds: 2 + __type: __type + days: 5 + microseconds: 5 + executor: executor + is_mapped: true + priority_weight: 6.027456183070403 + execution_timeout: + seconds: 2 + __type: __type + days: 5 + microseconds: 5 + start_date: 2000-01-23T04:56:07.000+00:00 + owner: owner + extra_links: + - class_ref: + class_name: class_name + module_path: module_path + - class_ref: + class_name: class_name + module_path: module_path + depends_on_past: true + ui_color: ui_color + pool_slots: 0.8008281904610115 + pool: pool + downstream_task_ids: + - downstream_task_ids + - downstream_task_ids + sub_dag: + dag_display_name: dag_display_name + description: description + owners: + - owners + - owners + fileloc: fileloc + has_task_concurrency_limits: true + max_consecutive_failed_dag_runs: 1 + root_dag_id: root_dag_id + has_import_errors: true + last_pickled: 2000-01-23T04:56:07.000+00:00 + last_parsed_time: 2000-01-23T04:56:07.000+00:00 + next_dagrun_create_after: 2000-01-23T04:56:07.000+00:00 + dag_id: dag_id + scheduler_lock: true + default_view: default_view + next_dagrun_data_interval_end: 2000-01-23T04:56:07.000+00:00 + next_dagrun_data_interval_start: 2000-01-23T04:56:07.000+00:00 + is_active: true + last_expired: 2000-01-23T04:56:07.000+00:00 + max_active_runs: 0 + file_token: file_token + max_active_tasks: 6 + pickle_id: pickle_id + tags: + - name: name + - name: name + timetable_description: timetable_description + is_paused: true + schedule_interval: + seconds: 2 + __type: __type + days: 5 + microseconds: 5 + is_subdag: true + next_dagrun: 2000-01-23T04:56:07.000+00:00 + retries: 1.4658129805029452 + wait_for_downstream: true + class_ref: + class_name: class_name + module_path: module_path + queue: queue + weight_rule: downstream properties: - run_id: - description: | - Run ID. - type: string - dag_id: + class_ref: + $ref: '#/components/schemas/ClassReference' + depends_on_past: readOnly: true - type: string - logical_date: - description: | - The logical date (previously called execution date). This is the time or interval covered by - this DAG run, according to the DAG definition. - - The value of this field can be set only when creating the object. If you try to modify the - field of an existing object, the request fails with an BAD_REQUEST error. - - This together with DAG_ID are a unique key. - - *New in version 2.2.0* - format: date-time - type: string - start_date: + type: boolean + doc_md: description: | - The start time. The time when DAG run was actually created. + Task documentation in markdown. - *Changed in version 2.1.3*: Field becomes nullable. - format: date-time + *New in version 2.10.0* nullable: true readOnly: true type: string + downstream_task_ids: + items: + type: string + readOnly: true + type: array end_date: format: date-time nullable: true readOnly: true type: string - data_interval_start: - format: date-time + execution_timeout: + $ref: '#/components/schemas/TimeDelta' + executor: nullable: true readOnly: true type: string - data_interval_end: - format: date-time - nullable: true + extra_links: + items: + $ref: '#/components/schemas/Task_extra_links_inner' readOnly: true - type: string - state: - $ref: '#/components/schemas/DagState' - type: object - DatasetEventCollection: - allOf: - - $ref: '#/components/schemas/DatasetEventCollection_allOf' - - $ref: '#/components/schemas/CollectionInfo' - description: | - A collection of dataset events. - - *New in version 2.4.0* - type: object - ConfigOption: - description: The option of configuration. - example: - value: value - key: key - properties: - key: + type: array + is_mapped: readOnly: true - type: string - value: + type: boolean + owner: readOnly: true type: string - type: object - ConfigSection: - description: The section of configuration. - example: - name: name - options: - - value: value - key: key - - value: value - key: key - properties: - name: + pool: readOnly: true type: string - options: - items: - $ref: '#/components/schemas/ConfigOption' - type: array - type: object - Config: - description: The configuration. - example: - sections: - - name: name - options: - - value: value - key: key - - value: value - key: key - - name: name - options: - - value: value - key: key - - value: value - key: key - properties: - sections: - items: - $ref: '#/components/schemas/ConfigSection' - type: array - type: object - VersionInfo: - description: Version information. - example: - git_version: git_version - version: version - properties: - version: - description: The version of Airflow - type: string - git_version: - description: The git version (including git commit hash) + pool_slots: + readOnly: true + type: number + priority_weight: + readOnly: true + type: number + queue: nullable: true + readOnly: true type: string - type: object - ClearDagRun: - example: - dry_run: true - properties: - dry_run: - default: true - description: | - If set, don't actually run this operation. The response will contain a list of task instances - planned to be cleaned, but not modified in any way. - type: boolean - type: object - ClearTaskInstances: - example: - end_date: end_date - include_future: false - include_past: false - reset_dag_runs: true - include_parentdag: true - include_subdags: true - task_ids: - - task_ids - - task_ids - include_downstream: false - only_running: false - dag_run_id: dag_run_id - include_upstream: false - dry_run: true - only_failed: true - start_date: start_date - properties: - dry_run: - default: true - description: | - If set, don't actually run this operation. The response will contain a list of task instances - planned to be cleaned, but not modified in any way. + retries: + readOnly: true + type: number + retry_delay: + $ref: '#/components/schemas/TimeDelta' + retry_exponential_backoff: + readOnly: true type: boolean - task_ids: - description: | - A list of task ids to clear. - - *New in version 2.1.0* - items: - type: string - minItems: 1 - type: array start_date: - description: The minimum execution date to clear. - format: datetime - type: string - end_date: - description: The maximum execution date to clear. - format: datetime - type: string - only_failed: - default: true - description: Only clear failed tasks. - type: boolean - only_running: - default: false - description: Only clear running tasks. - type: boolean - include_subdags: - description: Clear tasks in subdags and clear external tasks indicated by - ExternalTaskMarker. - type: boolean - include_parentdag: - description: Clear tasks in the parent dag of the subdag. - type: boolean - reset_dag_runs: - description: Set state of DAG runs to RUNNING. - type: boolean - dag_run_id: - description: The DagRun ID for this task instance + format: date-time nullable: true + readOnly: true type: string - include_upstream: - default: false - description: If set to true, upstream tasks are also affected. - type: boolean - include_downstream: - default: false - description: If set to true, downstream tasks are also affected. - type: boolean - include_future: - default: false - description: If set to True, also tasks from future DAG Runs are affected. - type: boolean - include_past: - default: false - description: If set to True, also tasks from past DAG Runs are affected. - type: boolean - type: object - UpdateTaskInstancesState: - example: - include_future: true - include_past: true - execution_date: execution_date - dag_run_id: dag_run_id - include_upstream: true - new_state: success - dry_run: true - task_id: task_id - include_downstream: true - properties: - dry_run: - default: true - description: | - If set, don't actually run this operation. The response will contain a list of task instances - planned to be affected, but won't be modified in any way. - type: boolean - task_id: - description: The task ID. + sub_dag: + $ref: '#/components/schemas/DAG' + task_display_name: + readOnly: true type: string - execution_date: - description: The execution date. Either set this or dag_run_id but not both. - format: datetime + task_id: + readOnly: true type: string - dag_run_id: - description: | - The task instance's DAG run ID. Either set this or execution_date but not both. - - *New in version 2.3.0* + template_fields: + items: + type: string + readOnly: true + type: array + trigger_rule: + $ref: '#/components/schemas/TriggerRule' + ui_color: + description: Color in hexadecimal notation. + pattern: "^#[a-fA-F0-9]{3,6}$" type: string - include_upstream: - description: If set to true, upstream tasks are also affected. - type: boolean - include_downstream: - description: If set to true, downstream tasks are also affected. - type: boolean - include_future: - description: If set to True, also tasks from future DAG Runs are affected. - type: boolean - include_past: - description: If set to True, also tasks from past DAG Runs are affected. - type: boolean - new_state: - description: Expected new state. - enum: - - success - - failed + ui_fgcolor: + description: Color in hexadecimal notation. + pattern: "^#[a-fA-F0-9]{3,6}$" type: string + wait_for_downstream: + readOnly: true + type: boolean + weight_rule: + $ref: '#/components/schemas/WeightRule' type: object - UpdateTaskInstance: + TaskCollection: + description: Collection of tasks. example: - new_state: success - dry_run: false + tasks: + - end_date: 2000-01-23T04:56:07.000+00:00 + ui_fgcolor: ui_fgcolor + trigger_rule: all_success + task_display_name: task_display_name + retry_exponential_backoff: true + task_id: task_id + doc_md: doc_md + template_fields: + - template_fields + - template_fields + retry_delay: + seconds: 2 + __type: __type + days: 5 + microseconds: 5 + executor: executor + is_mapped: true + priority_weight: 6.027456183070403 + execution_timeout: + seconds: 2 + __type: __type + days: 5 + microseconds: 5 + start_date: 2000-01-23T04:56:07.000+00:00 + owner: owner + extra_links: + - class_ref: + class_name: class_name + module_path: module_path + - class_ref: + class_name: class_name + module_path: module_path + depends_on_past: true + ui_color: ui_color + pool_slots: 0.8008281904610115 + pool: pool + downstream_task_ids: + - downstream_task_ids + - downstream_task_ids + sub_dag: + dag_display_name: dag_display_name + description: description + owners: + - owners + - owners + fileloc: fileloc + has_task_concurrency_limits: true + max_consecutive_failed_dag_runs: 1 + root_dag_id: root_dag_id + has_import_errors: true + last_pickled: 2000-01-23T04:56:07.000+00:00 + last_parsed_time: 2000-01-23T04:56:07.000+00:00 + next_dagrun_create_after: 2000-01-23T04:56:07.000+00:00 + dag_id: dag_id + scheduler_lock: true + default_view: default_view + next_dagrun_data_interval_end: 2000-01-23T04:56:07.000+00:00 + next_dagrun_data_interval_start: 2000-01-23T04:56:07.000+00:00 + is_active: true + last_expired: 2000-01-23T04:56:07.000+00:00 + max_active_runs: 0 + file_token: file_token + max_active_tasks: 6 + pickle_id: pickle_id + tags: + - name: name + - name: name + timetable_description: timetable_description + is_paused: true + schedule_interval: + seconds: 2 + __type: __type + days: 5 + microseconds: 5 + is_subdag: true + next_dagrun: 2000-01-23T04:56:07.000+00:00 + retries: 1.4658129805029452 + wait_for_downstream: true + class_ref: + class_name: class_name + module_path: module_path + queue: queue + weight_rule: downstream + - end_date: 2000-01-23T04:56:07.000+00:00 + ui_fgcolor: ui_fgcolor + trigger_rule: all_success + task_display_name: task_display_name + retry_exponential_backoff: true + task_id: task_id + doc_md: doc_md + template_fields: + - template_fields + - template_fields + retry_delay: + seconds: 2 + __type: __type + days: 5 + microseconds: 5 + executor: executor + is_mapped: true + priority_weight: 6.027456183070403 + execution_timeout: + seconds: 2 + __type: __type + days: 5 + microseconds: 5 + start_date: 2000-01-23T04:56:07.000+00:00 + owner: owner + extra_links: + - class_ref: + class_name: class_name + module_path: module_path + - class_ref: + class_name: class_name + module_path: module_path + depends_on_past: true + ui_color: ui_color + pool_slots: 0.8008281904610115 + pool: pool + downstream_task_ids: + - downstream_task_ids + - downstream_task_ids + sub_dag: + dag_display_name: dag_display_name + description: description + owners: + - owners + - owners + fileloc: fileloc + has_task_concurrency_limits: true + max_consecutive_failed_dag_runs: 1 + root_dag_id: root_dag_id + has_import_errors: true + last_pickled: 2000-01-23T04:56:07.000+00:00 + last_parsed_time: 2000-01-23T04:56:07.000+00:00 + next_dagrun_create_after: 2000-01-23T04:56:07.000+00:00 + dag_id: dag_id + scheduler_lock: true + default_view: default_view + next_dagrun_data_interval_end: 2000-01-23T04:56:07.000+00:00 + next_dagrun_data_interval_start: 2000-01-23T04:56:07.000+00:00 + is_active: true + last_expired: 2000-01-23T04:56:07.000+00:00 + max_active_runs: 0 + file_token: file_token + max_active_tasks: 6 + pickle_id: pickle_id + tags: + - name: name + - name: name + timetable_description: timetable_description + is_paused: true + schedule_interval: + seconds: 2 + __type: __type + days: 5 + microseconds: 5 + is_subdag: true + next_dagrun: 2000-01-23T04:56:07.000+00:00 + retries: 1.4658129805029452 + wait_for_downstream: true + class_ref: + class_name: class_name + module_path: module_path + queue: queue + weight_rule: downstream properties: - dry_run: - default: false - description: | - If set, don't actually run this operation. The response will contain the task instance - planned to be affected, but won't be modified in any way. - type: boolean - new_state: - description: Expected new state. - enum: - - success - - failed - type: string + tasks: + items: + $ref: '#/components/schemas/Task' + type: array type: object - SetTaskInstanceNote: + TaskFailedDependency: example: - note: note + reason: reason + name: name properties: - note: - description: The custom note to set for this Task Instance. + name: + type: string + reason: type: string - required: - - note type: object - ListDagRunsForm: + TaskInstance: example: - start_date_gte: 2000-01-23T04:56:07.000+00:00 - end_date_lte: 2000-01-23T04:56:07.000+00:00 - execution_date_gte: 2000-01-23T04:56:07.000+00:00 - page_limit: 1 - execution_date_lte: 2000-01-23T04:56:07.000+00:00 - order_by: order_by - page_offset: 0 - end_date_gte: 2000-01-23T04:56:07.000+00:00 - start_date_lte: 2000-01-23T04:56:07.000+00:00 - dag_ids: - - dag_ids - - dag_ids - states: - - states - - states - properties: - order_by: - description: | - The name of the field to order the results by. Prefix a field name - with `-` to reverse the sort order. - - *New in version 2.1.0* - type: string - page_offset: - description: The number of items to skip before starting to collect the - result set. - minimum: 0 - type: integer - page_limit: - default: 100 - description: The numbers of items to return. - minimum: 1 - type: integer - dag_ids: - description: |- - Return objects with specific DAG IDs. - The value can be repeated to retrieve multiple matching values (OR condition). - items: - type: string - type: array - states: - description: |- - Return objects with specific states. - The value can be repeated to retrieve multiple matching values (OR condition). - items: - type: string - type: array - execution_date_gte: - description: | - Returns objects greater or equal to the specified date. - - This can be combined with execution_date_lte key to receive only the selected period. - format: date-time + end_date: end_date + note: note + unixname: unixname + rendered_fields: "{}" + task_display_name: task_display_name + pid: 5 + task_id: task_id + operator: operator + rendered_map_index: rendered_map_index + sla_miss: + notification_sent: true + email_sent: true + execution_date: execution_date + description: description + task_id: task_id + dag_id: dag_id + timestamp: timestamp + duration: 0.8008281904610115 + hostname: hostname + executor: executor + dag_id: dag_id + state: null + priority_weight: 2 + queued_when: queued_when + start_date: start_date + triggerer_job: + end_date: end_date + job_type: job_type + unixname: unixname + hostname: hostname + latest_heartbeat: latest_heartbeat + dag_id: dag_id + id: 3 + state: state + executor_class: executor_class + start_date: start_date + execution_date: execution_date + pool_slots: 5 + pool: pool + map_index: 6 + max_tries: 1 + trigger: + classpath: classpath + kwargs: kwargs + created_date: created_date + id: 7 + triggerer_id: 9 + executor_config: executor_config + dag_run_id: dag_run_id + try_number: 2 + queue: queue + properties: + dag_id: type: string - execution_date_lte: + dag_run_id: description: | - Returns objects less than or equal to the specified date. + The DagRun ID for this task instance - This can be combined with execution_date_gte key to receive only the selected period. - format: date-time + *New in version 2.3.0* type: string - start_date_gte: - description: | - Returns objects greater or equal the specified date. - - This can be combined with start_date_lte key to receive only the selected period. - format: date-time + duration: + nullable: true + type: number + end_date: + format: datetime + nullable: true type: string - start_date_lte: + execution_date: + format: datetime + type: string + executor: description: | - Returns objects less or equal the specified date. + Executor the task is configured to run on or None (which indicates the default executor) - This can be combined with start_date_gte parameter to receive only the selected period - format: date-time + *New in version 2.10.0* + nullable: true type: string - end_date_gte: + executor_config: + type: string + hostname: + type: string + map_index: + type: integer + max_tries: + type: integer + note: description: | - Returns objects greater or equal the specified date. + Contains manually entered notes by the user about the TaskInstance. - This can be combined with end_date_lte parameter to receive only the selected period. - format: date-time + *New in version 2.5.0* + nullable: true type: string - end_date_lte: + operator: description: | - Returns objects less than or equal to the specified date. - - This can be combined with end_date_gte parameter to receive only the selected period. - format: date-time + *Changed in version 2.1.1*: Field becomes nullable. + nullable: true type: string - type: object - ListTaskInstanceForm: - example: - start_date_gte: 2000-01-23T04:56:07.000+00:00 - end_date_lte: 2000-01-23T04:56:07.000+00:00 - execution_date_gte: 2000-01-23T04:56:07.000+00:00 - duration_gte: 0.8008281904610115 - execution_date_lte: 2000-01-23T04:56:07.000+00:00 + pid: + nullable: true + type: integer pool: - - pool - - pool - duration_lte: 6.027456183070403 - end_date_gte: 2000-01-23T04:56:07.000+00:00 - state: - - null - - null - start_date_lte: 2000-01-23T04:56:07.000+00:00 - dag_ids: - - dag_ids - - dag_ids + type: string + pool_slots: + type: integer + priority_weight: + nullable: true + type: integer queue: - - queue - - queue - properties: - dag_ids: - description: |- - Return objects with specific DAG IDs. - The value can be repeated to retrieve multiple matching values (OR condition). - items: - type: string - type: array - execution_date_gte: - description: | - Returns objects greater or equal to the specified date. - - This can be combined with execution_date_lte parameter to receive only the selected period. - format: date-time + nullable: true type: string - execution_date_lte: + queued_when: description: | - Returns objects less than or equal to the specified date. - - This can be combined with execution_date_gte parameter to receive only the selected period. - format: date-time + The datetime that the task enter the state QUEUE, also known as queue_at + nullable: true type: string - start_date_gte: + rendered_fields: description: | - Returns objects greater or equal the specified date. + JSON object describing rendered fields. - This can be combined with start_date_lte parameter to receive only the selected period. - format: date-time - type: string - start_date_lte: + *New in version 2.3.0* + type: object + rendered_map_index: description: | - Returns objects less or equal the specified date. + Rendered name of an expanded task instance, if the task is mapped. - This can be combined with start_date_gte parameter to receive only the selected period. - format: date-time + *New in version 2.9.0* + nullable: true type: string - end_date_gte: - description: | - Returns objects greater or equal the specified date. - - This can be combined with start_date_lte parameter to receive only the selected period. - format: date-time + sla_miss: + $ref: '#/components/schemas/SLAMiss' + start_date: + format: datetime + nullable: true type: string - end_date_lte: + state: + $ref: '#/components/schemas/TaskState' + task_display_name: description: | - Returns objects less than or equal to the specified date. + Human centric display text for the task. - This can be combined with start_date_gte parameter to receive only the selected period. - format: date-time + *New in version 2.9.0* + type: string + task_id: + type: string + trigger: + $ref: '#/components/schemas/Trigger' + triggerer_job: + $ref: '#/components/schemas/Job' + try_number: + type: integer + unixname: type: string - duration_gte: - description: | - Returns objects greater than or equal to the specified values. - - This can be combined with duration_lte parameter to receive only the selected period. - type: number - duration_lte: - description: | - Returns objects less than or equal to the specified values. - - This can be combined with duration_gte parameter to receive only the selected range. - type: number - state: - description: The value can be repeated to retrieve multiple matching values - (OR condition). - items: - $ref: '#/components/schemas/TaskState' - type: array - pool: - description: The value can be repeated to retrieve multiple matching values - (OR condition). - items: - type: string - type: array - queue: - description: The value can be repeated to retrieve multiple matching values - (OR condition). - items: - type: string - type: array type: object - ScheduleInterval: - anyOf: - - $ref: '#/components/schemas/TimeDelta' - - $ref: '#/components/schemas/RelativeDelta' - - $ref: '#/components/schemas/CronExpression' + TaskInstanceCollection: + allOf: + - properties: + task_instances: + items: + $ref: '#/components/schemas/TaskInstance' + type: array + type: object + - $ref: '#/components/schemas/CollectionInfo' description: | - Schedule interval. Defines how often DAG runs, this object gets added to your latest task instance's - execution_date to figure out the next schedule. - discriminator: - propertyName: __type - nullable: true - readOnly: true - TimeDelta: - description: Time delta + Collection of task instances. + + *Changed in version 2.1.0*: 'total_entries' field is added. example: - seconds: 5 - __type: __type - days: 1 - microseconds: 5 - properties: - __type: - type: string - days: - type: integer - seconds: - type: integer - microseconds: - type: integer - required: - - __type - - days - - microseconds - - seconds + task_instances: + - end_date: end_date + note: note + unixname: unixname + rendered_fields: "{}" + task_display_name: task_display_name + pid: 5 + task_id: task_id + operator: operator + rendered_map_index: rendered_map_index + sla_miss: + notification_sent: true + email_sent: true + execution_date: execution_date + description: description + task_id: task_id + dag_id: dag_id + timestamp: timestamp + duration: 0.8008281904610115 + hostname: hostname + executor: executor + dag_id: dag_id + state: null + priority_weight: 2 + queued_when: queued_when + start_date: start_date + triggerer_job: + end_date: end_date + job_type: job_type + unixname: unixname + hostname: hostname + latest_heartbeat: latest_heartbeat + dag_id: dag_id + id: 3 + state: state + executor_class: executor_class + start_date: start_date + execution_date: execution_date + pool_slots: 5 + pool: pool + map_index: 6 + max_tries: 1 + trigger: + classpath: classpath + kwargs: kwargs + created_date: created_date + id: 7 + triggerer_id: 9 + executor_config: executor_config + dag_run_id: dag_run_id + try_number: 2 + queue: queue + - end_date: end_date + note: note + unixname: unixname + rendered_fields: "{}" + task_display_name: task_display_name + pid: 5 + task_id: task_id + operator: operator + rendered_map_index: rendered_map_index + sla_miss: + notification_sent: true + email_sent: true + execution_date: execution_date + description: description + task_id: task_id + dag_id: dag_id + timestamp: timestamp + duration: 0.8008281904610115 + hostname: hostname + executor: executor + dag_id: dag_id + state: null + priority_weight: 2 + queued_when: queued_when + start_date: start_date + triggerer_job: + end_date: end_date + job_type: job_type + unixname: unixname + hostname: hostname + latest_heartbeat: latest_heartbeat + dag_id: dag_id + id: 3 + state: state + executor_class: executor_class + start_date: start_date + execution_date: execution_date + pool_slots: 5 + pool: pool + map_index: 6 + max_tries: 1 + trigger: + classpath: classpath + kwargs: kwargs + created_date: created_date + id: 7 + triggerer_id: 9 + executor_config: executor_config + dag_run_id: dag_run_id + try_number: 2 + queue: queue + total_entries: 4 type: object - RelativeDelta: - description: Relative delta + TaskInstanceDependencyCollection: + example: + dependencies: + - reason: reason + name: name + - reason: reason + name: name properties: - __type: + dependencies: + items: + $ref: '#/components/schemas/TaskFailedDependency' + type: array + type: object + TaskInstanceHistory: + example: + end_date: end_date + unixname: unixname + pool_slots: 5 + task_display_name: task_display_name + pool: pool + map_index: 6 + pid: 5 + task_id: task_id + max_tries: 1 + operator: operator + duration: 0.8008281904610115 + hostname: hostname + executor_config: executor_config + executor: executor + dag_run_id: dag_run_id + try_number: 7 + dag_id: dag_id + state: null + priority_weight: 2 + queue: queue + queued_when: queued_when + start_date: start_date + properties: + dag_id: type: string - years: - type: integer - months: - type: integer - days: - type: integer - leapdays: - type: integer - hours: - type: integer - minutes: - type: integer - seconds: - type: integer - microseconds: - type: integer - year: - type: integer - month: - type: integer - day: + dag_run_id: + description: | + The DagRun ID for this task instance + + *New in version 2.3.0* + type: string + duration: + nullable: true + type: number + end_date: + format: datetime + nullable: true + type: string + executor: + description: | + Executor the task is configured to run on or None (which indicates the default executor) + + *New in version 2.10.0* + nullable: true + type: string + executor_config: + type: string + hostname: + type: string + map_index: type: integer - hour: + max_tries: type: integer - minute: + operator: + description: | + *Changed in version 2.1.1*: Field becomes nullable. + nullable: true + type: string + pid: + nullable: true type: integer - second: + pool: + type: string + pool_slots: type: integer - microsecond: + priority_weight: + nullable: true type: integer - required: - - __type - - day - - days - - hour - - hours - - leapdays - - microsecond - - microseconds - - minute - - minutes - - month - - months - - second - - seconds - - year - - years - type: object - CronExpression: - description: Cron expression - nullable: true - properties: - __type: + queue: + nullable: true type: string - value: + queued_when: + description: | + The datetime that the task enter the state QUEUE, also known as queue_at + nullable: true + type: string + start_date: + format: datetime + nullable: true + type: string + state: + $ref: '#/components/schemas/TaskState' + task_display_name: + description: | + Human centric display text for the task. + + *New in version 2.9.0* + type: string + task_id: + type: string + try_number: + type: integer + unixname: type: string - required: - - __type - - value type: object - Timezone: - type: string - Tag: - description: Tag + TaskInstanceHistoryCollection: + allOf: + - properties: + task_instances_history: + items: + $ref: '#/components/schemas/TaskInstanceHistory' + type: array + type: object + - $ref: '#/components/schemas/CollectionInfo' + description: | + Collection of task instances . + + *Changed in version 2.1.0*: 'total_entries' field is added. example: - name: name - properties: - name: - type: string + total_entries: 9 + task_instances_history: + - end_date: end_date + unixname: unixname + pool_slots: 5 + task_display_name: task_display_name + pool: pool + map_index: 6 + pid: 5 + task_id: task_id + max_tries: 1 + operator: operator + duration: 0.8008281904610115 + hostname: hostname + executor_config: executor_config + executor: executor + dag_run_id: dag_run_id + try_number: 7 + dag_id: dag_id + state: null + priority_weight: 2 + queue: queue + queued_when: queued_when + start_date: start_date + - end_date: end_date + unixname: unixname + pool_slots: 5 + task_display_name: task_display_name + pool: pool + map_index: 6 + pid: 5 + task_id: task_id + max_tries: 1 + operator: operator + duration: 0.8008281904610115 + hostname: hostname + executor_config: executor_config + executor: executor + dag_run_id: dag_run_id + try_number: 7 + dag_id: dag_id + state: null + priority_weight: 2 + queue: queue + queued_when: queued_when + start_date: start_date type: object - Color: - description: Color in hexadecimal notation. - pattern: ^#[a-fA-F0-9]{3,6}$ - type: string - ClassReference: - description: Class reference + TaskInstanceReference: example: - class_name: class_name - module_path: module_path + execution_date: execution_date + dag_run_id: dag_run_id + task_id: task_id + dag_id: dag_id properties: - module_path: + dag_id: + description: The DAG ID. readOnly: true type: string - class_name: + dag_run_id: + description: The DAG run ID. + readOnly: true + type: string + execution_date: + format: datetime + readOnly: true + type: string + task_id: + description: The task ID. readOnly: true type: string type: object - Error: + TaskInstanceReferenceCollection: + example: + task_instances: + - execution_date: execution_date + dag_run_id: dag_run_id + task_id: task_id + dag_id: dag_id + - execution_date: execution_date + dag_run_id: dag_run_id + task_id: task_id + dag_id: dag_id + properties: + task_instances: + items: + $ref: '#/components/schemas/TaskInstanceReference' + type: array + type: object + TaskOutletDatasetReference: description: | - [RFC7807](https://tools.ietf.org/html/rfc7807) compliant response. + A datasets reference to an upstream task. + + *New in version 2.4.0* + example: + updated_at: updated_at + created_at: created_at + task_id: task_id + dag_id: dag_id properties: - type: - description: | - A URI reference [RFC3986] that identifies the problem type. This specification - encourages that, when dereferenced, it provide human-readable documentation for - the problem type. - type: string - title: - description: A short, human-readable summary of the problem type. - type: string - status: - description: The HTTP status code generated by the API server for this occurrence - of the problem. - type: number - detail: - description: A human-readable explanation specific to this occurrence of - the problem. + created_at: + description: The dataset creation time + nullable: false type: string - instance: - description: | - A URI reference that identifies the specific occurrence of the problem. It may or may - not yield further information if dereferenced. + dag_id: + description: The DAG ID that updates the dataset. + nullable: true + type: string + task_id: + description: The task ID that updates the dataset. + nullable: true + type: string + updated_at: + description: The dataset update time + nullable: false type: string - required: - - status - - title - - type - type: object - CollectionInfo: - description: Metadata about collection. - properties: - total_entries: - description: Count of objects in the current result set. - type: integer type: object TaskState: description: | @@ -7750,7 +10348,11 @@ components: *Changed in version 2.4.0*: 'sensing' state has been removed. *Changed in version 2.4.2*: 'restarting' is added as a possible value + + *Changed in version 2.7.0*: Field becomes nullable and null primitive is added as a possible value. + *Changed in version 2.7.0*: 'none' state is deprecated in favor of null. enum: + - null - success - running - failed @@ -7764,305 +10366,552 @@ components: - deferred - removed - restarting + nullable: true type: string - DagState: - description: | - DAG State. - - *Changed in version 2.1.3*: 'queued' is added as a possible value. - enum: - - queued - - running - - success - - failed + TimeDelta: + description: Time delta + example: + seconds: 2 + __type: __type + days: 5 + microseconds: 5 + nullable: true + properties: + __type: + type: string + days: + type: integer + microseconds: + type: integer + seconds: + type: integer + required: + - __type + - days + - microseconds + - seconds + type: object + Timezone: type: string + Trigger: + example: + classpath: classpath + kwargs: kwargs + created_date: created_date + id: 7 + triggerer_id: 9 + nullable: true + properties: + classpath: + type: string + created_date: + format: datetime + type: string + id: + type: integer + kwargs: + type: string + triggerer_id: + nullable: true + type: integer + type: object TriggerRule: description: | Trigger rule. - *Changed in version 2.2.0*: 'none_failed_min_one_success' is added as a possible value. + *Changed in version 2.2.0*: 'none_failed_min_one_success' is added as a possible value. Deprecated 'dummy' and 'always' is added as a possible value + + *Changed in version 2.3.0*: 'all_skipped' is added as a possible value. + + *Changed in version 2.5.0*: 'one_done' is added as a possible value. + + *Changed in version 2.7.0*: 'all_done_setup_success' is added as a possible value. enum: - all_success - all_failed - all_done + - all_done_setup_success - one_success - one_failed + - one_done - none_failed - none_skipped - none_failed_or_skipped - none_failed_min_one_success - dummy + - all_skipped + - always type: string - WeightRule: - description: Weight rule. - enum: - - downstream - - upstream - - absolute - type: string - HealthStatus: - description: Health status - enum: - - healthy - - unhealthy - type: string - inline_response_200: + TriggererStatus: + description: | + The status and the latest triggerer heartbeat. + + *New in version 2.6.2* example: - continuation_token: continuation_token - content: content + latest_triggerer_heartbeat: latest_triggerer_heartbeat + status: null properties: - continuation_token: - type: string - content: + latest_triggerer_heartbeat: + description: The time the triggerer last did a heartbeat. + format: datetime + nullable: true + readOnly: true type: string + status: + $ref: '#/components/schemas/HealthStatus' type: object - inline_response_200_1: + UpdateDagRunState: + description: | + Modify the state of a DAG run. + + *New in version 2.2.0* example: - content: content + state: success properties: - content: + state: + description: The state to set this DagRun + enum: + - success + - failed + - queued type: string type: object - UserCollectionItem_roles: + UpdateTaskInstance: example: - name: name - nullable: true - properties: - name: - type: string - type: object - User_allOf: - properties: - password: - type: string - writeOnly: true - type: object - UserCollection_allOf: - properties: - users: - items: - $ref: '#/components/schemas/UserCollectionItem' - type: array - type: object - ConnectionCollection_allOf: + new_state: success + dry_run: true properties: - connections: - items: - $ref: '#/components/schemas/ConnectionCollectionItem' - type: array + dry_run: + default: true + description: | + If set, don't actually run this operation. The response will contain the task instance + planned to be affected, but won't be modified in any way. + type: boolean + new_state: + $ref: '#/components/schemas/UpdateTaskState' type: object - Connection_allOf: + UpdateTaskInstancesState: + example: + include_future: true + include_past: true + execution_date: execution_date + dag_run_id: dag_run_id + include_upstream: true + new_state: success + dry_run: true + task_id: task_id + include_downstream: true properties: - password: - description: Password of the connection. - format: password + dag_run_id: + description: | + The task instance's DAG run ID. Either set this or execution_date but not both. + + *New in version 2.3.0* type: string - writeOnly: true - extra: - description: Other values that cannot be put into another field, e.g. RSA - keys. - nullable: true + dry_run: + default: true + description: | + If set, don't actually run this operation. The response will contain a list of task instances + planned to be affected, but won't be modified in any way. + type: boolean + execution_date: + description: The execution date. Either set this or dag_run_id but not both. + format: datetime type: string - type: object - DAGCollection_allOf: - properties: - dags: - items: - $ref: '#/components/schemas/DAG' - type: array - type: object - DAGRunCollection_allOf: - properties: - dag_runs: - items: - $ref: '#/components/schemas/DAGRun' - type: array - type: object - DagWarningCollection_allOf: - properties: - import_errors: - items: - $ref: '#/components/schemas/DagWarning' - type: array - type: object - EventLogCollection_allOf: - properties: - event_logs: - items: - $ref: '#/components/schemas/EventLog' - type: array - type: object - ImportErrorCollection_allOf: - properties: - import_errors: - items: - $ref: '#/components/schemas/ImportError' - type: array - type: object - PoolCollection_allOf: - properties: - pools: - items: - $ref: '#/components/schemas/Pool' - type: array - type: object - TaskInstanceCollection_allOf: - properties: - task_instances: - items: - $ref: '#/components/schemas/TaskInstance' - type: array - type: object - VariableCollection_allOf: - properties: - variables: - items: - $ref: '#/components/schemas/VariableCollectionItem' - type: array - type: object - Variable_allOf: - properties: - value: + include_downstream: + description: "If set to true, downstream tasks are also affected." + type: boolean + include_future: + description: "If set to True, also tasks from future DAG Runs are affected." + type: boolean + include_past: + description: "If set to True, also tasks from past DAG Runs are affected." + type: boolean + include_upstream: + description: "If set to true, upstream tasks are also affected." + type: boolean + new_state: + $ref: '#/components/schemas/UpdateTaskState' + task_id: + description: The task ID. type: string type: object - XComCollection_allOf: - properties: - xcom_entries: - items: - $ref: '#/components/schemas/XComCollectionItem' - type: array + UpdateTaskState: + description: | + Expected new state. Only a subset of TaskState are available. + + Other states are managed directly by the scheduler or the workers and cannot be updated manually through the REST API. + enum: + - success + - failed + - skipped + type: string + User: + allOf: + - $ref: '#/components/schemas/UserCollectionItem' + - properties: + password: + type: string + writeOnly: true + type: object + description: | + A user object with sensitive data. + + *New in version 2.1.0* + example: + failed_login_count: 0 + login_count: 6 + password: password + created_on: created_on + last_login: last_login + roles: + - name: name + - name: name + active: true + last_name: last_name + first_name: first_name + changed_on: changed_on + email: email + username: username type: object - XCom_allOf: - properties: - value: - description: The value - type: string + UserCollection: + allOf: + - properties: + users: + items: + $ref: '#/components/schemas/UserCollectionItem' + type: array + type: object + - $ref: '#/components/schemas/CollectionInfo' + description: | + Collection of users. + + *New in version 2.1.0* + example: + users: + - failed_login_count: 0 + login_count: 6 + created_on: created_on + last_login: last_login + roles: + - name: name + - name: name + active: true + last_name: last_name + first_name: first_name + changed_on: changed_on + email: email + username: username + - failed_login_count: 0 + login_count: 6 + created_on: created_on + last_login: last_login + roles: + - name: name + - name: name + active: true + last_name: last_name + first_name: first_name + changed_on: changed_on + email: email + username: username + total_entries: 1 type: object - DAGDetail_allOf: + UserCollectionItem: + description: | + A user object. + + *New in version 2.1.0* + example: + failed_login_count: 0 + login_count: 6 + created_on: created_on + last_login: last_login + roles: + - name: name + - name: name + active: true + last_name: last_name + first_name: first_name + changed_on: changed_on + email: email + username: username properties: - timezone: - type: string - catchup: + active: + description: Whether the user is active + nullable: true readOnly: true type: boolean - orientation: - readOnly: true - type: string - concurrency: - readOnly: true - type: number - start_date: - description: | - The DAG's start date. - - *Changed in version 2.0.1*: Field becomes nullable. - format: date-time + changed_on: + description: The date user was changed + format: datetime nullable: true readOnly: true type: string - dag_run_timeout: - $ref: '#/components/schemas/TimeDelta' - doc_md: + created_on: + description: The date user was created + format: datetime nullable: true readOnly: true type: string - default_view: - readOnly: true - type: string - params: + email: description: | - User-specified DAG params. + The user's email. - *New in version 2.0.1* + *Changed in version 2.2.0*: A minimum character length requirement ('minLength') is added. + minLength: 1 + type: string + failed_login_count: + description: The number of times the login failed + nullable: true readOnly: true - type: object - end_date: + type: integer + first_name: description: | - The DAG's end date. + The user's first name. - *New in version 2.3.0*. - format: date-time + *Changed in version 2.4.0*: The requirement for this to be non-empty was removed. + type: string + last_login: + description: The last user login + format: datetime nullable: true readOnly: true type: string - is_paused_upon_creation: + last_name: description: | - Whether the DAG is paused upon creation. + The user's last name. - *New in version 2.3.0* + *Changed in version 2.4.0*: The requirement for this to be non-empty was removed. + type: string + login_count: + description: The login count nullable: true readOnly: true - type: boolean - last_parsed: + type: integer + roles: description: | - The last time the DAG was parsed. + User roles. - *New in version 2.3.0* - format: date-time - nullable: true - readOnly: true - type: string - template_search_path: + *Changed in version 2.2.0*: Field is no longer read-only. + items: + $ref: '#/components/schemas/UserCollectionItem_roles_inner' + type: array + username: description: | - The template search path. + The username. - *New in version 2.3.0* - items: + *Changed in version 2.2.0*: A minimum character length requirement ('minLength') is added. + minLength: 1 + type: string + type: object + Variable: + allOf: + - $ref: '#/components/schemas/VariableCollectionItem' + - properties: + value: type: string - nullable: true - type: array - render_template_as_native_obj: + type: object + description: Full representation of Variable + example: + description: description + value: value + key: key + VariableCollection: + allOf: + - properties: + variables: + items: + $ref: '#/components/schemas/VariableCollectionItem' + type: array + type: object + - $ref: '#/components/schemas/CollectionInfo' + description: | + Collection of variables. + + *Changed in version 2.1.0*: 'total_entries' field is added. + example: + variables: + - description: description + key: key + - description: description + key: key + total_entries: 0 + type: object + VariableCollectionItem: + description: |- + XCom entry collection item. + The value field are only available when retrieving a single object due to the sensitivity of this data. + example: + description: description + key: key + properties: + description: description: | - Whether to render templates as native Python objects. + The description of the variable. - *New in version 2.3.0* + *New in version 2.4.0* nullable: true - readOnly: true - type: boolean + type: string + key: + type: string type: object - Task_extra_links: + VersionInfo: + description: Version information. example: - class_ref: - class_name: class_name - module_path: module_path + git_version: git_version + version: version properties: - class_ref: - $ref: '#/components/schemas/ClassReference' + git_version: + description: The git version (including git commit hash) + nullable: true + type: string + version: + description: The version of Airflow + type: string + type: object + WeightRule: + description: Weight rule. + enum: + - downstream + - upstream + - absolute + type: string + XCom: + allOf: + - $ref: '#/components/schemas/XComCollectionItem' + - properties: + value: + description: "The value(s)," + example: null + type: object + description: Full representations of XCom entry. + example: + execution_date: execution_date + map_index: 0 + task_id: task_id + dag_id: dag_id + value: "" + key: key + timestamp: timestamp + XComCollection: + allOf: + - properties: + xcom_entries: + items: + $ref: '#/components/schemas/XComCollectionItem' + type: array + type: object + - $ref: '#/components/schemas/CollectionInfo' + description: | + Collection of XCom entries. + + *Changed in version 2.1.0*: 'total_entries' field is added. + example: + xcom_entries: + - execution_date: execution_date + map_index: 0 + task_id: task_id + dag_id: dag_id + key: key + timestamp: timestamp + - execution_date: execution_date + map_index: 0 + task_id: task_id + dag_id: dag_id + key: key + timestamp: timestamp + total_entries: 6 type: object - PluginCollection_allOf: + XComCollectionItem: + description: | + XCom entry collection item. + + The value field is only available when reading a single object due to the size of the value. + example: + execution_date: execution_date + map_index: 0 + task_id: task_id + dag_id: dag_id + key: key + timestamp: timestamp properties: - plugins: - items: - $ref: '#/components/schemas/PluginCollectionItem' - type: array + dag_id: + type: string + execution_date: + format: datetime + type: string + key: + type: string + map_index: + type: integer + task_id: + type: string + timestamp: + format: datetime + type: string type: object - RoleCollection_allOf: + get_dag_source_200_response: + example: + content: content properties: - roles: - items: - $ref: '#/components/schemas/Role' - type: array + content: + type: string type: object - ActionCollection_allOf: + clear_dag_run_200_response: + anyOf: + - $ref: '#/components/schemas/DAGRun' + - $ref: '#/components/schemas/TaskInstanceCollection' + get_log_200_response: + example: + continuation_token: continuation_token + content: content properties: - actions: - items: - $ref: '#/components/schemas/Action' - type: array + content: + type: string + continuation_token: + type: string + type: object + get_providers_200_response: + allOf: + - $ref: '#/components/schemas/ProviderCollection' + - $ref: '#/components/schemas/CollectionInfo' + example: + providers: + - package_name: package_name + description: description + version: version + - package_name: package_name + description: description + version: version + total_entries: 0 + DAGDetail_allOf_dataset_expression: + description: Nested dataset any/all conditions + nullable: true + type: object + DAGDetail_allOf_params: + description: | + User-specified DAG params. + + *New in version 2.0.1* + readOnly: true type: object - DatasetCollection_allOf: + Task_extra_links_inner: + example: + class_ref: + class_name: class_name + module_path: module_path properties: - datasets: - items: - $ref: '#/components/schemas/Dataset' - type: array + class_ref: + $ref: '#/components/schemas/ClassReference' type: object - DatasetEventCollection_allOf: + UserCollectionItem_roles_inner: + example: + name: name + nullable: true properties: - dataset_events: - items: - $ref: '#/components/schemas/DatasetEvent' - type: array + name: + type: string type: object securitySchemes: Basic: diff --git a/airflow/api_config.go b/airflow/api_config.go index 3622137..7cdf616 100644 --- a/airflow/api_config.go +++ b/airflow/api_config.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -30,38 +13,41 @@ package airflow import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" + "strings" ) -// Linger please -var ( - _ _context.Context -) -// ConfigApiService ConfigApi service -type ConfigApiService service +// ConfigAPIService ConfigAPI service +type ConfigAPIService service -type ConfigApiApiGetConfigRequest struct { - ctx _context.Context - ApiService *ConfigApiService +type ApiGetConfigRequest struct { + ctx context.Context + ApiService *ConfigAPIService + section *string } +// If given, only return config of this section. +func (r ApiGetConfigRequest) Section(section string) ApiGetConfigRequest { + r.section = §ion + return r +} -func (r ConfigApiApiGetConfigRequest) Execute() (Config, *_nethttp.Response, error) { +func (r ApiGetConfigRequest) Execute() (*Config, *http.Response, error) { return r.ApiService.GetConfigExecute(r) } /* GetConfig Get current configuration - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ConfigApiApiGetConfigRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetConfigRequest */ -func (a *ConfigApiService) GetConfig(ctx _context.Context) ConfigApiApiGetConfigRequest { - return ConfigApiApiGetConfigRequest{ +func (a *ConfigAPIService) GetConfig(ctx context.Context) ApiGetConfigRequest { + return ApiGetConfigRequest{ ApiService: a, ctx: ctx, } @@ -69,26 +55,164 @@ func (a *ConfigApiService) GetConfig(ctx _context.Context) ConfigApiApiGetConfig // Execute executes the request // @return Config -func (a *ConfigApiService) GetConfigExecute(r ConfigApiApiGetConfigRequest) (Config, *_nethttp.Response, error) { +func (a *ConfigAPIService) GetConfigExecute(r ApiGetConfigRequest) (*Config, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Config + formFiles []formFile + localVarReturnValue *Config ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConfigApiService.GetConfig") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConfigAPIService.GetConfig") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/config" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.section != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "section", r.section, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetValueRequest struct { + ctx context.Context + ApiService *ConfigAPIService + section string + option string +} + +func (r ApiGetValueRequest) Execute() (*Config, *http.Response, error) { + return r.ApiService.GetValueExecute(r) +} + +/* +GetValue Get a option from configuration + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param section + @param option + @return ApiGetValueRequest +*/ +func (a *ConfigAPIService) GetValue(ctx context.Context, section string, option string) ApiGetValueRequest { + return ApiGetValueRequest{ + ApiService: a, + ctx: ctx, + section: section, + option: option, + } +} + +// Execute executes the request +// @return Config +func (a *ConfigAPIService) GetValueExecute(r ApiGetValueRequest) (*Config, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Config + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConfigAPIService.GetValue") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/config/section/{section}/option/{option}" + localVarPath = strings.Replace(localVarPath, "{"+"section"+"}", url.PathEscape(parameterValueToString(r.section, "section")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"option"+"}", url.PathEscape(parameterValueToString(r.option, "option")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -107,7 +231,7 @@ func (a *ConfigApiService) GetConfigExecute(r ConfigApiApiGetConfigRequest) (Con if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -117,15 +241,15 @@ func (a *ConfigApiService) GetConfigExecute(r ConfigApiApiGetConfigRequest) (Con return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -136,7 +260,8 @@ func (a *ConfigApiService) GetConfigExecute(r ConfigApiApiGetConfigRequest) (Con newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -146,14 +271,26 @@ func (a *ConfigApiService) GetConfigExecute(r ConfigApiApiGetConfigRequest) (Con newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/airflow/api_connection.go b/airflow/api_connection.go index 7b39cee..18cb97a 100644 --- a/airflow/api_connection.go +++ b/airflow/api_connection.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -30,41 +13,36 @@ package airflow import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) -// ConnectionApiService ConnectionApi service -type ConnectionApiService service +// ConnectionAPIService ConnectionAPI service +type ConnectionAPIService service -type ConnectionApiApiDeleteConnectionRequest struct { - ctx _context.Context - ApiService *ConnectionApiService +type ApiDeleteConnectionRequest struct { + ctx context.Context + ApiService *ConnectionAPIService connectionId string } - -func (r ConnectionApiApiDeleteConnectionRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeleteConnectionRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteConnectionExecute(r) } /* DeleteConnection Delete a connection - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param connectionId The connection ID. - @return ConnectionApiApiDeleteConnectionRequest + @return ApiDeleteConnectionRequest */ -func (a *ConnectionApiService) DeleteConnection(ctx _context.Context, connectionId string) ConnectionApiApiDeleteConnectionRequest { - return ConnectionApiApiDeleteConnectionRequest{ +func (a *ConnectionAPIService) DeleteConnection(ctx context.Context, connectionId string) ApiDeleteConnectionRequest { + return ApiDeleteConnectionRequest{ ApiService: a, ctx: ctx, connectionId: connectionId, @@ -72,26 +50,24 @@ func (a *ConnectionApiService) DeleteConnection(ctx _context.Context, connection } // Execute executes the request -func (a *ConnectionApiService) DeleteConnectionExecute(r ConnectionApiApiDeleteConnectionRequest) (*_nethttp.Response, error) { +func (a *ConnectionAPIService) DeleteConnectionExecute(r ApiDeleteConnectionRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConnectionApiService.DeleteConnection") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConnectionAPIService.DeleteConnection") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/connections/{connection_id}" - localVarPath = strings.Replace(localVarPath, "{"+"connection_id"+"}", _neturl.PathEscape(parameterToString(r.connectionId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"connection_id"+"}", url.PathEscape(parameterValueToString(r.connectionId, "connectionId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -110,7 +86,7 @@ func (a *ConnectionApiService) DeleteConnectionExecute(r ConnectionApiApiDeleteC if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -120,15 +96,15 @@ func (a *ConnectionApiService) DeleteConnectionExecute(r ConnectionApiApiDeleteC return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -139,7 +115,8 @@ func (a *ConnectionApiService) DeleteConnectionExecute(r ConnectionApiApiDeleteC newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -149,7 +126,8 @@ func (a *ConnectionApiService) DeleteConnectionExecute(r ConnectionApiApiDeleteC newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -159,7 +137,8 @@ func (a *ConnectionApiService) DeleteConnectionExecute(r ConnectionApiApiDeleteC newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -169,7 +148,8 @@ func (a *ConnectionApiService) DeleteConnectionExecute(r ConnectionApiApiDeleteC newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -177,26 +157,25 @@ func (a *ConnectionApiService) DeleteConnectionExecute(r ConnectionApiApiDeleteC return localVarHTTPResponse, nil } -type ConnectionApiApiGetConnectionRequest struct { - ctx _context.Context - ApiService *ConnectionApiService +type ApiGetConnectionRequest struct { + ctx context.Context + ApiService *ConnectionAPIService connectionId string } - -func (r ConnectionApiApiGetConnectionRequest) Execute() (Connection, *_nethttp.Response, error) { +func (r ApiGetConnectionRequest) Execute() (*Connection, *http.Response, error) { return r.ApiService.GetConnectionExecute(r) } /* GetConnection Get a connection - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param connectionId The connection ID. - @return ConnectionApiApiGetConnectionRequest + @return ApiGetConnectionRequest */ -func (a *ConnectionApiService) GetConnection(ctx _context.Context, connectionId string) ConnectionApiApiGetConnectionRequest { - return ConnectionApiApiGetConnectionRequest{ +func (a *ConnectionAPIService) GetConnection(ctx context.Context, connectionId string) ApiGetConnectionRequest { + return ApiGetConnectionRequest{ ApiService: a, ctx: ctx, connectionId: connectionId, @@ -205,27 +184,25 @@ func (a *ConnectionApiService) GetConnection(ctx _context.Context, connectionId // Execute executes the request // @return Connection -func (a *ConnectionApiService) GetConnectionExecute(r ConnectionApiApiGetConnectionRequest) (Connection, *_nethttp.Response, error) { +func (a *ConnectionAPIService) GetConnectionExecute(r ApiGetConnectionRequest) (*Connection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Connection + formFiles []formFile + localVarReturnValue *Connection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConnectionApiService.GetConnection") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConnectionAPIService.GetConnection") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/connections/{connection_id}" - localVarPath = strings.Replace(localVarPath, "{"+"connection_id"+"}", _neturl.PathEscape(parameterToString(r.connectionId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"connection_id"+"}", url.PathEscape(parameterValueToString(r.connectionId, "connectionId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -244,7 +221,7 @@ func (a *ConnectionApiService) GetConnectionExecute(r ConnectionApiApiGetConnect if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -254,15 +231,15 @@ func (a *ConnectionApiService) GetConnectionExecute(r ConnectionApiApiGetConnect return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -273,7 +250,8 @@ func (a *ConnectionApiService) GetConnectionExecute(r ConnectionApiApiGetConnect newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -283,7 +261,8 @@ func (a *ConnectionApiService) GetConnectionExecute(r ConnectionApiApiGetConnect newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -293,14 +272,15 @@ func (a *ConnectionApiService) GetConnectionExecute(r ConnectionApiApiGetConnect newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -310,42 +290,44 @@ func (a *ConnectionApiService) GetConnectionExecute(r ConnectionApiApiGetConnect return localVarReturnValue, localVarHTTPResponse, nil } -type ConnectionApiApiGetConnectionsRequest struct { - ctx _context.Context - ApiService *ConnectionApiService +type ApiGetConnectionsRequest struct { + ctx context.Context + ApiService *ConnectionAPIService limit *int32 offset *int32 orderBy *string } // The numbers of items to return. -func (r ConnectionApiApiGetConnectionsRequest) Limit(limit int32) ConnectionApiApiGetConnectionsRequest { +func (r ApiGetConnectionsRequest) Limit(limit int32) ApiGetConnectionsRequest { r.limit = &limit return r } + // The number of items to skip before starting to collect the result set. -func (r ConnectionApiApiGetConnectionsRequest) Offset(offset int32) ConnectionApiApiGetConnectionsRequest { +func (r ApiGetConnectionsRequest) Offset(offset int32) ApiGetConnectionsRequest { r.offset = &offset return r } + // The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* -func (r ConnectionApiApiGetConnectionsRequest) OrderBy(orderBy string) ConnectionApiApiGetConnectionsRequest { +func (r ApiGetConnectionsRequest) OrderBy(orderBy string) ApiGetConnectionsRequest { r.orderBy = &orderBy return r } -func (r ConnectionApiApiGetConnectionsRequest) Execute() (ConnectionCollection, *_nethttp.Response, error) { +func (r ApiGetConnectionsRequest) Execute() (*ConnectionCollection, *http.Response, error) { return r.ApiService.GetConnectionsExecute(r) } /* GetConnections List connections - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ConnectionApiApiGetConnectionsRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetConnectionsRequest */ -func (a *ConnectionApiService) GetConnections(ctx _context.Context) ConnectionApiApiGetConnectionsRequest { - return ConnectionApiApiGetConnectionsRequest{ +func (a *ConnectionAPIService) GetConnections(ctx context.Context) ApiGetConnectionsRequest { + return ApiGetConnectionsRequest{ ApiService: a, ctx: ctx, } @@ -353,35 +335,36 @@ func (a *ConnectionApiService) GetConnections(ctx _context.Context) ConnectionAp // Execute executes the request // @return ConnectionCollection -func (a *ConnectionApiService) GetConnectionsExecute(r ConnectionApiApiGetConnectionsRequest) (ConnectionCollection, *_nethttp.Response, error) { +func (a *ConnectionAPIService) GetConnectionsExecute(r ApiGetConnectionsRequest) (*ConnectionCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ConnectionCollection + formFiles []formFile + localVarReturnValue *ConnectionCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConnectionApiService.GetConnections") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConnectionAPIService.GetConnections") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/connections" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue } if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") } if r.orderBy != nil { - localVarQueryParams.Add("order_by", parameterToString(*r.orderBy, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "order_by", r.orderBy, "form", "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -400,7 +383,7 @@ func (a *ConnectionApiService) GetConnectionsExecute(r ConnectionApiApiGetConnec if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -410,15 +393,15 @@ func (a *ConnectionApiService) GetConnectionsExecute(r ConnectionApiApiGetConnec return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -429,7 +412,8 @@ func (a *ConnectionApiService) GetConnectionsExecute(r ConnectionApiApiGetConnec newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -439,14 +423,15 @@ func (a *ConnectionApiService) GetConnectionsExecute(r ConnectionApiApiGetConnec newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -456,37 +441,38 @@ func (a *ConnectionApiService) GetConnectionsExecute(r ConnectionApiApiGetConnec return localVarReturnValue, localVarHTTPResponse, nil } -type ConnectionApiApiPatchConnectionRequest struct { - ctx _context.Context - ApiService *ConnectionApiService +type ApiPatchConnectionRequest struct { + ctx context.Context + ApiService *ConnectionAPIService connectionId string connection *Connection updateMask *[]string } -func (r ConnectionApiApiPatchConnectionRequest) Connection(connection Connection) ConnectionApiApiPatchConnectionRequest { +func (r ApiPatchConnectionRequest) Connection(connection Connection) ApiPatchConnectionRequest { r.connection = &connection return r } + // The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. -func (r ConnectionApiApiPatchConnectionRequest) UpdateMask(updateMask []string) ConnectionApiApiPatchConnectionRequest { +func (r ApiPatchConnectionRequest) UpdateMask(updateMask []string) ApiPatchConnectionRequest { r.updateMask = &updateMask return r } -func (r ConnectionApiApiPatchConnectionRequest) Execute() (Connection, *_nethttp.Response, error) { +func (r ApiPatchConnectionRequest) Execute() (*Connection, *http.Response, error) { return r.ApiService.PatchConnectionExecute(r) } /* PatchConnection Update a connection - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param connectionId The connection ID. - @return ConnectionApiApiPatchConnectionRequest + @return ApiPatchConnectionRequest */ -func (a *ConnectionApiService) PatchConnection(ctx _context.Context, connectionId string) ConnectionApiApiPatchConnectionRequest { - return ConnectionApiApiPatchConnectionRequest{ +func (a *ConnectionAPIService) PatchConnection(ctx context.Context, connectionId string) ApiPatchConnectionRequest { + return ApiPatchConnectionRequest{ ApiService: a, ctx: ctx, connectionId: connectionId, @@ -495,33 +481,31 @@ func (a *ConnectionApiService) PatchConnection(ctx _context.Context, connectionI // Execute executes the request // @return Connection -func (a *ConnectionApiService) PatchConnectionExecute(r ConnectionApiApiPatchConnectionRequest) (Connection, *_nethttp.Response, error) { +func (a *ConnectionAPIService) PatchConnectionExecute(r ApiPatchConnectionRequest) (*Connection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Connection + formFiles []formFile + localVarReturnValue *Connection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConnectionApiService.PatchConnection") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConnectionAPIService.PatchConnection") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/connections/{connection_id}" - localVarPath = strings.Replace(localVarPath, "{"+"connection_id"+"}", _neturl.PathEscape(parameterToString(r.connectionId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"connection_id"+"}", url.PathEscape(parameterValueToString(r.connectionId, "connectionId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.connection == nil { return localVarReturnValue, nil, reportError("connection is required and must be specified") } if r.updateMask != nil { - localVarQueryParams.Add("update_mask", parameterToString(*r.updateMask, "csv")) + parameterAddToHeaderOrQuery(localVarQueryParams, "update_mask", r.updateMask, "form", "csv") } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -542,7 +526,7 @@ func (a *ConnectionApiService) PatchConnectionExecute(r ConnectionApiApiPatchCon } // body params localVarPostBody = r.connection - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -552,15 +536,15 @@ func (a *ConnectionApiService) PatchConnectionExecute(r ConnectionApiApiPatchCon return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -571,7 +555,8 @@ func (a *ConnectionApiService) PatchConnectionExecute(r ConnectionApiApiPatchCon newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -581,7 +566,8 @@ func (a *ConnectionApiService) PatchConnectionExecute(r ConnectionApiApiPatchCon newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -591,7 +577,8 @@ func (a *ConnectionApiService) PatchConnectionExecute(r ConnectionApiApiPatchCon newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -601,14 +588,15 @@ func (a *ConnectionApiService) PatchConnectionExecute(r ConnectionApiApiPatchCon newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -618,29 +606,29 @@ func (a *ConnectionApiService) PatchConnectionExecute(r ConnectionApiApiPatchCon return localVarReturnValue, localVarHTTPResponse, nil } -type ConnectionApiApiPostConnectionRequest struct { - ctx _context.Context - ApiService *ConnectionApiService +type ApiPostConnectionRequest struct { + ctx context.Context + ApiService *ConnectionAPIService connection *Connection } -func (r ConnectionApiApiPostConnectionRequest) Connection(connection Connection) ConnectionApiApiPostConnectionRequest { +func (r ApiPostConnectionRequest) Connection(connection Connection) ApiPostConnectionRequest { r.connection = &connection return r } -func (r ConnectionApiApiPostConnectionRequest) Execute() (Connection, *_nethttp.Response, error) { +func (r ApiPostConnectionRequest) Execute() (*Connection, *http.Response, error) { return r.ApiService.PostConnectionExecute(r) } /* PostConnection Create a connection - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ConnectionApiApiPostConnectionRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPostConnectionRequest */ -func (a *ConnectionApiService) PostConnection(ctx _context.Context) ConnectionApiApiPostConnectionRequest { - return ConnectionApiApiPostConnectionRequest{ +func (a *ConnectionAPIService) PostConnection(ctx context.Context) ApiPostConnectionRequest { + return ApiPostConnectionRequest{ ApiService: a, ctx: ctx, } @@ -648,26 +636,24 @@ func (a *ConnectionApiService) PostConnection(ctx _context.Context) ConnectionAp // Execute executes the request // @return Connection -func (a *ConnectionApiService) PostConnectionExecute(r ConnectionApiApiPostConnectionRequest) (Connection, *_nethttp.Response, error) { +func (a *ConnectionAPIService) PostConnectionExecute(r ApiPostConnectionRequest) (*Connection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Connection + formFiles []formFile + localVarReturnValue *Connection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConnectionApiService.PostConnection") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConnectionAPIService.PostConnection") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/connections" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.connection == nil { return localVarReturnValue, nil, reportError("connection is required and must be specified") } @@ -691,7 +677,7 @@ func (a *ConnectionApiService) PostConnectionExecute(r ConnectionApiApiPostConne } // body params localVarPostBody = r.connection - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -701,15 +687,15 @@ func (a *ConnectionApiService) PostConnectionExecute(r ConnectionApiApiPostConne return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -720,7 +706,8 @@ func (a *ConnectionApiService) PostConnectionExecute(r ConnectionApiApiPostConne newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -730,7 +717,8 @@ func (a *ConnectionApiService) PostConnectionExecute(r ConnectionApiApiPostConne newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -740,14 +728,15 @@ func (a *ConnectionApiService) PostConnectionExecute(r ConnectionApiApiPostConne newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -757,18 +746,18 @@ func (a *ConnectionApiService) PostConnectionExecute(r ConnectionApiApiPostConne return localVarReturnValue, localVarHTTPResponse, nil } -type ConnectionApiApiTestConnectionRequest struct { - ctx _context.Context - ApiService *ConnectionApiService +type ApiTestConnectionRequest struct { + ctx context.Context + ApiService *ConnectionAPIService connection *Connection } -func (r ConnectionApiApiTestConnectionRequest) Connection(connection Connection) ConnectionApiApiTestConnectionRequest { +func (r ApiTestConnectionRequest) Connection(connection Connection) ApiTestConnectionRequest { r.connection = &connection return r } -func (r ConnectionApiApiTestConnectionRequest) Execute() (ConnectionTest, *_nethttp.Response, error) { +func (r ApiTestConnectionRequest) Execute() (*ConnectionTest, *http.Response, error) { return r.ApiService.TestConnectionExecute(r) } @@ -777,14 +766,23 @@ TestConnection Test a connection Test a connection. +For security reasons, the test connection functionality is disabled by default across Airflow UI, API and CLI. +For more information on capabilities of users, see the documentation: +https://airflow.apache.org/docs/apache-airflow/stable/security/security_model.html#capabilities-of-authenticated-ui-users. +It is strongly advised to not enable the feature until you make sure that only +highly trusted UI/API users have "edit connection" permissions. + +Set the "test_connection" flag to "Enabled" in the "core" section of Airflow configuration (airflow.cfg) to enable testing of collections. +It can also be controlled by the environment variable `AIRFLOW__CORE__TEST_CONNECTION`. + *New in version 2.2.0* - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ConnectionApiApiTestConnectionRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTestConnectionRequest */ -func (a *ConnectionApiService) TestConnection(ctx _context.Context) ConnectionApiApiTestConnectionRequest { - return ConnectionApiApiTestConnectionRequest{ +func (a *ConnectionAPIService) TestConnection(ctx context.Context) ApiTestConnectionRequest { + return ApiTestConnectionRequest{ ApiService: a, ctx: ctx, } @@ -792,26 +790,24 @@ func (a *ConnectionApiService) TestConnection(ctx _context.Context) ConnectionAp // Execute executes the request // @return ConnectionTest -func (a *ConnectionApiService) TestConnectionExecute(r ConnectionApiApiTestConnectionRequest) (ConnectionTest, *_nethttp.Response, error) { +func (a *ConnectionAPIService) TestConnectionExecute(r ApiTestConnectionRequest) (*ConnectionTest, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ConnectionTest + formFiles []formFile + localVarReturnValue *ConnectionTest ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConnectionApiService.TestConnection") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ConnectionAPIService.TestConnection") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/connections/test" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.connection == nil { return localVarReturnValue, nil, reportError("connection is required and must be specified") } @@ -835,7 +831,7 @@ func (a *ConnectionApiService) TestConnectionExecute(r ConnectionApiApiTestConne } // body params localVarPostBody = r.connection - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -845,15 +841,15 @@ func (a *ConnectionApiService) TestConnectionExecute(r ConnectionApiApiTestConne return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -864,7 +860,8 @@ func (a *ConnectionApiService) TestConnectionExecute(r ConnectionApiApiTestConne newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -874,7 +871,8 @@ func (a *ConnectionApiService) TestConnectionExecute(r ConnectionApiApiTestConne newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -884,7 +882,8 @@ func (a *ConnectionApiService) TestConnectionExecute(r ConnectionApiApiTestConne newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -894,14 +893,15 @@ func (a *ConnectionApiService) TestConnectionExecute(r ConnectionApiApiTestConne newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/airflow/api_dag.go b/airflow/api_dag.go index 2c48270..ab6ef8f 100644 --- a/airflow/api_dag.go +++ b/airflow/api_dag.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -30,30 +13,25 @@ package airflow import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" "strings" "reflect" ) -// Linger please -var ( - _ _context.Context -) -// DAGApiService DAGApi service -type DAGApiService service +// DAGAPIService DAGAPI service +type DAGAPIService service -type DAGApiApiDeleteDagRequest struct { - ctx _context.Context - ApiService *DAGApiService +type ApiDeleteDagRequest struct { + ctx context.Context + ApiService *DAGAPIService dagId string } - -func (r DAGApiApiDeleteDagRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeleteDagRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteDagExecute(r) } @@ -66,12 +44,12 @@ Logs are not deleted. This action cannot be undone. *New in version 2.2.0* - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. - @return DAGApiApiDeleteDagRequest + @return ApiDeleteDagRequest */ -func (a *DAGApiService) DeleteDag(ctx _context.Context, dagId string) DAGApiApiDeleteDagRequest { - return DAGApiApiDeleteDagRequest{ +func (a *DAGAPIService) DeleteDag(ctx context.Context, dagId string) ApiDeleteDagRequest { + return ApiDeleteDagRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -79,26 +57,24 @@ func (a *DAGApiService) DeleteDag(ctx _context.Context, dagId string) DAGApiApiD } // Execute executes the request -func (a *DAGApiService) DeleteDagExecute(r DAGApiApiDeleteDagRequest) (*_nethttp.Response, error) { +func (a *DAGAPIService) DeleteDagExecute(r ApiDeleteDagRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGApiService.DeleteDag") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGAPIService.DeleteDag") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -117,7 +93,7 @@ func (a *DAGApiService) DeleteDagExecute(r DAGApiApiDeleteDagRequest) (*_nethttp if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -127,15 +103,15 @@ func (a *DAGApiService) DeleteDagExecute(r DAGApiApiDeleteDagRequest) (*_nethttp return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -146,7 +122,8 @@ func (a *DAGApiService) DeleteDagExecute(r DAGApiApiDeleteDagRequest) (*_nethttp newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -156,7 +133,8 @@ func (a *DAGApiService) DeleteDagExecute(r DAGApiApiDeleteDagRequest) (*_nethttp newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -166,7 +144,8 @@ func (a *DAGApiService) DeleteDagExecute(r DAGApiApiDeleteDagRequest) (*_nethttp newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -176,7 +155,8 @@ func (a *DAGApiService) DeleteDagExecute(r DAGApiApiDeleteDagRequest) (*_nethttp newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -186,7 +166,8 @@ func (a *DAGApiService) DeleteDagExecute(r DAGApiApiDeleteDagRequest) (*_nethttp newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -194,14 +175,20 @@ func (a *DAGApiService) DeleteDagExecute(r DAGApiApiDeleteDagRequest) (*_nethttp return localVarHTTPResponse, nil } -type DAGApiApiGetDagRequest struct { - ctx _context.Context - ApiService *DAGApiService +type ApiGetDagRequest struct { + ctx context.Context + ApiService *DAGAPIService dagId string + fields *[]string } +// List of field for return. +func (r ApiGetDagRequest) Fields(fields []string) ApiGetDagRequest { + r.fields = &fields + return r +} -func (r DAGApiApiGetDagRequest) Execute() (DAG, *_nethttp.Response, error) { +func (r ApiGetDagRequest) Execute() (*DAG, *http.Response, error) { return r.ApiService.GetDagExecute(r) } @@ -212,12 +199,12 @@ Presents only information available in database (DAGModel). If you need detailed information, consider using GET /dags/{dag_id}/details. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. - @return DAGApiApiGetDagRequest + @return ApiGetDagRequest */ -func (a *DAGApiService) GetDag(ctx _context.Context, dagId string) DAGApiApiGetDagRequest { - return DAGApiApiGetDagRequest{ +func (a *DAGAPIService) GetDag(ctx context.Context, dagId string) ApiGetDagRequest { + return ApiGetDagRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -226,28 +213,37 @@ func (a *DAGApiService) GetDag(ctx _context.Context, dagId string) DAGApiApiGetD // Execute executes the request // @return DAG -func (a *DAGApiService) GetDagExecute(r DAGApiApiGetDagRequest) (DAG, *_nethttp.Response, error) { +func (a *DAGAPIService) GetDagExecute(r ApiGetDagRequest) (*DAG, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue DAG + formFiles []formFile + localVarReturnValue *DAG ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGApiService.GetDag") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGAPIService.GetDag") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.fields != nil { + t := *r.fields + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "fields", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "fields", t, "form", "multi") + } + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -265,7 +261,7 @@ func (a *DAGApiService) GetDagExecute(r DAGApiApiGetDagRequest) (DAG, *_nethttp. if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -275,15 +271,15 @@ func (a *DAGApiService) GetDagExecute(r DAGApiApiGetDagRequest) (DAG, *_nethttp. return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -294,7 +290,8 @@ func (a *DAGApiService) GetDagExecute(r DAGApiApiGetDagRequest) (DAG, *_nethttp. newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -304,7 +301,8 @@ func (a *DAGApiService) GetDagExecute(r DAGApiApiGetDagRequest) (DAG, *_nethttp. newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -314,14 +312,15 @@ func (a *DAGApiService) GetDagExecute(r DAGApiApiGetDagRequest) (DAG, *_nethttp. newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -331,14 +330,20 @@ func (a *DAGApiService) GetDagExecute(r DAGApiApiGetDagRequest) (DAG, *_nethttp. return localVarReturnValue, localVarHTTPResponse, nil } -type DAGApiApiGetDagDetailsRequest struct { - ctx _context.Context - ApiService *DAGApiService +type ApiGetDagDetailsRequest struct { + ctx context.Context + ApiService *DAGAPIService dagId string + fields *[]string } +// List of field for return. +func (r ApiGetDagDetailsRequest) Fields(fields []string) ApiGetDagDetailsRequest { + r.fields = &fields + return r +} -func (r DAGApiApiGetDagDetailsRequest) Execute() (DAGDetail, *_nethttp.Response, error) { +func (r ApiGetDagDetailsRequest) Execute() (*DAGDetail, *http.Response, error) { return r.ApiService.GetDagDetailsExecute(r) } @@ -348,12 +353,12 @@ GetDagDetails Get a simplified representation of DAG The response contains many DAG attributes, so the response can be large. If possible, consider using GET /dags/{dag_id}. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. - @return DAGApiApiGetDagDetailsRequest + @return ApiGetDagDetailsRequest */ -func (a *DAGApiService) GetDagDetails(ctx _context.Context, dagId string) DAGApiApiGetDagDetailsRequest { - return DAGApiApiGetDagDetailsRequest{ +func (a *DAGAPIService) GetDagDetails(ctx context.Context, dagId string) ApiGetDagDetailsRequest { + return ApiGetDagDetailsRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -362,28 +367,37 @@ func (a *DAGApiService) GetDagDetails(ctx _context.Context, dagId string) DAGApi // Execute executes the request // @return DAGDetail -func (a *DAGApiService) GetDagDetailsExecute(r DAGApiApiGetDagDetailsRequest) (DAGDetail, *_nethttp.Response, error) { +func (a *DAGAPIService) GetDagDetailsExecute(r ApiGetDagDetailsRequest) (*DAGDetail, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue DAGDetail + formFiles []formFile + localVarReturnValue *DAGDetail ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGApiService.GetDagDetails") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGAPIService.GetDagDetails") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}/details" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.fields != nil { + t := *r.fields + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "fields", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "fields", t, "form", "multi") + } + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -401,7 +415,7 @@ func (a *DAGApiService) GetDagDetailsExecute(r DAGApiApiGetDagDetailsRequest) (D if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -411,15 +425,15 @@ func (a *DAGApiService) GetDagDetailsExecute(r DAGApiApiGetDagDetailsRequest) (D return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -430,7 +444,8 @@ func (a *DAGApiService) GetDagDetailsExecute(r DAGApiApiGetDagDetailsRequest) (D newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -440,7 +455,8 @@ func (a *DAGApiService) GetDagDetailsExecute(r DAGApiApiGetDagDetailsRequest) (D newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -450,14 +466,15 @@ func (a *DAGApiService) GetDagDetailsExecute(r DAGApiApiGetDagDetailsRequest) (D newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -467,14 +484,13 @@ func (a *DAGApiService) GetDagDetailsExecute(r DAGApiApiGetDagDetailsRequest) (D return localVarReturnValue, localVarHTTPResponse, nil } -type DAGApiApiGetDagSourceRequest struct { - ctx _context.Context - ApiService *DAGApiService +type ApiGetDagSourceRequest struct { + ctx context.Context + ApiService *DAGAPIService fileToken string } - -func (r DAGApiApiGetDagSourceRequest) Execute() (InlineResponse2001, *_nethttp.Response, error) { +func (r ApiGetDagSourceRequest) Execute() (*GetDagSource200Response, *http.Response, error) { return r.ApiService.GetDagSourceExecute(r) } @@ -484,12 +500,12 @@ GetDagSource Get a source code Get a source code using file token. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param fileToken The key containing the encrypted path to the file. Encryption and decryption take place only on the server. This prevents the client from reading an non-DAG file. This also ensures API extensibility, because the format of encrypted data may change. - @return DAGApiApiGetDagSourceRequest + @return ApiGetDagSourceRequest */ -func (a *DAGApiService) GetDagSource(ctx _context.Context, fileToken string) DAGApiApiGetDagSourceRequest { - return DAGApiApiGetDagSourceRequest{ +func (a *DAGAPIService) GetDagSource(ctx context.Context, fileToken string) ApiGetDagSourceRequest { + return ApiGetDagSourceRequest{ ApiService: a, ctx: ctx, fileToken: fileToken, @@ -497,28 +513,26 @@ func (a *DAGApiService) GetDagSource(ctx _context.Context, fileToken string) DAG } // Execute executes the request -// @return InlineResponse2001 -func (a *DAGApiService) GetDagSourceExecute(r DAGApiApiGetDagSourceRequest) (InlineResponse2001, *_nethttp.Response, error) { +// @return GetDagSource200Response +func (a *DAGAPIService) GetDagSourceExecute(r ApiGetDagSourceRequest) (*GetDagSource200Response, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue InlineResponse2001 + formFiles []formFile + localVarReturnValue *GetDagSource200Response ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGApiService.GetDagSource") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGAPIService.GetDagSource") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dagSources/{file_token}" - localVarPath = strings.Replace(localVarPath, "{"+"file_token"+"}", _neturl.PathEscape(parameterToString(r.fileToken, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"file_token"+"}", url.PathEscape(parameterValueToString(r.fileToken, "fileToken")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -530,14 +544,14 @@ func (a *DAGApiService) GetDagSourceExecute(r DAGApiApiGetDagSourceRequest) (Inl } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "plain/text"} + localVarHTTPHeaderAccepts := []string{"application/json", "text/plain"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -547,15 +561,15 @@ func (a *DAGApiService) GetDagSourceExecute(r DAGApiApiGetDagSourceRequest) (Inl return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -566,7 +580,8 @@ func (a *DAGApiService) GetDagSourceExecute(r DAGApiApiGetDagSourceRequest) (Inl newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -576,7 +591,8 @@ func (a *DAGApiService) GetDagSourceExecute(r DAGApiApiGetDagSourceRequest) (Inl newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -586,7 +602,8 @@ func (a *DAGApiService) GetDagSourceExecute(r DAGApiApiGetDagSourceRequest) (Inl newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 406 { @@ -596,14 +613,15 @@ func (a *DAGApiService) GetDagSourceExecute(r DAGApiApiGetDagSourceRequest) (Inl newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -613,49 +631,68 @@ func (a *DAGApiService) GetDagSourceExecute(r DAGApiApiGetDagSourceRequest) (Inl return localVarReturnValue, localVarHTTPResponse, nil } -type DAGApiApiGetDagsRequest struct { - ctx _context.Context - ApiService *DAGApiService +type ApiGetDagsRequest struct { + ctx context.Context + ApiService *DAGAPIService limit *int32 offset *int32 orderBy *string tags *[]string onlyActive *bool + paused *bool + fields *[]string dagIdPattern *string } // The numbers of items to return. -func (r DAGApiApiGetDagsRequest) Limit(limit int32) DAGApiApiGetDagsRequest { +func (r ApiGetDagsRequest) Limit(limit int32) ApiGetDagsRequest { r.limit = &limit return r } + // The number of items to skip before starting to collect the result set. -func (r DAGApiApiGetDagsRequest) Offset(offset int32) DAGApiApiGetDagsRequest { +func (r ApiGetDagsRequest) Offset(offset int32) ApiGetDagsRequest { r.offset = &offset return r } + // The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* -func (r DAGApiApiGetDagsRequest) OrderBy(orderBy string) DAGApiApiGetDagsRequest { +func (r ApiGetDagsRequest) OrderBy(orderBy string) ApiGetDagsRequest { r.orderBy = &orderBy return r } + // List of tags to filter results. *New in version 2.2.0* -func (r DAGApiApiGetDagsRequest) Tags(tags []string) DAGApiApiGetDagsRequest { +func (r ApiGetDagsRequest) Tags(tags []string) ApiGetDagsRequest { r.tags = &tags return r } + // Only filter active DAGs. *New in version 2.1.1* -func (r DAGApiApiGetDagsRequest) OnlyActive(onlyActive bool) DAGApiApiGetDagsRequest { +func (r ApiGetDagsRequest) OnlyActive(onlyActive bool) ApiGetDagsRequest { r.onlyActive = &onlyActive return r } + +// Only filter paused/unpaused DAGs. If absent or null, it returns paused and unpaused DAGs. *New in version 2.6.0* +func (r ApiGetDagsRequest) Paused(paused bool) ApiGetDagsRequest { + r.paused = &paused + return r +} + +// List of field for return. +func (r ApiGetDagsRequest) Fields(fields []string) ApiGetDagsRequest { + r.fields = &fields + return r +} + // If set, only return DAGs with dag_ids matching this pattern. -func (r DAGApiApiGetDagsRequest) DagIdPattern(dagIdPattern string) DAGApiApiGetDagsRequest { +func (r ApiGetDagsRequest) DagIdPattern(dagIdPattern string) ApiGetDagsRequest { r.dagIdPattern = &dagIdPattern return r } -func (r DAGApiApiGetDagsRequest) Execute() (DAGCollection, *_nethttp.Response, error) { +func (r ApiGetDagsRequest) Execute() (*DAGCollection, *http.Response, error) { return r.ApiService.GetDagsExecute(r) } @@ -666,11 +703,11 @@ List DAGs in the database. `dag_id_pattern` can be set to match dags of a specific pattern - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return DAGApiApiGetDagsRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetDagsRequest */ -func (a *DAGApiService) GetDags(ctx _context.Context) DAGApiApiGetDagsRequest { - return DAGApiApiGetDagsRequest{ +func (a *DAGAPIService) GetDags(ctx context.Context) ApiGetDagsRequest { + return ApiGetDagsRequest{ ApiService: a, ctx: ctx, } @@ -678,52 +715,70 @@ func (a *DAGApiService) GetDags(ctx _context.Context) DAGApiApiGetDagsRequest { // Execute executes the request // @return DAGCollection -func (a *DAGApiService) GetDagsExecute(r DAGApiApiGetDagsRequest) (DAGCollection, *_nethttp.Response, error) { +func (a *DAGAPIService) GetDagsExecute(r ApiGetDagsRequest) (*DAGCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue DAGCollection + formFiles []formFile + localVarReturnValue *DAGCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGApiService.GetDags") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGAPIService.GetDags") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue } if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") } if r.orderBy != nil { - localVarQueryParams.Add("order_by", parameterToString(*r.orderBy, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "order_by", r.orderBy, "form", "") } if r.tags != nil { t := *r.tags if reflect.TypeOf(t).Kind() == reflect.Slice { s := reflect.ValueOf(t) for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("tags", parameterToString(s.Index(i), "multi")) + parameterAddToHeaderOrQuery(localVarQueryParams, "tags", s.Index(i).Interface(), "form", "multi") } } else { - localVarQueryParams.Add("tags", parameterToString(t, "multi")) + parameterAddToHeaderOrQuery(localVarQueryParams, "tags", t, "form", "multi") } } if r.onlyActive != nil { - localVarQueryParams.Add("only_active", parameterToString(*r.onlyActive, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "only_active", r.onlyActive, "form", "") + } else { + var defaultValue bool = true + r.onlyActive = &defaultValue + } + if r.paused != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "paused", r.paused, "form", "") + } + if r.fields != nil { + t := *r.fields + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "fields", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "fields", t, "form", "multi") + } } if r.dagIdPattern != nil { - localVarQueryParams.Add("dag_id_pattern", parameterToString(*r.dagIdPattern, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "dag_id_pattern", r.dagIdPattern, "form", "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -742,7 +797,7 @@ func (a *DAGApiService) GetDagsExecute(r DAGApiApiGetDagsRequest) (DAGCollection if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -752,15 +807,15 @@ func (a *DAGApiService) GetDagsExecute(r DAGApiApiGetDagsRequest) (DAGCollection return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -771,14 +826,15 @@ func (a *DAGApiService) GetDagsExecute(r DAGApiApiGetDagsRequest) (DAGCollection newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -788,28 +844,27 @@ func (a *DAGApiService) GetDagsExecute(r DAGApiApiGetDagsRequest) (DAGCollection return localVarReturnValue, localVarHTTPResponse, nil } -type DAGApiApiGetTaskRequest struct { - ctx _context.Context - ApiService *DAGApiService +type ApiGetTaskRequest struct { + ctx context.Context + ApiService *DAGAPIService dagId string taskId string } - -func (r DAGApiApiGetTaskRequest) Execute() (Task, *_nethttp.Response, error) { +func (r ApiGetTaskRequest) Execute() (*Task, *http.Response, error) { return r.ApiService.GetTaskExecute(r) } /* GetTask Get simplified representation of a task - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. @param taskId The task ID. - @return DAGApiApiGetTaskRequest + @return ApiGetTaskRequest */ -func (a *DAGApiService) GetTask(ctx _context.Context, dagId string, taskId string) DAGApiApiGetTaskRequest { - return DAGApiApiGetTaskRequest{ +func (a *DAGAPIService) GetTask(ctx context.Context, dagId string, taskId string) ApiGetTaskRequest { + return ApiGetTaskRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -819,28 +874,26 @@ func (a *DAGApiService) GetTask(ctx _context.Context, dagId string, taskId strin // Execute executes the request // @return Task -func (a *DAGApiService) GetTaskExecute(r DAGApiApiGetTaskRequest) (Task, *_nethttp.Response, error) { +func (a *DAGAPIService) GetTaskExecute(r ApiGetTaskRequest) (*Task, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Task + formFiles []formFile + localVarReturnValue *Task ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGApiService.GetTask") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGAPIService.GetTask") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}/tasks/{task_id}" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", _neturl.PathEscape(parameterToString(r.taskId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", url.PathEscape(parameterValueToString(r.taskId, "taskId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -859,7 +912,7 @@ func (a *DAGApiService) GetTaskExecute(r DAGApiApiGetTaskRequest) (Task, *_netht if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -869,15 +922,15 @@ func (a *DAGApiService) GetTaskExecute(r DAGApiApiGetTaskRequest) (Task, *_netht return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -888,7 +941,8 @@ func (a *DAGApiService) GetTaskExecute(r DAGApiApiGetTaskRequest) (Task, *_netht newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -898,7 +952,8 @@ func (a *DAGApiService) GetTaskExecute(r DAGApiApiGetTaskRequest) (Task, *_netht newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -908,14 +963,15 @@ func (a *DAGApiService) GetTaskExecute(r DAGApiApiGetTaskRequest) (Task, *_netht newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -925,32 +981,32 @@ func (a *DAGApiService) GetTaskExecute(r DAGApiApiGetTaskRequest) (Task, *_netht return localVarReturnValue, localVarHTTPResponse, nil } -type DAGApiApiGetTasksRequest struct { - ctx _context.Context - ApiService *DAGApiService +type ApiGetTasksRequest struct { + ctx context.Context + ApiService *DAGAPIService dagId string orderBy *string } // The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* -func (r DAGApiApiGetTasksRequest) OrderBy(orderBy string) DAGApiApiGetTasksRequest { +func (r ApiGetTasksRequest) OrderBy(orderBy string) ApiGetTasksRequest { r.orderBy = &orderBy return r } -func (r DAGApiApiGetTasksRequest) Execute() (TaskCollection, *_nethttp.Response, error) { +func (r ApiGetTasksRequest) Execute() (*TaskCollection, *http.Response, error) { return r.ApiService.GetTasksExecute(r) } /* GetTasks Get tasks for DAG - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. - @return DAGApiApiGetTasksRequest + @return ApiGetTasksRequest */ -func (a *DAGApiService) GetTasks(ctx _context.Context, dagId string) DAGApiApiGetTasksRequest { - return DAGApiApiGetTasksRequest{ +func (a *DAGAPIService) GetTasks(ctx context.Context, dagId string) ApiGetTasksRequest { + return ApiGetTasksRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -959,30 +1015,28 @@ func (a *DAGApiService) GetTasks(ctx _context.Context, dagId string) DAGApiApiGe // Execute executes the request // @return TaskCollection -func (a *DAGApiService) GetTasksExecute(r DAGApiApiGetTasksRequest) (TaskCollection, *_nethttp.Response, error) { +func (a *DAGAPIService) GetTasksExecute(r ApiGetTasksRequest) (*TaskCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue TaskCollection + formFiles []formFile + localVarReturnValue *TaskCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGApiService.GetTasks") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGAPIService.GetTasks") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}/tasks" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.orderBy != nil { - localVarQueryParams.Add("order_by", parameterToString(*r.orderBy, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "order_by", r.orderBy, "form", "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1001,7 +1055,7 @@ func (a *DAGApiService) GetTasksExecute(r DAGApiApiGetTasksRequest) (TaskCollect if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1011,15 +1065,15 @@ func (a *DAGApiService) GetTasksExecute(r DAGApiApiGetTasksRequest) (TaskCollect return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1030,7 +1084,8 @@ func (a *DAGApiService) GetTasksExecute(r DAGApiApiGetTasksRequest) (TaskCollect newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1040,7 +1095,8 @@ func (a *DAGApiService) GetTasksExecute(r DAGApiApiGetTasksRequest) (TaskCollect newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1050,14 +1106,15 @@ func (a *DAGApiService) GetTasksExecute(r DAGApiApiGetTasksRequest) (TaskCollect newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1067,37 +1124,38 @@ func (a *DAGApiService) GetTasksExecute(r DAGApiApiGetTasksRequest) (TaskCollect return localVarReturnValue, localVarHTTPResponse, nil } -type DAGApiApiPatchDagRequest struct { - ctx _context.Context - ApiService *DAGApiService +type ApiPatchDagRequest struct { + ctx context.Context + ApiService *DAGAPIService dagId string dAG *DAG updateMask *[]string } -func (r DAGApiApiPatchDagRequest) DAG(dAG DAG) DAGApiApiPatchDagRequest { +func (r ApiPatchDagRequest) DAG(dAG DAG) ApiPatchDagRequest { r.dAG = &dAG return r } + // The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. -func (r DAGApiApiPatchDagRequest) UpdateMask(updateMask []string) DAGApiApiPatchDagRequest { +func (r ApiPatchDagRequest) UpdateMask(updateMask []string) ApiPatchDagRequest { r.updateMask = &updateMask return r } -func (r DAGApiApiPatchDagRequest) Execute() (DAG, *_nethttp.Response, error) { +func (r ApiPatchDagRequest) Execute() (*DAG, *http.Response, error) { return r.ApiService.PatchDagExecute(r) } /* PatchDag Update a DAG - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. - @return DAGApiApiPatchDagRequest + @return ApiPatchDagRequest */ -func (a *DAGApiService) PatchDag(ctx _context.Context, dagId string) DAGApiApiPatchDagRequest { - return DAGApiApiPatchDagRequest{ +func (a *DAGAPIService) PatchDag(ctx context.Context, dagId string) ApiPatchDagRequest { + return ApiPatchDagRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -1106,33 +1164,31 @@ func (a *DAGApiService) PatchDag(ctx _context.Context, dagId string) DAGApiApiPa // Execute executes the request // @return DAG -func (a *DAGApiService) PatchDagExecute(r DAGApiApiPatchDagRequest) (DAG, *_nethttp.Response, error) { +func (a *DAGAPIService) PatchDagExecute(r ApiPatchDagRequest) (*DAG, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue DAG + formFiles []formFile + localVarReturnValue *DAG ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGApiService.PatchDag") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGAPIService.PatchDag") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.dAG == nil { return localVarReturnValue, nil, reportError("dAG is required and must be specified") } if r.updateMask != nil { - localVarQueryParams.Add("update_mask", parameterToString(*r.updateMask, "csv")) + parameterAddToHeaderOrQuery(localVarQueryParams, "update_mask", r.updateMask, "form", "csv") } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -1153,7 +1209,7 @@ func (a *DAGApiService) PatchDagExecute(r DAGApiApiPatchDagRequest) (DAG, *_neth } // body params localVarPostBody = r.dAG - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1163,15 +1219,15 @@ func (a *DAGApiService) PatchDagExecute(r DAGApiApiPatchDagRequest) (DAG, *_neth return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1182,7 +1238,8 @@ func (a *DAGApiService) PatchDagExecute(r DAGApiApiPatchDagRequest) (DAG, *_neth newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1192,7 +1249,8 @@ func (a *DAGApiService) PatchDagExecute(r DAGApiApiPatchDagRequest) (DAG, *_neth newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1202,14 +1260,15 @@ func (a *DAGApiService) PatchDagExecute(r DAGApiApiPatchDagRequest) (DAG, *_neth newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1219,9 +1278,9 @@ func (a *DAGApiService) PatchDagExecute(r DAGApiApiPatchDagRequest) (DAG, *_neth return localVarReturnValue, localVarHTTPResponse, nil } -type DAGApiApiPatchDagsRequest struct { - ctx _context.Context - ApiService *DAGApiService +type ApiPatchDagsRequest struct { + ctx context.Context + ApiService *DAGAPIService dagIdPattern *string dAG *DAG limit *int32 @@ -1232,41 +1291,47 @@ type DAGApiApiPatchDagsRequest struct { } // If set, only update DAGs with dag_ids matching this pattern. -func (r DAGApiApiPatchDagsRequest) DagIdPattern(dagIdPattern string) DAGApiApiPatchDagsRequest { +func (r ApiPatchDagsRequest) DagIdPattern(dagIdPattern string) ApiPatchDagsRequest { r.dagIdPattern = &dagIdPattern return r } -func (r DAGApiApiPatchDagsRequest) DAG(dAG DAG) DAGApiApiPatchDagsRequest { + +func (r ApiPatchDagsRequest) DAG(dAG DAG) ApiPatchDagsRequest { r.dAG = &dAG return r } + // The numbers of items to return. -func (r DAGApiApiPatchDagsRequest) Limit(limit int32) DAGApiApiPatchDagsRequest { +func (r ApiPatchDagsRequest) Limit(limit int32) ApiPatchDagsRequest { r.limit = &limit return r } + // The number of items to skip before starting to collect the result set. -func (r DAGApiApiPatchDagsRequest) Offset(offset int32) DAGApiApiPatchDagsRequest { +func (r ApiPatchDagsRequest) Offset(offset int32) ApiPatchDagsRequest { r.offset = &offset return r } + // List of tags to filter results. *New in version 2.2.0* -func (r DAGApiApiPatchDagsRequest) Tags(tags []string) DAGApiApiPatchDagsRequest { +func (r ApiPatchDagsRequest) Tags(tags []string) ApiPatchDagsRequest { r.tags = &tags return r } + // The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. -func (r DAGApiApiPatchDagsRequest) UpdateMask(updateMask []string) DAGApiApiPatchDagsRequest { +func (r ApiPatchDagsRequest) UpdateMask(updateMask []string) ApiPatchDagsRequest { r.updateMask = &updateMask return r } + // Only filter active DAGs. *New in version 2.1.1* -func (r DAGApiApiPatchDagsRequest) OnlyActive(onlyActive bool) DAGApiApiPatchDagsRequest { +func (r ApiPatchDagsRequest) OnlyActive(onlyActive bool) ApiPatchDagsRequest { r.onlyActive = &onlyActive return r } -func (r DAGApiApiPatchDagsRequest) Execute() (DAGCollection, *_nethttp.Response, error) { +func (r ApiPatchDagsRequest) Execute() (*DAGCollection, *http.Response, error) { return r.ApiService.PatchDagsExecute(r) } @@ -1278,11 +1343,11 @@ This endpoint allows specifying `~` as the dag_id_pattern to update all DAGs. *New in version 2.3.0* - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return DAGApiApiPatchDagsRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPatchDagsRequest */ -func (a *DAGApiService) PatchDags(ctx _context.Context) DAGApiApiPatchDagsRequest { - return DAGApiApiPatchDagsRequest{ +func (a *DAGAPIService) PatchDags(ctx context.Context) ApiPatchDagsRequest { + return ApiPatchDagsRequest{ ApiService: a, ctx: ctx, } @@ -1290,26 +1355,24 @@ func (a *DAGApiService) PatchDags(ctx _context.Context) DAGApiApiPatchDagsReques // Execute executes the request // @return DAGCollection -func (a *DAGApiService) PatchDagsExecute(r DAGApiApiPatchDagsRequest) (DAGCollection, *_nethttp.Response, error) { +func (a *DAGAPIService) PatchDagsExecute(r ApiPatchDagsRequest) (*DAGCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue DAGCollection + formFiles []formFile + localVarReturnValue *DAGCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGApiService.PatchDags") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGAPIService.PatchDags") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.dagIdPattern == nil { return localVarReturnValue, nil, reportError("dagIdPattern is required and must be specified") } @@ -1318,29 +1381,35 @@ func (a *DAGApiService) PatchDagsExecute(r DAGApiApiPatchDagsRequest) (DAGCollec } if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue } if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") } if r.tags != nil { t := *r.tags if reflect.TypeOf(t).Kind() == reflect.Slice { s := reflect.ValueOf(t) for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("tags", parameterToString(s.Index(i), "multi")) + parameterAddToHeaderOrQuery(localVarQueryParams, "tags", s.Index(i).Interface(), "form", "multi") } } else { - localVarQueryParams.Add("tags", parameterToString(t, "multi")) + parameterAddToHeaderOrQuery(localVarQueryParams, "tags", t, "form", "multi") } } if r.updateMask != nil { - localVarQueryParams.Add("update_mask", parameterToString(*r.updateMask, "csv")) + parameterAddToHeaderOrQuery(localVarQueryParams, "update_mask", r.updateMask, "form", "csv") } if r.onlyActive != nil { - localVarQueryParams.Add("only_active", parameterToString(*r.onlyActive, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "only_active", r.onlyActive, "form", "") + } else { + var defaultValue bool = true + r.onlyActive = &defaultValue } - localVarQueryParams.Add("dag_id_pattern", parameterToString(*r.dagIdPattern, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "dag_id_pattern", r.dagIdPattern, "form", "") // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -1360,7 +1429,7 @@ func (a *DAGApiService) PatchDagsExecute(r DAGApiApiPatchDagsRequest) (DAGCollec } // body params localVarPostBody = r.dAG - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1370,15 +1439,15 @@ func (a *DAGApiService) PatchDagsExecute(r DAGApiApiPatchDagsRequest) (DAGCollec return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1389,7 +1458,8 @@ func (a *DAGApiService) PatchDagsExecute(r DAGApiApiPatchDagsRequest) (DAGCollec newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1399,7 +1469,8 @@ func (a *DAGApiService) PatchDagsExecute(r DAGApiApiPatchDagsRequest) (DAGCollec newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1409,14 +1480,15 @@ func (a *DAGApiService) PatchDagsExecute(r DAGApiApiPatchDagsRequest) (DAGCollec newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1426,20 +1498,20 @@ func (a *DAGApiService) PatchDagsExecute(r DAGApiApiPatchDagsRequest) (DAGCollec return localVarReturnValue, localVarHTTPResponse, nil } -type DAGApiApiPostClearTaskInstancesRequest struct { - ctx _context.Context - ApiService *DAGApiService +type ApiPostClearTaskInstancesRequest struct { + ctx context.Context + ApiService *DAGAPIService dagId string clearTaskInstances *ClearTaskInstances } // Parameters of action -func (r DAGApiApiPostClearTaskInstancesRequest) ClearTaskInstances(clearTaskInstances ClearTaskInstances) DAGApiApiPostClearTaskInstancesRequest { +func (r ApiPostClearTaskInstancesRequest) ClearTaskInstances(clearTaskInstances ClearTaskInstances) ApiPostClearTaskInstancesRequest { r.clearTaskInstances = &clearTaskInstances return r } -func (r DAGApiApiPostClearTaskInstancesRequest) Execute() (TaskInstanceReferenceCollection, *_nethttp.Response, error) { +func (r ApiPostClearTaskInstancesRequest) Execute() (*TaskInstanceReferenceCollection, *http.Response, error) { return r.ApiService.PostClearTaskInstancesExecute(r) } @@ -1449,12 +1521,12 @@ PostClearTaskInstances Clear a set of task instances Clears a set of task instances associated with the DAG for a specified date range. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. - @return DAGApiApiPostClearTaskInstancesRequest + @return ApiPostClearTaskInstancesRequest */ -func (a *DAGApiService) PostClearTaskInstances(ctx _context.Context, dagId string) DAGApiApiPostClearTaskInstancesRequest { - return DAGApiApiPostClearTaskInstancesRequest{ +func (a *DAGAPIService) PostClearTaskInstances(ctx context.Context, dagId string) ApiPostClearTaskInstancesRequest { + return ApiPostClearTaskInstancesRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -1463,27 +1535,25 @@ func (a *DAGApiService) PostClearTaskInstances(ctx _context.Context, dagId strin // Execute executes the request // @return TaskInstanceReferenceCollection -func (a *DAGApiService) PostClearTaskInstancesExecute(r DAGApiApiPostClearTaskInstancesRequest) (TaskInstanceReferenceCollection, *_nethttp.Response, error) { +func (a *DAGAPIService) PostClearTaskInstancesExecute(r ApiPostClearTaskInstancesRequest) (*TaskInstanceReferenceCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue TaskInstanceReferenceCollection + formFiles []formFile + localVarReturnValue *TaskInstanceReferenceCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGApiService.PostClearTaskInstances") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGAPIService.PostClearTaskInstances") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}/clearTaskInstances" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.clearTaskInstances == nil { return localVarReturnValue, nil, reportError("clearTaskInstances is required and must be specified") } @@ -1507,7 +1577,7 @@ func (a *DAGApiService) PostClearTaskInstancesExecute(r DAGApiApiPostClearTaskIn } // body params localVarPostBody = r.clearTaskInstances - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1517,15 +1587,15 @@ func (a *DAGApiService) PostClearTaskInstancesExecute(r DAGApiApiPostClearTaskIn return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1536,7 +1606,8 @@ func (a *DAGApiService) PostClearTaskInstancesExecute(r DAGApiApiPostClearTaskIn newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1546,7 +1617,8 @@ func (a *DAGApiService) PostClearTaskInstancesExecute(r DAGApiApiPostClearTaskIn newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1556,14 +1628,15 @@ func (a *DAGApiService) PostClearTaskInstancesExecute(r DAGApiApiPostClearTaskIn newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1573,20 +1646,20 @@ func (a *DAGApiService) PostClearTaskInstancesExecute(r DAGApiApiPostClearTaskIn return localVarReturnValue, localVarHTTPResponse, nil } -type DAGApiApiPostSetTaskInstancesStateRequest struct { - ctx _context.Context - ApiService *DAGApiService +type ApiPostSetTaskInstancesStateRequest struct { + ctx context.Context + ApiService *DAGAPIService dagId string updateTaskInstancesState *UpdateTaskInstancesState } // Parameters of action -func (r DAGApiApiPostSetTaskInstancesStateRequest) UpdateTaskInstancesState(updateTaskInstancesState UpdateTaskInstancesState) DAGApiApiPostSetTaskInstancesStateRequest { +func (r ApiPostSetTaskInstancesStateRequest) UpdateTaskInstancesState(updateTaskInstancesState UpdateTaskInstancesState) ApiPostSetTaskInstancesStateRequest { r.updateTaskInstancesState = &updateTaskInstancesState return r } -func (r DAGApiApiPostSetTaskInstancesStateRequest) Execute() (TaskInstanceReferenceCollection, *_nethttp.Response, error) { +func (r ApiPostSetTaskInstancesStateRequest) Execute() (*TaskInstanceReferenceCollection, *http.Response, error) { return r.ApiService.PostSetTaskInstancesStateExecute(r) } @@ -1596,12 +1669,12 @@ PostSetTaskInstancesState Set a state of task instances Updates the state for multiple task instances simultaneously. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. - @return DAGApiApiPostSetTaskInstancesStateRequest + @return ApiPostSetTaskInstancesStateRequest */ -func (a *DAGApiService) PostSetTaskInstancesState(ctx _context.Context, dagId string) DAGApiApiPostSetTaskInstancesStateRequest { - return DAGApiApiPostSetTaskInstancesStateRequest{ +func (a *DAGAPIService) PostSetTaskInstancesState(ctx context.Context, dagId string) ApiPostSetTaskInstancesStateRequest { + return ApiPostSetTaskInstancesStateRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -1610,27 +1683,25 @@ func (a *DAGApiService) PostSetTaskInstancesState(ctx _context.Context, dagId st // Execute executes the request // @return TaskInstanceReferenceCollection -func (a *DAGApiService) PostSetTaskInstancesStateExecute(r DAGApiApiPostSetTaskInstancesStateRequest) (TaskInstanceReferenceCollection, *_nethttp.Response, error) { +func (a *DAGAPIService) PostSetTaskInstancesStateExecute(r ApiPostSetTaskInstancesStateRequest) (*TaskInstanceReferenceCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue TaskInstanceReferenceCollection + formFiles []formFile + localVarReturnValue *TaskInstanceReferenceCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGApiService.PostSetTaskInstancesState") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGAPIService.PostSetTaskInstancesState") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}/updateTaskInstancesState" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.updateTaskInstancesState == nil { return localVarReturnValue, nil, reportError("updateTaskInstancesState is required and must be specified") } @@ -1654,168 +1725,7 @@ func (a *DAGApiService) PostSetTaskInstancesStateExecute(r DAGApiApiPostSetTaskI } // body params localVarPostBody = r.updateTaskInstancesState - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 401 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type DAGApiApiSetMappedTaskInstanceNoteRequest struct { - ctx _context.Context - ApiService *DAGApiService - dagId string - dagRunId string - taskId string - mapIndex int32 - setTaskInstanceNote *SetTaskInstanceNote -} - -// Parameters of set Task Instance note. -func (r DAGApiApiSetMappedTaskInstanceNoteRequest) SetTaskInstanceNote(setTaskInstanceNote SetTaskInstanceNote) DAGApiApiSetMappedTaskInstanceNoteRequest { - r.setTaskInstanceNote = &setTaskInstanceNote - return r -} - -func (r DAGApiApiSetMappedTaskInstanceNoteRequest) Execute() (TaskInstance, *_nethttp.Response, error) { - return r.ApiService.SetMappedTaskInstanceNoteExecute(r) -} - -/* -SetMappedTaskInstanceNote Update the TaskInstance note. - -Update the manual user note of a mapped Task Instance. - -*New in version 2.5.0* - - - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param dagId The DAG ID. - @param dagRunId The DAG run ID. - @param taskId The task ID. - @param mapIndex The map index. - @return DAGApiApiSetMappedTaskInstanceNoteRequest -*/ -func (a *DAGApiService) SetMappedTaskInstanceNote(ctx _context.Context, dagId string, dagRunId string, taskId string, mapIndex int32) DAGApiApiSetMappedTaskInstanceNoteRequest { - return DAGApiApiSetMappedTaskInstanceNoteRequest{ - ApiService: a, - ctx: ctx, - dagId: dagId, - dagRunId: dagRunId, - taskId: taskId, - mapIndex: mapIndex, - } -} - -// Execute executes the request -// @return TaskInstance -func (a *DAGApiService) SetMappedTaskInstanceNoteExecute(r DAGApiApiSetMappedTaskInstanceNoteRequest) (TaskInstance, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPatch - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue TaskInstance - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGApiService.SetMappedTaskInstanceNote") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}/setNote" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", _neturl.PathEscape(parameterToString(r.dagRunId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", _neturl.PathEscape(parameterToString(r.taskId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"map_index"+"}", _neturl.PathEscape(parameterToString(r.mapIndex, "")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.setTaskInstanceNote == nil { - return localVarReturnValue, nil, reportError("setTaskInstanceNote is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.setTaskInstanceNote - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1825,28 +1735,18 @@ func (a *DAGApiService) SetMappedTaskInstanceNoteExecute(r DAGApiApiSetMappedTas return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1854,7 +1754,8 @@ func (a *DAGApiService) SetMappedTaskInstanceNoteExecute(r DAGApiApiSetMappedTas newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1864,7 +1765,8 @@ func (a *DAGApiService) SetMappedTaskInstanceNoteExecute(r DAGApiApiSetMappedTas newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1874,14 +1776,15 @@ func (a *DAGApiService) SetMappedTaskInstanceNoteExecute(r DAGApiApiSetMappedTas newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1891,80 +1794,56 @@ func (a *DAGApiService) SetMappedTaskInstanceNoteExecute(r DAGApiApiSetMappedTas return localVarReturnValue, localVarHTTPResponse, nil } -type DAGApiApiSetTaskInstanceNoteRequest struct { - ctx _context.Context - ApiService *DAGApiService - dagId string - dagRunId string - taskId string - setTaskInstanceNote *SetTaskInstanceNote -} - -// Parameters of set Task Instance note. -func (r DAGApiApiSetTaskInstanceNoteRequest) SetTaskInstanceNote(setTaskInstanceNote SetTaskInstanceNote) DAGApiApiSetTaskInstanceNoteRequest { - r.setTaskInstanceNote = &setTaskInstanceNote - return r +type ApiReparseDagFileRequest struct { + ctx context.Context + ApiService *DAGAPIService + fileToken string } -func (r DAGApiApiSetTaskInstanceNoteRequest) Execute() (TaskInstance, *_nethttp.Response, error) { - return r.ApiService.SetTaskInstanceNoteExecute(r) +func (r ApiReparseDagFileRequest) Execute() (*http.Response, error) { + return r.ApiService.ReparseDagFileExecute(r) } /* -SetTaskInstanceNote Update the TaskInstance note. - -Update the manual user note of a non-mapped Task Instance. +ReparseDagFile Request re-parsing of a DAG file -*New in version 2.5.0* +Request re-parsing of existing DAG files using a file token. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param dagId The DAG ID. - @param dagRunId The DAG run ID. - @param taskId The task ID. - @return DAGApiApiSetTaskInstanceNoteRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param fileToken The key containing the encrypted path to the file. Encryption and decryption take place only on the server. This prevents the client from reading an non-DAG file. This also ensures API extensibility, because the format of encrypted data may change. + @return ApiReparseDagFileRequest */ -func (a *DAGApiService) SetTaskInstanceNote(ctx _context.Context, dagId string, dagRunId string, taskId string) DAGApiApiSetTaskInstanceNoteRequest { - return DAGApiApiSetTaskInstanceNoteRequest{ +func (a *DAGAPIService) ReparseDagFile(ctx context.Context, fileToken string) ApiReparseDagFileRequest { + return ApiReparseDagFileRequest{ ApiService: a, ctx: ctx, - dagId: dagId, - dagRunId: dagRunId, - taskId: taskId, + fileToken: fileToken, } } // Execute executes the request -// @return TaskInstance -func (a *DAGApiService) SetTaskInstanceNoteExecute(r DAGApiApiSetTaskInstanceNoteRequest) (TaskInstance, *_nethttp.Response, error) { +func (a *DAGAPIService) ReparseDagFileExecute(r ApiReparseDagFileRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPut localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue TaskInstance + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGApiService.SetTaskInstanceNote") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGAPIService.ReparseDagFile") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/setNote" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", _neturl.PathEscape(parameterToString(r.dagRunId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", _neturl.PathEscape(parameterToString(r.taskId, "")), -1) + localVarPath := localBasePath + "/parseDagFile/{file_token}" + localVarPath = strings.Replace(localVarPath, "{"+"file_token"+"}", url.PathEscape(parameterValueToString(r.fileToken, "fileToken")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - if r.setTaskInstanceNote == nil { - return localVarReturnValue, nil, reportError("setTaskInstanceNote is required and must be specified") - } + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -1980,80 +1859,62 @@ func (a *DAGApiService) SetTaskInstanceNoteExecute(r DAGApiApiSetTaskInstanceNot if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.setTaskInstanceNote - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, nil, err + return nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v Error - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarHTTPResponse, nil } diff --git a/airflow/api_dag_run.go b/airflow/api_dag_run.go index 4369fdf..b827e6a 100644 --- a/airflow/api_dag_run.go +++ b/airflow/api_dag_run.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -30,37 +13,33 @@ package airflow import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" "strings" - "time" "reflect" + "time" ) -// Linger please -var ( - _ _context.Context -) -// DAGRunApiService DAGRunApi service -type DAGRunApiService service +// DAGRunAPIService DAGRunAPI service +type DAGRunAPIService service -type DAGRunApiApiClearDagRunRequest struct { - ctx _context.Context - ApiService *DAGRunApiService +type ApiClearDagRunRequest struct { + ctx context.Context + ApiService *DAGRunAPIService dagId string dagRunId string clearDagRun *ClearDagRun } -func (r DAGRunApiApiClearDagRunRequest) ClearDagRun(clearDagRun ClearDagRun) DAGRunApiApiClearDagRunRequest { +func (r ApiClearDagRunRequest) ClearDagRun(clearDagRun ClearDagRun) ApiClearDagRunRequest { r.clearDagRun = &clearDagRun return r } -func (r DAGRunApiApiClearDagRunRequest) Execute() (DAGRun, *_nethttp.Response, error) { +func (r ApiClearDagRunRequest) Execute() (*ClearDagRun200Response, *http.Response, error) { return r.ApiService.ClearDagRunExecute(r) } @@ -72,13 +51,13 @@ Clear a DAG run. *New in version 2.4.0* - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. @param dagRunId The DAG run ID. - @return DAGRunApiApiClearDagRunRequest + @return ApiClearDagRunRequest */ -func (a *DAGRunApiService) ClearDagRun(ctx _context.Context, dagId string, dagRunId string) DAGRunApiApiClearDagRunRequest { - return DAGRunApiApiClearDagRunRequest{ +func (a *DAGRunAPIService) ClearDagRun(ctx context.Context, dagId string, dagRunId string) ApiClearDagRunRequest { + return ApiClearDagRunRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -87,29 +66,27 @@ func (a *DAGRunApiService) ClearDagRun(ctx _context.Context, dagId string, dagRu } // Execute executes the request -// @return DAGRun -func (a *DAGRunApiService) ClearDagRunExecute(r DAGRunApiApiClearDagRunRequest) (DAGRun, *_nethttp.Response, error) { +// @return ClearDagRun200Response +func (a *DAGRunAPIService) ClearDagRunExecute(r ApiClearDagRunRequest) (*ClearDagRun200Response, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue DAGRun + formFiles []formFile + localVarReturnValue *ClearDagRun200Response ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGRunApiService.ClearDagRun") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGRunAPIService.ClearDagRun") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/clear" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", _neturl.PathEscape(parameterToString(r.dagRunId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.clearDagRun == nil { return localVarReturnValue, nil, reportError("clearDagRun is required and must be specified") } @@ -133,7 +110,7 @@ func (a *DAGRunApiService) ClearDagRunExecute(r DAGRunApiApiClearDagRunRequest) } // body params localVarPostBody = r.clearDagRun - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -143,15 +120,15 @@ func (a *DAGRunApiService) ClearDagRunExecute(r DAGRunApiApiClearDagRunRequest) return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -162,7 +139,8 @@ func (a *DAGRunApiService) ClearDagRunExecute(r DAGRunApiApiClearDagRunRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -172,7 +150,8 @@ func (a *DAGRunApiService) ClearDagRunExecute(r DAGRunApiApiClearDagRunRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -182,7 +161,8 @@ func (a *DAGRunApiService) ClearDagRunExecute(r DAGRunApiApiClearDagRunRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -192,14 +172,15 @@ func (a *DAGRunApiService) ClearDagRunExecute(r DAGRunApiApiClearDagRunRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -209,28 +190,27 @@ func (a *DAGRunApiService) ClearDagRunExecute(r DAGRunApiApiClearDagRunRequest) return localVarReturnValue, localVarHTTPResponse, nil } -type DAGRunApiApiDeleteDagRunRequest struct { - ctx _context.Context - ApiService *DAGRunApiService +type ApiDeleteDagRunRequest struct { + ctx context.Context + ApiService *DAGRunAPIService dagId string dagRunId string } - -func (r DAGRunApiApiDeleteDagRunRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeleteDagRunRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteDagRunExecute(r) } /* DeleteDagRun Delete a DAG run - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. @param dagRunId The DAG run ID. - @return DAGRunApiApiDeleteDagRunRequest + @return ApiDeleteDagRunRequest */ -func (a *DAGRunApiService) DeleteDagRun(ctx _context.Context, dagId string, dagRunId string) DAGRunApiApiDeleteDagRunRequest { - return DAGRunApiApiDeleteDagRunRequest{ +func (a *DAGRunAPIService) DeleteDagRun(ctx context.Context, dagId string, dagRunId string) ApiDeleteDagRunRequest { + return ApiDeleteDagRunRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -239,27 +219,25 @@ func (a *DAGRunApiService) DeleteDagRun(ctx _context.Context, dagId string, dagR } // Execute executes the request -func (a *DAGRunApiService) DeleteDagRunExecute(r DAGRunApiApiDeleteDagRunRequest) (*_nethttp.Response, error) { +func (a *DAGRunAPIService) DeleteDagRunExecute(r ApiDeleteDagRunRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGRunApiService.DeleteDagRun") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGRunAPIService.DeleteDagRun") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", _neturl.PathEscape(parameterToString(r.dagRunId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -278,7 +256,7 @@ func (a *DAGRunApiService) DeleteDagRunExecute(r DAGRunApiApiDeleteDagRunRequest if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -288,15 +266,15 @@ func (a *DAGRunApiService) DeleteDagRunExecute(r DAGRunApiApiDeleteDagRunRequest return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -307,7 +285,8 @@ func (a *DAGRunApiService) DeleteDagRunExecute(r DAGRunApiApiDeleteDagRunRequest newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -317,7 +296,8 @@ func (a *DAGRunApiService) DeleteDagRunExecute(r DAGRunApiApiDeleteDagRunRequest newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -327,7 +307,8 @@ func (a *DAGRunApiService) DeleteDagRunExecute(r DAGRunApiApiDeleteDagRunRequest newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -337,7 +318,8 @@ func (a *DAGRunApiService) DeleteDagRunExecute(r DAGRunApiApiDeleteDagRunRequest newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -345,28 +327,34 @@ func (a *DAGRunApiService) DeleteDagRunExecute(r DAGRunApiApiDeleteDagRunRequest return localVarHTTPResponse, nil } -type DAGRunApiApiGetDagRunRequest struct { - ctx _context.Context - ApiService *DAGRunApiService +type ApiGetDagRunRequest struct { + ctx context.Context + ApiService *DAGRunAPIService dagId string dagRunId string + fields *[]string } +// List of field for return. +func (r ApiGetDagRunRequest) Fields(fields []string) ApiGetDagRunRequest { + r.fields = &fields + return r +} -func (r DAGRunApiApiGetDagRunRequest) Execute() (DAGRun, *_nethttp.Response, error) { +func (r ApiGetDagRunRequest) Execute() (*DAGRun, *http.Response, error) { return r.ApiService.GetDagRunExecute(r) } /* GetDagRun Get a DAG run - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. @param dagRunId The DAG run ID. - @return DAGRunApiApiGetDagRunRequest + @return ApiGetDagRunRequest */ -func (a *DAGRunApiService) GetDagRun(ctx _context.Context, dagId string, dagRunId string) DAGRunApiApiGetDagRunRequest { - return DAGRunApiApiGetDagRunRequest{ +func (a *DAGRunAPIService) GetDagRun(ctx context.Context, dagId string, dagRunId string) ApiGetDagRunRequest { + return ApiGetDagRunRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -376,29 +364,38 @@ func (a *DAGRunApiService) GetDagRun(ctx _context.Context, dagId string, dagRunI // Execute executes the request // @return DAGRun -func (a *DAGRunApiService) GetDagRunExecute(r DAGRunApiApiGetDagRunRequest) (DAGRun, *_nethttp.Response, error) { +func (a *DAGRunAPIService) GetDagRunExecute(r ApiGetDagRunRequest) (*DAGRun, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue DAGRun + formFiles []formFile + localVarReturnValue *DAGRun ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGRunApiService.GetDagRun") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGRunAPIService.GetDagRun") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", _neturl.PathEscape(parameterToString(r.dagRunId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.fields != nil { + t := *r.fields + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "fields", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "fields", t, "form", "multi") + } + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -416,7 +413,7 @@ func (a *DAGRunApiService) GetDagRunExecute(r DAGRunApiApiGetDagRunRequest) (DAG if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -426,15 +423,15 @@ func (a *DAGRunApiService) GetDagRunExecute(r DAGRunApiApiGetDagRunRequest) (DAG return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -445,7 +442,8 @@ func (a *DAGRunApiService) GetDagRunExecute(r DAGRunApiApiGetDagRunRequest) (DAG newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -455,7 +453,8 @@ func (a *DAGRunApiService) GetDagRunExecute(r DAGRunApiApiGetDagRunRequest) (DAG newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -465,14 +464,15 @@ func (a *DAGRunApiService) GetDagRunExecute(r DAGRunApiApiGetDagRunRequest) (DAG newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -482,9 +482,9 @@ func (a *DAGRunApiService) GetDagRunExecute(r DAGRunApiApiGetDagRunRequest) (DAG return localVarReturnValue, localVarHTTPResponse, nil } -type DAGRunApiApiGetDagRunsRequest struct { - ctx _context.Context - ApiService *DAGRunApiService +type ApiGetDagRunsRequest struct { + ctx context.Context + ApiService *DAGRunAPIService dagId string limit *int32 offset *int32 @@ -494,62 +494,92 @@ type DAGRunApiApiGetDagRunsRequest struct { startDateLte *time.Time endDateGte *time.Time endDateLte *time.Time + updatedAtGte *time.Time + updatedAtLte *time.Time state *[]string orderBy *string + fields *[]string } // The numbers of items to return. -func (r DAGRunApiApiGetDagRunsRequest) Limit(limit int32) DAGRunApiApiGetDagRunsRequest { +func (r ApiGetDagRunsRequest) Limit(limit int32) ApiGetDagRunsRequest { r.limit = &limit return r } + // The number of items to skip before starting to collect the result set. -func (r DAGRunApiApiGetDagRunsRequest) Offset(offset int32) DAGRunApiApiGetDagRunsRequest { +func (r ApiGetDagRunsRequest) Offset(offset int32) ApiGetDagRunsRequest { r.offset = &offset return r } + // Returns objects greater or equal to the specified date. This can be combined with execution_date_lte parameter to receive only the selected period. -func (r DAGRunApiApiGetDagRunsRequest) ExecutionDateGte(executionDateGte time.Time) DAGRunApiApiGetDagRunsRequest { +func (r ApiGetDagRunsRequest) ExecutionDateGte(executionDateGte time.Time) ApiGetDagRunsRequest { r.executionDateGte = &executionDateGte return r } + // Returns objects less than or equal to the specified date. This can be combined with execution_date_gte parameter to receive only the selected period. -func (r DAGRunApiApiGetDagRunsRequest) ExecutionDateLte(executionDateLte time.Time) DAGRunApiApiGetDagRunsRequest { +func (r ApiGetDagRunsRequest) ExecutionDateLte(executionDateLte time.Time) ApiGetDagRunsRequest { r.executionDateLte = &executionDateLte return r } + // Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. -func (r DAGRunApiApiGetDagRunsRequest) StartDateGte(startDateGte time.Time) DAGRunApiApiGetDagRunsRequest { +func (r ApiGetDagRunsRequest) StartDateGte(startDateGte time.Time) ApiGetDagRunsRequest { r.startDateGte = &startDateGte return r } + // Returns objects less or equal the specified date. This can be combined with start_date_gte parameter to receive only the selected period. -func (r DAGRunApiApiGetDagRunsRequest) StartDateLte(startDateLte time.Time) DAGRunApiApiGetDagRunsRequest { +func (r ApiGetDagRunsRequest) StartDateLte(startDateLte time.Time) ApiGetDagRunsRequest { r.startDateLte = &startDateLte return r } + // Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. -func (r DAGRunApiApiGetDagRunsRequest) EndDateGte(endDateGte time.Time) DAGRunApiApiGetDagRunsRequest { +func (r ApiGetDagRunsRequest) EndDateGte(endDateGte time.Time) ApiGetDagRunsRequest { r.endDateGte = &endDateGte return r } + // Returns objects less than or equal to the specified date. This can be combined with start_date_gte parameter to receive only the selected period. -func (r DAGRunApiApiGetDagRunsRequest) EndDateLte(endDateLte time.Time) DAGRunApiApiGetDagRunsRequest { +func (r ApiGetDagRunsRequest) EndDateLte(endDateLte time.Time) ApiGetDagRunsRequest { r.endDateLte = &endDateLte return r } + +// Returns objects greater or equal the specified date. This can be combined with updated_at_lte parameter to receive only the selected period. *New in version 2.6.0* +func (r ApiGetDagRunsRequest) UpdatedAtGte(updatedAtGte time.Time) ApiGetDagRunsRequest { + r.updatedAtGte = &updatedAtGte + return r +} + +// Returns objects less or equal the specified date. This can be combined with updated_at_gte parameter to receive only the selected period. *New in version 2.6.0* +func (r ApiGetDagRunsRequest) UpdatedAtLte(updatedAtLte time.Time) ApiGetDagRunsRequest { + r.updatedAtLte = &updatedAtLte + return r +} + // The value can be repeated to retrieve multiple matching values (OR condition). -func (r DAGRunApiApiGetDagRunsRequest) State(state []string) DAGRunApiApiGetDagRunsRequest { +func (r ApiGetDagRunsRequest) State(state []string) ApiGetDagRunsRequest { r.state = &state return r } + // The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* -func (r DAGRunApiApiGetDagRunsRequest) OrderBy(orderBy string) DAGRunApiApiGetDagRunsRequest { +func (r ApiGetDagRunsRequest) OrderBy(orderBy string) ApiGetDagRunsRequest { r.orderBy = &orderBy return r } -func (r DAGRunApiApiGetDagRunsRequest) Execute() (DAGRunCollection, *_nethttp.Response, error) { +// List of field for return. +func (r ApiGetDagRunsRequest) Fields(fields []string) ApiGetDagRunsRequest { + r.fields = &fields + return r +} + +func (r ApiGetDagRunsRequest) Execute() (*DAGRunCollection, *http.Response, error) { return r.ApiService.GetDagRunsExecute(r) } @@ -559,12 +589,12 @@ GetDagRuns List DAG runs This endpoint allows specifying `~` as the dag_id to retrieve DAG runs for all DAGs. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. - @return DAGRunApiApiGetDagRunsRequest + @return ApiGetDagRunsRequest */ -func (a *DAGRunApiService) GetDagRuns(ctx _context.Context, dagId string) DAGRunApiApiGetDagRunsRequest { - return DAGRunApiApiGetDagRunsRequest{ +func (a *DAGRunAPIService) GetDagRuns(ctx context.Context, dagId string) ApiGetDagRunsRequest { + return ApiGetDagRunsRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -573,65 +603,83 @@ func (a *DAGRunApiService) GetDagRuns(ctx _context.Context, dagId string) DAGRun // Execute executes the request // @return DAGRunCollection -func (a *DAGRunApiService) GetDagRunsExecute(r DAGRunApiApiGetDagRunsRequest) (DAGRunCollection, *_nethttp.Response, error) { +func (a *DAGRunAPIService) GetDagRunsExecute(r ApiGetDagRunsRequest) (*DAGRunCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue DAGRunCollection + formFiles []formFile + localVarReturnValue *DAGRunCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGRunApiService.GetDagRuns") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGRunAPIService.GetDagRuns") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}/dagRuns" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue } if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") } if r.executionDateGte != nil { - localVarQueryParams.Add("execution_date_gte", parameterToString(*r.executionDateGte, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "execution_date_gte", r.executionDateGte, "form", "") } if r.executionDateLte != nil { - localVarQueryParams.Add("execution_date_lte", parameterToString(*r.executionDateLte, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "execution_date_lte", r.executionDateLte, "form", "") } if r.startDateGte != nil { - localVarQueryParams.Add("start_date_gte", parameterToString(*r.startDateGte, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "start_date_gte", r.startDateGte, "form", "") } if r.startDateLte != nil { - localVarQueryParams.Add("start_date_lte", parameterToString(*r.startDateLte, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "start_date_lte", r.startDateLte, "form", "") } if r.endDateGte != nil { - localVarQueryParams.Add("end_date_gte", parameterToString(*r.endDateGte, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "end_date_gte", r.endDateGte, "form", "") } if r.endDateLte != nil { - localVarQueryParams.Add("end_date_lte", parameterToString(*r.endDateLte, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "end_date_lte", r.endDateLte, "form", "") + } + if r.updatedAtGte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_at_gte", r.updatedAtGte, "form", "") + } + if r.updatedAtLte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_at_lte", r.updatedAtLte, "form", "") } if r.state != nil { t := *r.state if reflect.TypeOf(t).Kind() == reflect.Slice { s := reflect.ValueOf(t) for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("state", parameterToString(s.Index(i), "multi")) + parameterAddToHeaderOrQuery(localVarQueryParams, "state", s.Index(i).Interface(), "form", "multi") } } else { - localVarQueryParams.Add("state", parameterToString(t, "multi")) + parameterAddToHeaderOrQuery(localVarQueryParams, "state", t, "form", "multi") } } if r.orderBy != nil { - localVarQueryParams.Add("order_by", parameterToString(*r.orderBy, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "order_by", r.orderBy, "form", "") + } + if r.fields != nil { + t := *r.fields + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "fields", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "fields", t, "form", "multi") + } } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -650,7 +698,7 @@ func (a *DAGRunApiService) GetDagRunsExecute(r DAGRunApiApiGetDagRunsRequest) (D if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -660,15 +708,15 @@ func (a *DAGRunApiService) GetDagRunsExecute(r DAGRunApiApiGetDagRunsRequest) (D return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -679,14 +727,15 @@ func (a *DAGRunApiService) GetDagRunsExecute(r DAGRunApiApiGetDagRunsRequest) (D newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -696,18 +745,18 @@ func (a *DAGRunApiService) GetDagRunsExecute(r DAGRunApiApiGetDagRunsRequest) (D return localVarReturnValue, localVarHTTPResponse, nil } -type DAGRunApiApiGetDagRunsBatchRequest struct { - ctx _context.Context - ApiService *DAGRunApiService +type ApiGetDagRunsBatchRequest struct { + ctx context.Context + ApiService *DAGRunAPIService listDagRunsForm *ListDagRunsForm } -func (r DAGRunApiApiGetDagRunsBatchRequest) ListDagRunsForm(listDagRunsForm ListDagRunsForm) DAGRunApiApiGetDagRunsBatchRequest { +func (r ApiGetDagRunsBatchRequest) ListDagRunsForm(listDagRunsForm ListDagRunsForm) ApiGetDagRunsBatchRequest { r.listDagRunsForm = &listDagRunsForm return r } -func (r DAGRunApiApiGetDagRunsBatchRequest) Execute() (DAGRunCollection, *_nethttp.Response, error) { +func (r ApiGetDagRunsBatchRequest) Execute() (*DAGRunCollection, *http.Response, error) { return r.ApiService.GetDagRunsBatchExecute(r) } @@ -717,11 +766,11 @@ GetDagRunsBatch List DAG runs (batch) This endpoint is a POST to allow filtering across a large number of DAG IDs, where as a GET it would run in to maximum HTTP request URL length limit. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return DAGRunApiApiGetDagRunsBatchRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetDagRunsBatchRequest */ -func (a *DAGRunApiService) GetDagRunsBatch(ctx _context.Context) DAGRunApiApiGetDagRunsBatchRequest { - return DAGRunApiApiGetDagRunsBatchRequest{ +func (a *DAGRunAPIService) GetDagRunsBatch(ctx context.Context) ApiGetDagRunsBatchRequest { + return ApiGetDagRunsBatchRequest{ ApiService: a, ctx: ctx, } @@ -729,26 +778,24 @@ func (a *DAGRunApiService) GetDagRunsBatch(ctx _context.Context) DAGRunApiApiGet // Execute executes the request // @return DAGRunCollection -func (a *DAGRunApiService) GetDagRunsBatchExecute(r DAGRunApiApiGetDagRunsBatchRequest) (DAGRunCollection, *_nethttp.Response, error) { +func (a *DAGRunAPIService) GetDagRunsBatchExecute(r ApiGetDagRunsBatchRequest) (*DAGRunCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue DAGRunCollection + formFiles []formFile + localVarReturnValue *DAGRunCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGRunApiService.GetDagRunsBatch") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGRunAPIService.GetDagRunsBatch") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/~/dagRuns/list" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.listDagRunsForm == nil { return localVarReturnValue, nil, reportError("listDagRunsForm is required and must be specified") } @@ -772,7 +819,7 @@ func (a *DAGRunApiService) GetDagRunsBatchExecute(r DAGRunApiApiGetDagRunsBatchR } // body params localVarPostBody = r.listDagRunsForm - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -782,15 +829,15 @@ func (a *DAGRunApiService) GetDagRunsBatchExecute(r DAGRunApiApiGetDagRunsBatchR return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -801,7 +848,8 @@ func (a *DAGRunApiService) GetDagRunsBatchExecute(r DAGRunApiApiGetDagRunsBatchR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -811,7 +859,8 @@ func (a *DAGRunApiService) GetDagRunsBatchExecute(r DAGRunApiApiGetDagRunsBatchR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -821,14 +870,15 @@ func (a *DAGRunApiService) GetDagRunsBatchExecute(r DAGRunApiApiGetDagRunsBatchR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -838,15 +888,14 @@ func (a *DAGRunApiService) GetDagRunsBatchExecute(r DAGRunApiApiGetDagRunsBatchR return localVarReturnValue, localVarHTTPResponse, nil } -type DAGRunApiApiGetUpstreamDatasetEventsRequest struct { - ctx _context.Context - ApiService *DAGRunApiService +type ApiGetUpstreamDatasetEventsRequest struct { + ctx context.Context + ApiService *DAGRunAPIService dagId string dagRunId string } - -func (r DAGRunApiApiGetUpstreamDatasetEventsRequest) Execute() (DatasetEventCollection, *_nethttp.Response, error) { +func (r ApiGetUpstreamDatasetEventsRequest) Execute() (*DatasetEventCollection, *http.Response, error) { return r.ApiService.GetUpstreamDatasetEventsExecute(r) } @@ -858,13 +907,13 @@ Get datasets for a dag run. *New in version 2.4.0* - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. @param dagRunId The DAG run ID. - @return DAGRunApiApiGetUpstreamDatasetEventsRequest + @return ApiGetUpstreamDatasetEventsRequest */ -func (a *DAGRunApiService) GetUpstreamDatasetEvents(ctx _context.Context, dagId string, dagRunId string) DAGRunApiApiGetUpstreamDatasetEventsRequest { - return DAGRunApiApiGetUpstreamDatasetEventsRequest{ +func (a *DAGRunAPIService) GetUpstreamDatasetEvents(ctx context.Context, dagId string, dagRunId string) ApiGetUpstreamDatasetEventsRequest { + return ApiGetUpstreamDatasetEventsRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -874,28 +923,26 @@ func (a *DAGRunApiService) GetUpstreamDatasetEvents(ctx _context.Context, dagId // Execute executes the request // @return DatasetEventCollection -func (a *DAGRunApiService) GetUpstreamDatasetEventsExecute(r DAGRunApiApiGetUpstreamDatasetEventsRequest) (DatasetEventCollection, *_nethttp.Response, error) { +func (a *DAGRunAPIService) GetUpstreamDatasetEventsExecute(r ApiGetUpstreamDatasetEventsRequest) (*DatasetEventCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue DatasetEventCollection + formFiles []formFile + localVarReturnValue *DatasetEventCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGRunApiService.GetUpstreamDatasetEvents") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGRunAPIService.GetUpstreamDatasetEvents") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/upstreamDatasetEvents" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", _neturl.PathEscape(parameterToString(r.dagRunId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -914,7 +961,7 @@ func (a *DAGRunApiService) GetUpstreamDatasetEventsExecute(r DAGRunApiApiGetUpst if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -924,15 +971,15 @@ func (a *DAGRunApiService) GetUpstreamDatasetEventsExecute(r DAGRunApiApiGetUpst return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -943,7 +990,8 @@ func (a *DAGRunApiService) GetUpstreamDatasetEventsExecute(r DAGRunApiApiGetUpst newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -953,7 +1001,8 @@ func (a *DAGRunApiService) GetUpstreamDatasetEventsExecute(r DAGRunApiApiGetUpst newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -963,14 +1012,15 @@ func (a *DAGRunApiService) GetUpstreamDatasetEventsExecute(r DAGRunApiApiGetUpst newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -980,31 +1030,34 @@ func (a *DAGRunApiService) GetUpstreamDatasetEventsExecute(r DAGRunApiApiGetUpst return localVarReturnValue, localVarHTTPResponse, nil } -type DAGRunApiApiPostDagRunRequest struct { - ctx _context.Context - ApiService *DAGRunApiService +type ApiPostDagRunRequest struct { + ctx context.Context + ApiService *DAGRunAPIService dagId string dAGRun *DAGRun } -func (r DAGRunApiApiPostDagRunRequest) DAGRun(dAGRun DAGRun) DAGRunApiApiPostDagRunRequest { +func (r ApiPostDagRunRequest) DAGRun(dAGRun DAGRun) ApiPostDagRunRequest { r.dAGRun = &dAGRun return r } -func (r DAGRunApiApiPostDagRunRequest) Execute() (DAGRun, *_nethttp.Response, error) { +func (r ApiPostDagRunRequest) Execute() (*DAGRun, *http.Response, error) { return r.ApiService.PostDagRunExecute(r) } /* -PostDagRun Trigger a new DAG run +PostDagRun Trigger a new DAG run. + +This will initiate a dagrun. If DAG is paused then dagrun state will remain queued, and the task won't run. + - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. - @return DAGRunApiApiPostDagRunRequest + @return ApiPostDagRunRequest */ -func (a *DAGRunApiService) PostDagRun(ctx _context.Context, dagId string) DAGRunApiApiPostDagRunRequest { - return DAGRunApiApiPostDagRunRequest{ +func (a *DAGRunAPIService) PostDagRun(ctx context.Context, dagId string) ApiPostDagRunRequest { + return ApiPostDagRunRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -1013,27 +1066,25 @@ func (a *DAGRunApiService) PostDagRun(ctx _context.Context, dagId string) DAGRun // Execute executes the request // @return DAGRun -func (a *DAGRunApiService) PostDagRunExecute(r DAGRunApiApiPostDagRunRequest) (DAGRun, *_nethttp.Response, error) { +func (a *DAGRunAPIService) PostDagRunExecute(r ApiPostDagRunRequest) (*DAGRun, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue DAGRun + formFiles []formFile + localVarReturnValue *DAGRun ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGRunApiService.PostDagRun") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGRunAPIService.PostDagRun") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}/dagRuns" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.dAGRun == nil { return localVarReturnValue, nil, reportError("dAGRun is required and must be specified") } @@ -1057,7 +1108,7 @@ func (a *DAGRunApiService) PostDagRunExecute(r DAGRunApiApiPostDagRunRequest) (D } // body params localVarPostBody = r.dAGRun - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1067,15 +1118,15 @@ func (a *DAGRunApiService) PostDagRunExecute(r DAGRunApiApiPostDagRunRequest) (D return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1086,7 +1137,8 @@ func (a *DAGRunApiService) PostDagRunExecute(r DAGRunApiApiPostDagRunRequest) (D newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1096,44 +1148,48 @@ func (a *DAGRunApiService) PostDagRunExecute(r DAGRunApiApiPostDagRunRequest) (D newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } - if localVarHTTPResponse.StatusCode == 409 { + if localVarHTTPResponse.StatusCode == 403 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } - if localVarHTTPResponse.StatusCode == 403 { + if localVarHTTPResponse.StatusCode == 404 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } - if localVarHTTPResponse.StatusCode == 404 { + if localVarHTTPResponse.StatusCode == 409 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1143,21 +1199,21 @@ func (a *DAGRunApiService) PostDagRunExecute(r DAGRunApiApiPostDagRunRequest) (D return localVarReturnValue, localVarHTTPResponse, nil } -type DAGRunApiApiSetDagRunNoteRequest struct { - ctx _context.Context - ApiService *DAGRunApiService +type ApiSetDagRunNoteRequest struct { + ctx context.Context + ApiService *DAGRunAPIService dagId string dagRunId string setDagRunNote *SetDagRunNote } // Parameters of set DagRun note. -func (r DAGRunApiApiSetDagRunNoteRequest) SetDagRunNote(setDagRunNote SetDagRunNote) DAGRunApiApiSetDagRunNoteRequest { +func (r ApiSetDagRunNoteRequest) SetDagRunNote(setDagRunNote SetDagRunNote) ApiSetDagRunNoteRequest { r.setDagRunNote = &setDagRunNote return r } -func (r DAGRunApiApiSetDagRunNoteRequest) Execute() (DAGRun, *_nethttp.Response, error) { +func (r ApiSetDagRunNoteRequest) Execute() (*DAGRun, *http.Response, error) { return r.ApiService.SetDagRunNoteExecute(r) } @@ -1169,13 +1225,13 @@ Update the manual user note of a DagRun. *New in version 2.5.0* - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. @param dagRunId The DAG run ID. - @return DAGRunApiApiSetDagRunNoteRequest + @return ApiSetDagRunNoteRequest */ -func (a *DAGRunApiService) SetDagRunNote(ctx _context.Context, dagId string, dagRunId string) DAGRunApiApiSetDagRunNoteRequest { - return DAGRunApiApiSetDagRunNoteRequest{ +func (a *DAGRunAPIService) SetDagRunNote(ctx context.Context, dagId string, dagRunId string) ApiSetDagRunNoteRequest { + return ApiSetDagRunNoteRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -1185,28 +1241,26 @@ func (a *DAGRunApiService) SetDagRunNote(ctx _context.Context, dagId string, dag // Execute executes the request // @return DAGRun -func (a *DAGRunApiService) SetDagRunNoteExecute(r DAGRunApiApiSetDagRunNoteRequest) (DAGRun, *_nethttp.Response, error) { +func (a *DAGRunAPIService) SetDagRunNoteExecute(r ApiSetDagRunNoteRequest) (*DAGRun, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue DAGRun + formFiles []formFile + localVarReturnValue *DAGRun ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGRunApiService.SetDagRunNote") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGRunAPIService.SetDagRunNote") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/setNote" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", _neturl.PathEscape(parameterToString(r.dagRunId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.setDagRunNote == nil { return localVarReturnValue, nil, reportError("setDagRunNote is required and must be specified") } @@ -1230,7 +1284,7 @@ func (a *DAGRunApiService) SetDagRunNoteExecute(r DAGRunApiApiSetDagRunNoteReque } // body params localVarPostBody = r.setDagRunNote - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1240,15 +1294,15 @@ func (a *DAGRunApiService) SetDagRunNoteExecute(r DAGRunApiApiSetDagRunNoteReque return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1259,7 +1313,8 @@ func (a *DAGRunApiService) SetDagRunNoteExecute(r DAGRunApiApiSetDagRunNoteReque newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1269,7 +1324,8 @@ func (a *DAGRunApiService) SetDagRunNoteExecute(r DAGRunApiApiSetDagRunNoteReque newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1279,7 +1335,8 @@ func (a *DAGRunApiService) SetDagRunNoteExecute(r DAGRunApiApiSetDagRunNoteReque newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1289,14 +1346,15 @@ func (a *DAGRunApiService) SetDagRunNoteExecute(r DAGRunApiApiSetDagRunNoteReque newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1306,20 +1364,20 @@ func (a *DAGRunApiService) SetDagRunNoteExecute(r DAGRunApiApiSetDagRunNoteReque return localVarReturnValue, localVarHTTPResponse, nil } -type DAGRunApiApiUpdateDagRunStateRequest struct { - ctx _context.Context - ApiService *DAGRunApiService +type ApiUpdateDagRunStateRequest struct { + ctx context.Context + ApiService *DAGRunAPIService dagId string dagRunId string updateDagRunState *UpdateDagRunState } -func (r DAGRunApiApiUpdateDagRunStateRequest) UpdateDagRunState(updateDagRunState UpdateDagRunState) DAGRunApiApiUpdateDagRunStateRequest { +func (r ApiUpdateDagRunStateRequest) UpdateDagRunState(updateDagRunState UpdateDagRunState) ApiUpdateDagRunStateRequest { r.updateDagRunState = &updateDagRunState return r } -func (r DAGRunApiApiUpdateDagRunStateRequest) Execute() (DAGRun, *_nethttp.Response, error) { +func (r ApiUpdateDagRunStateRequest) Execute() (*DAGRun, *http.Response, error) { return r.ApiService.UpdateDagRunStateExecute(r) } @@ -1331,13 +1389,13 @@ Modify a DAG run. *New in version 2.2.0* - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. @param dagRunId The DAG run ID. - @return DAGRunApiApiUpdateDagRunStateRequest + @return ApiUpdateDagRunStateRequest */ -func (a *DAGRunApiService) UpdateDagRunState(ctx _context.Context, dagId string, dagRunId string) DAGRunApiApiUpdateDagRunStateRequest { - return DAGRunApiApiUpdateDagRunStateRequest{ +func (a *DAGRunAPIService) UpdateDagRunState(ctx context.Context, dagId string, dagRunId string) ApiUpdateDagRunStateRequest { + return ApiUpdateDagRunStateRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -1347,28 +1405,26 @@ func (a *DAGRunApiService) UpdateDagRunState(ctx _context.Context, dagId string, // Execute executes the request // @return DAGRun -func (a *DAGRunApiService) UpdateDagRunStateExecute(r DAGRunApiApiUpdateDagRunStateRequest) (DAGRun, *_nethttp.Response, error) { +func (a *DAGRunAPIService) UpdateDagRunStateExecute(r ApiUpdateDagRunStateRequest) (*DAGRun, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue DAGRun + formFiles []formFile + localVarReturnValue *DAGRun ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGRunApiService.UpdateDagRunState") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DAGRunAPIService.UpdateDagRunState") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", _neturl.PathEscape(parameterToString(r.dagRunId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.updateDagRunState == nil { return localVarReturnValue, nil, reportError("updateDagRunState is required and must be specified") } @@ -1392,7 +1448,7 @@ func (a *DAGRunApiService) UpdateDagRunStateExecute(r DAGRunApiApiUpdateDagRunSt } // body params localVarPostBody = r.updateDagRunState - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1402,15 +1458,15 @@ func (a *DAGRunApiService) UpdateDagRunStateExecute(r DAGRunApiApiUpdateDagRunSt return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1421,7 +1477,8 @@ func (a *DAGRunApiService) UpdateDagRunStateExecute(r DAGRunApiApiUpdateDagRunSt newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -1431,7 +1488,8 @@ func (a *DAGRunApiService) UpdateDagRunStateExecute(r DAGRunApiApiUpdateDagRunSt newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1441,7 +1499,8 @@ func (a *DAGRunApiService) UpdateDagRunStateExecute(r DAGRunApiApiUpdateDagRunSt newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1451,14 +1510,15 @@ func (a *DAGRunApiService) UpdateDagRunStateExecute(r DAGRunApiApiUpdateDagRunSt newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/airflow/api_dag_stats.go b/airflow/api_dag_stats.go new file mode 100644 index 0000000..73b66f1 --- /dev/null +++ b/airflow/api_dag_stats.go @@ -0,0 +1,153 @@ +/* +Airflow API (Stable) + +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. + +API version: 2.10.5 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package airflow + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// DagStatsAPIService DagStatsAPI service +type DagStatsAPIService service + +type ApiGetDagStatsRequest struct { + ctx context.Context + ApiService *DagStatsAPIService + dagIds *string +} + +// One or more DAG IDs separated by commas to filter relevant Dags. +func (r ApiGetDagStatsRequest) DagIds(dagIds string) ApiGetDagStatsRequest { + r.dagIds = &dagIds + return r +} + +func (r ApiGetDagStatsRequest) Execute() (*DagStatsCollectionSchema, *http.Response, error) { + return r.ApiService.GetDagStatsExecute(r) +} + +/* +GetDagStats List Dag statistics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetDagStatsRequest +*/ +func (a *DagStatsAPIService) GetDagStats(ctx context.Context) ApiGetDagStatsRequest { + return ApiGetDagStatsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DagStatsCollectionSchema +func (a *DagStatsAPIService) GetDagStatsExecute(r ApiGetDagStatsRequest) (*DagStatsCollectionSchema, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DagStatsCollectionSchema + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DagStatsAPIService.GetDagStats") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/dagStats" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.dagIds == nil { + return localVarReturnValue, nil, reportError("dagIds is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "dag_ids", r.dagIds, "form", "") + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/airflow/api_dag_warning.go b/airflow/api_dag_warning.go index c36d9a3..e162340 100644 --- a/airflow/api_dag_warning.go +++ b/airflow/api_dag_warning.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -30,23 +13,19 @@ package airflow import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" ) -// Linger please -var ( - _ _context.Context -) -// DagWarningApiService DagWarningApi service -type DagWarningApiService service +// DagWarningAPIService DagWarningAPI service +type DagWarningAPIService service -type DagWarningApiApiGetDagWarningsRequest struct { - ctx _context.Context - ApiService *DagWarningApiService +type ApiGetDagWarningsRequest struct { + ctx context.Context + ApiService *DagWarningAPIService dagId *string warningType *string limit *int32 @@ -55,43 +34,47 @@ type DagWarningApiApiGetDagWarningsRequest struct { } // If set, only return DAG warnings with this dag_id. -func (r DagWarningApiApiGetDagWarningsRequest) DagId(dagId string) DagWarningApiApiGetDagWarningsRequest { +func (r ApiGetDagWarningsRequest) DagId(dagId string) ApiGetDagWarningsRequest { r.dagId = &dagId return r } + // If set, only return DAG warnings with this type. -func (r DagWarningApiApiGetDagWarningsRequest) WarningType(warningType string) DagWarningApiApiGetDagWarningsRequest { +func (r ApiGetDagWarningsRequest) WarningType(warningType string) ApiGetDagWarningsRequest { r.warningType = &warningType return r } + // The numbers of items to return. -func (r DagWarningApiApiGetDagWarningsRequest) Limit(limit int32) DagWarningApiApiGetDagWarningsRequest { +func (r ApiGetDagWarningsRequest) Limit(limit int32) ApiGetDagWarningsRequest { r.limit = &limit return r } + // The number of items to skip before starting to collect the result set. -func (r DagWarningApiApiGetDagWarningsRequest) Offset(offset int32) DagWarningApiApiGetDagWarningsRequest { +func (r ApiGetDagWarningsRequest) Offset(offset int32) ApiGetDagWarningsRequest { r.offset = &offset return r } + // The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* -func (r DagWarningApiApiGetDagWarningsRequest) OrderBy(orderBy string) DagWarningApiApiGetDagWarningsRequest { +func (r ApiGetDagWarningsRequest) OrderBy(orderBy string) ApiGetDagWarningsRequest { r.orderBy = &orderBy return r } -func (r DagWarningApiApiGetDagWarningsRequest) Execute() (DagWarningCollection, *_nethttp.Response, error) { +func (r ApiGetDagWarningsRequest) Execute() (*DagWarningCollection, *http.Response, error) { return r.ApiService.GetDagWarningsExecute(r) } /* GetDagWarnings List dag warnings - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return DagWarningApiApiGetDagWarningsRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetDagWarningsRequest */ -func (a *DagWarningApiService) GetDagWarnings(ctx _context.Context) DagWarningApiApiGetDagWarningsRequest { - return DagWarningApiApiGetDagWarningsRequest{ +func (a *DagWarningAPIService) GetDagWarnings(ctx context.Context) ApiGetDagWarningsRequest { + return ApiGetDagWarningsRequest{ ApiService: a, ctx: ctx, } @@ -99,41 +82,42 @@ func (a *DagWarningApiService) GetDagWarnings(ctx _context.Context) DagWarningAp // Execute executes the request // @return DagWarningCollection -func (a *DagWarningApiService) GetDagWarningsExecute(r DagWarningApiApiGetDagWarningsRequest) (DagWarningCollection, *_nethttp.Response, error) { +func (a *DagWarningAPIService) GetDagWarningsExecute(r ApiGetDagWarningsRequest) (*DagWarningCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue DagWarningCollection + formFiles []formFile + localVarReturnValue *DagWarningCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DagWarningApiService.GetDagWarnings") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DagWarningAPIService.GetDagWarnings") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dagWarnings" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.dagId != nil { - localVarQueryParams.Add("dag_id", parameterToString(*r.dagId, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "dag_id", r.dagId, "form", "") } if r.warningType != nil { - localVarQueryParams.Add("warning_type", parameterToString(*r.warningType, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "warning_type", r.warningType, "form", "") } if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue } if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") } if r.orderBy != nil { - localVarQueryParams.Add("order_by", parameterToString(*r.orderBy, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "order_by", r.orderBy, "form", "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -152,7 +136,7 @@ func (a *DagWarningApiService) GetDagWarningsExecute(r DagWarningApiApiGetDagWar if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -162,15 +146,15 @@ func (a *DagWarningApiService) GetDagWarningsExecute(r DagWarningApiApiGetDagWar return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -181,7 +165,8 @@ func (a *DagWarningApiService) GetDagWarningsExecute(r DagWarningApiApiGetDagWar newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -191,14 +176,15 @@ func (a *DagWarningApiService) GetDagWarningsExecute(r DagWarningApiApiGetDagWar newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/airflow/api_dataset.go b/airflow/api_dataset.go index 29631a5..ae5732e 100644 --- a/airflow/api_dataset.go +++ b/airflow/api_dataset.go @@ -1,58 +1,938 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. +/* +Airflow API (Stable) + +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. + +API version: 2.10.5 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package airflow + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + "time" +) + + +// DatasetAPIService DatasetAPI service +type DatasetAPIService service + +type ApiCreateDatasetEventRequest struct { + ctx context.Context + ApiService *DatasetAPIService + createDatasetEvent *CreateDatasetEvent +} + +func (r ApiCreateDatasetEventRequest) CreateDatasetEvent(createDatasetEvent CreateDatasetEvent) ApiCreateDatasetEventRequest { + r.createDatasetEvent = &createDatasetEvent + return r +} + +func (r ApiCreateDatasetEventRequest) Execute() (*DatasetEvent, *http.Response, error) { + return r.ApiService.CreateDatasetEventExecute(r) +} + +/* +CreateDatasetEvent Create dataset event + +Create dataset event + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateDatasetEventRequest +*/ +func (a *DatasetAPIService) CreateDatasetEvent(ctx context.Context) ApiCreateDatasetEventRequest { + return ApiCreateDatasetEventRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return DatasetEvent +func (a *DatasetAPIService) CreateDatasetEventExecute(r ApiCreateDatasetEventRequest) (*DatasetEvent, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DatasetEvent + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DatasetAPIService.CreateDatasetEvent") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datasets/events" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createDatasetEvent == nil { + return localVarReturnValue, nil, reportError("createDatasetEvent is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createDatasetEvent + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteDagDatasetQueuedEventRequest struct { + ctx context.Context + ApiService *DatasetAPIService + dagId string + uri string + before *time.Time +} + +// Timestamp to select event logs occurring before. +func (r ApiDeleteDagDatasetQueuedEventRequest) Before(before time.Time) ApiDeleteDagDatasetQueuedEventRequest { + r.before = &before + return r +} + +func (r ApiDeleteDagDatasetQueuedEventRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteDagDatasetQueuedEventExecute(r) +} + +/* +DeleteDagDatasetQueuedEvent Delete a queued Dataset event for a DAG. + +Delete a queued Dataset event for a DAG. + +*New in version 2.9.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param dagId The DAG ID. + @param uri The encoded Dataset URI + @return ApiDeleteDagDatasetQueuedEventRequest +*/ +func (a *DatasetAPIService) DeleteDagDatasetQueuedEvent(ctx context.Context, dagId string, uri string) ApiDeleteDagDatasetQueuedEventRequest { + return ApiDeleteDagDatasetQueuedEventRequest{ + ApiService: a, + ctx: ctx, + dagId: dagId, + uri: uri, + } +} + +// Execute executes the request +func (a *DatasetAPIService) DeleteDagDatasetQueuedEventExecute(r ApiDeleteDagDatasetQueuedEventRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DatasetAPIService.DeleteDagDatasetQueuedEvent") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/dags/{dag_id}/datasets/queuedEvent/{uri}" + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"uri"+"}", url.PathEscape(parameterValueToString(r.uri, "uri")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.before != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "before", r.before, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDeleteDagDatasetQueuedEventsRequest struct { + ctx context.Context + ApiService *DatasetAPIService + dagId string + before *time.Time +} + +// Timestamp to select event logs occurring before. +func (r ApiDeleteDagDatasetQueuedEventsRequest) Before(before time.Time) ApiDeleteDagDatasetQueuedEventsRequest { + r.before = &before + return r +} + +func (r ApiDeleteDagDatasetQueuedEventsRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteDagDatasetQueuedEventsExecute(r) +} + +/* +DeleteDagDatasetQueuedEvents Delete queued Dataset events for a DAG. + +Delete queued Dataset events for a DAG. + +*New in version 2.9.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param dagId The DAG ID. + @return ApiDeleteDagDatasetQueuedEventsRequest +*/ +func (a *DatasetAPIService) DeleteDagDatasetQueuedEvents(ctx context.Context, dagId string) ApiDeleteDagDatasetQueuedEventsRequest { + return ApiDeleteDagDatasetQueuedEventsRequest{ + ApiService: a, + ctx: ctx, + dagId: dagId, + } +} + +// Execute executes the request +func (a *DatasetAPIService) DeleteDagDatasetQueuedEventsExecute(r ApiDeleteDagDatasetQueuedEventsRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DatasetAPIService.DeleteDagDatasetQueuedEvents") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/dags/{dag_id}/datasets/queuedEvent" + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.before != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "before", r.before, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDeleteDatasetQueuedEventsRequest struct { + ctx context.Context + ApiService *DatasetAPIService + uri string + before *time.Time +} + +// Timestamp to select event logs occurring before. +func (r ApiDeleteDatasetQueuedEventsRequest) Before(before time.Time) ApiDeleteDatasetQueuedEventsRequest { + r.before = &before + return r +} + +func (r ApiDeleteDatasetQueuedEventsRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteDatasetQueuedEventsExecute(r) +} + +/* +DeleteDatasetQueuedEvents Delete queued Dataset events for a Dataset. + +Delete queued Dataset events for a Dataset. + +*New in version 2.9.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uri The encoded Dataset URI + @return ApiDeleteDatasetQueuedEventsRequest +*/ +func (a *DatasetAPIService) DeleteDatasetQueuedEvents(ctx context.Context, uri string) ApiDeleteDatasetQueuedEventsRequest { + return ApiDeleteDatasetQueuedEventsRequest{ + ApiService: a, + ctx: ctx, + uri: uri, + } +} + +// Execute executes the request +func (a *DatasetAPIService) DeleteDatasetQueuedEventsExecute(r ApiDeleteDatasetQueuedEventsRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DatasetAPIService.DeleteDatasetQueuedEvents") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datasets/queuedEvent/{uri}" + localVarPath = strings.Replace(localVarPath, "{"+"uri"+"}", url.PathEscape(parameterValueToString(r.uri, "uri")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.before != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "before", r.before, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetDagDatasetQueuedEventRequest struct { + ctx context.Context + ApiService *DatasetAPIService + dagId string + uri string + before *time.Time +} + +// Timestamp to select event logs occurring before. +func (r ApiGetDagDatasetQueuedEventRequest) Before(before time.Time) ApiGetDagDatasetQueuedEventRequest { + r.before = &before + return r +} + +func (r ApiGetDagDatasetQueuedEventRequest) Execute() (*QueuedEvent, *http.Response, error) { + return r.ApiService.GetDagDatasetQueuedEventExecute(r) +} + +/* +GetDagDatasetQueuedEvent Get a queued Dataset event for a DAG + +Get a queued Dataset event for a DAG. + +*New in version 2.9.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param dagId The DAG ID. + @param uri The encoded Dataset URI + @return ApiGetDagDatasetQueuedEventRequest +*/ +func (a *DatasetAPIService) GetDagDatasetQueuedEvent(ctx context.Context, dagId string, uri string) ApiGetDagDatasetQueuedEventRequest { + return ApiGetDagDatasetQueuedEventRequest{ + ApiService: a, + ctx: ctx, + dagId: dagId, + uri: uri, + } +} + +// Execute executes the request +// @return QueuedEvent +func (a *DatasetAPIService) GetDagDatasetQueuedEventExecute(r ApiGetDagDatasetQueuedEventRequest) (*QueuedEvent, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *QueuedEvent + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DatasetAPIService.GetDagDatasetQueuedEvent") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/dags/{dag_id}/datasets/queuedEvent/{uri}" + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"uri"+"}", url.PathEscape(parameterValueToString(r.uri, "uri")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.before != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "before", r.before, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetDagDatasetQueuedEventsRequest struct { + ctx context.Context + ApiService *DatasetAPIService + dagId string + before *time.Time +} + +// Timestamp to select event logs occurring before. +func (r ApiGetDagDatasetQueuedEventsRequest) Before(before time.Time) ApiGetDagDatasetQueuedEventsRequest { + r.before = &before + return r +} + +func (r ApiGetDagDatasetQueuedEventsRequest) Execute() (*QueuedEventCollection, *http.Response, error) { + return r.ApiService.GetDagDatasetQueuedEventsExecute(r) +} /* -Airflow API (Stable) +GetDagDatasetQueuedEvents Get queued Dataset events for a DAG. -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +Get queued Dataset events for a DAG. -API version: 2.5.0 -Contact: dev@airflow.apache.org +*New in version 2.9.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param dagId The DAG ID. + @return ApiGetDagDatasetQueuedEventsRequest */ +func (a *DatasetAPIService) GetDagDatasetQueuedEvents(ctx context.Context, dagId string) ApiGetDagDatasetQueuedEventsRequest { + return ApiGetDagDatasetQueuedEventsRequest{ + ApiService: a, + ctx: ctx, + dagId: dagId, + } +} -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Execute executes the request +// @return QueuedEventCollection +func (a *DatasetAPIService) GetDagDatasetQueuedEventsExecute(r ApiGetDagDatasetQueuedEventsRequest) (*QueuedEventCollection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *QueuedEventCollection + ) -package airflow + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DatasetAPIService.GetDagDatasetQueuedEvents") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } -import ( - "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" - "strings" -) + localVarPath := localBasePath + "/dags/{dag_id}/datasets/queuedEvent" + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) -// Linger please -var ( - _ _context.Context -) + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} -// DatasetApiService DatasetApi service -type DatasetApiService service + if r.before != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "before", r.before, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} -type DatasetApiApiGetDatasetRequest struct { - ctx _context.Context - ApiService *DatasetApiService - uri string + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil } +type ApiGetDatasetRequest struct { + ctx context.Context + ApiService *DatasetAPIService + uri string +} -func (r DatasetApiApiGetDatasetRequest) Execute() (Dataset, *_nethttp.Response, error) { +func (r ApiGetDatasetRequest) Execute() (*Dataset, *http.Response, error) { return r.ApiService.GetDatasetExecute(r) } @@ -61,12 +941,12 @@ GetDataset Get a dataset Get a dataset by uri. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param uri The encoded Dataset URI - @return DatasetApiApiGetDatasetRequest + @return ApiGetDatasetRequest */ -func (a *DatasetApiService) GetDataset(ctx _context.Context, uri string) DatasetApiApiGetDatasetRequest { - return DatasetApiApiGetDatasetRequest{ +func (a *DatasetAPIService) GetDataset(ctx context.Context, uri string) ApiGetDatasetRequest { + return ApiGetDatasetRequest{ ApiService: a, ctx: ctx, uri: uri, @@ -75,27 +955,25 @@ func (a *DatasetApiService) GetDataset(ctx _context.Context, uri string) Dataset // Execute executes the request // @return Dataset -func (a *DatasetApiService) GetDatasetExecute(r DatasetApiApiGetDatasetRequest) (Dataset, *_nethttp.Response, error) { +func (a *DatasetAPIService) GetDatasetExecute(r ApiGetDatasetRequest) (*Dataset, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Dataset + formFiles []formFile + localVarReturnValue *Dataset ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DatasetApiService.GetDataset") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DatasetAPIService.GetDataset") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/datasets/{uri}" - localVarPath = strings.Replace(localVarPath, "{"+"uri"+"}", _neturl.PathEscape(parameterToString(r.uri, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"uri"+"}", url.PathEscape(parameterValueToString(r.uri, "uri")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -114,7 +992,7 @@ func (a *DatasetApiService) GetDatasetExecute(r DatasetApiApiGetDatasetRequest) if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -124,15 +1002,15 @@ func (a *DatasetApiService) GetDatasetExecute(r DatasetApiApiGetDatasetRequest) return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -143,7 +1021,8 @@ func (a *DatasetApiService) GetDatasetExecute(r DatasetApiApiGetDatasetRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -153,7 +1032,8 @@ func (a *DatasetApiService) GetDatasetExecute(r DatasetApiApiGetDatasetRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -163,14 +1043,15 @@ func (a *DatasetApiService) GetDatasetExecute(r DatasetApiApiGetDatasetRequest) newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -180,9 +1061,9 @@ func (a *DatasetApiService) GetDatasetExecute(r DatasetApiApiGetDatasetRequest) return localVarReturnValue, localVarHTTPResponse, nil } -type DatasetApiApiGetDatasetEventsRequest struct { - ctx _context.Context - ApiService *DatasetApiService +type ApiGetDatasetEventsRequest struct { + ctx context.Context + ApiService *DatasetAPIService limit *int32 offset *int32 orderBy *string @@ -194,47 +1075,54 @@ type DatasetApiApiGetDatasetEventsRequest struct { } // The numbers of items to return. -func (r DatasetApiApiGetDatasetEventsRequest) Limit(limit int32) DatasetApiApiGetDatasetEventsRequest { +func (r ApiGetDatasetEventsRequest) Limit(limit int32) ApiGetDatasetEventsRequest { r.limit = &limit return r } + // The number of items to skip before starting to collect the result set. -func (r DatasetApiApiGetDatasetEventsRequest) Offset(offset int32) DatasetApiApiGetDatasetEventsRequest { +func (r ApiGetDatasetEventsRequest) Offset(offset int32) ApiGetDatasetEventsRequest { r.offset = &offset return r } + // The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* -func (r DatasetApiApiGetDatasetEventsRequest) OrderBy(orderBy string) DatasetApiApiGetDatasetEventsRequest { +func (r ApiGetDatasetEventsRequest) OrderBy(orderBy string) ApiGetDatasetEventsRequest { r.orderBy = &orderBy return r } + // The Dataset ID that updated the dataset. -func (r DatasetApiApiGetDatasetEventsRequest) DatasetId(datasetId int32) DatasetApiApiGetDatasetEventsRequest { +func (r ApiGetDatasetEventsRequest) DatasetId(datasetId int32) ApiGetDatasetEventsRequest { r.datasetId = &datasetId return r } + // The DAG ID that updated the dataset. -func (r DatasetApiApiGetDatasetEventsRequest) SourceDagId(sourceDagId string) DatasetApiApiGetDatasetEventsRequest { +func (r ApiGetDatasetEventsRequest) SourceDagId(sourceDagId string) ApiGetDatasetEventsRequest { r.sourceDagId = &sourceDagId return r } + // The task ID that updated the dataset. -func (r DatasetApiApiGetDatasetEventsRequest) SourceTaskId(sourceTaskId string) DatasetApiApiGetDatasetEventsRequest { +func (r ApiGetDatasetEventsRequest) SourceTaskId(sourceTaskId string) ApiGetDatasetEventsRequest { r.sourceTaskId = &sourceTaskId return r } + // The DAG run ID that updated the dataset. -func (r DatasetApiApiGetDatasetEventsRequest) SourceRunId(sourceRunId string) DatasetApiApiGetDatasetEventsRequest { +func (r ApiGetDatasetEventsRequest) SourceRunId(sourceRunId string) ApiGetDatasetEventsRequest { r.sourceRunId = &sourceRunId return r } + // The map index that updated the dataset. -func (r DatasetApiApiGetDatasetEventsRequest) SourceMapIndex(sourceMapIndex int32) DatasetApiApiGetDatasetEventsRequest { +func (r ApiGetDatasetEventsRequest) SourceMapIndex(sourceMapIndex int32) ApiGetDatasetEventsRequest { r.sourceMapIndex = &sourceMapIndex return r } -func (r DatasetApiApiGetDatasetEventsRequest) Execute() (DatasetEventCollection, *_nethttp.Response, error) { +func (r ApiGetDatasetEventsRequest) Execute() (*DatasetEventCollection, *http.Response, error) { return r.ApiService.GetDatasetEventsExecute(r) } @@ -243,11 +1131,11 @@ GetDatasetEvents Get dataset events Get dataset events - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return DatasetApiApiGetDatasetEventsRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetDatasetEventsRequest */ -func (a *DatasetApiService) GetDatasetEvents(ctx _context.Context) DatasetApiApiGetDatasetEventsRequest { - return DatasetApiApiGetDatasetEventsRequest{ +func (a *DatasetAPIService) GetDatasetEvents(ctx context.Context) ApiGetDatasetEventsRequest { + return ApiGetDatasetEventsRequest{ ApiService: a, ctx: ctx, } @@ -255,50 +1143,199 @@ func (a *DatasetApiService) GetDatasetEvents(ctx _context.Context) DatasetApiApi // Execute executes the request // @return DatasetEventCollection -func (a *DatasetApiService) GetDatasetEventsExecute(r DatasetApiApiGetDatasetEventsRequest) (DatasetEventCollection, *_nethttp.Response, error) { +func (a *DatasetAPIService) GetDatasetEventsExecute(r ApiGetDatasetEventsRequest) (*DatasetEventCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue DatasetEventCollection + formFiles []formFile + localVarReturnValue *DatasetEventCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DatasetApiService.GetDatasetEvents") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DatasetAPIService.GetDatasetEvents") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/datasets/events" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue } if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") } if r.orderBy != nil { - localVarQueryParams.Add("order_by", parameterToString(*r.orderBy, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "order_by", r.orderBy, "form", "") } if r.datasetId != nil { - localVarQueryParams.Add("dataset_id", parameterToString(*r.datasetId, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "dataset_id", r.datasetId, "form", "") } if r.sourceDagId != nil { - localVarQueryParams.Add("source_dag_id", parameterToString(*r.sourceDagId, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "source_dag_id", r.sourceDagId, "form", "") } if r.sourceTaskId != nil { - localVarQueryParams.Add("source_task_id", parameterToString(*r.sourceTaskId, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "source_task_id", r.sourceTaskId, "form", "") } if r.sourceRunId != nil { - localVarQueryParams.Add("source_run_id", parameterToString(*r.sourceRunId, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "source_run_id", r.sourceRunId, "form", "") } if r.sourceMapIndex != nil { - localVarQueryParams.Add("source_map_index", parameterToString(*r.sourceMapIndex, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "source_map_index", r.sourceMapIndex, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetDatasetQueuedEventsRequest struct { + ctx context.Context + ApiService *DatasetAPIService + uri string + before *time.Time +} + +// Timestamp to select event logs occurring before. +func (r ApiGetDatasetQueuedEventsRequest) Before(before time.Time) ApiGetDatasetQueuedEventsRequest { + r.before = &before + return r +} + +func (r ApiGetDatasetQueuedEventsRequest) Execute() (*QueuedEventCollection, *http.Response, error) { + return r.ApiService.GetDatasetQueuedEventsExecute(r) +} + +/* +GetDatasetQueuedEvents Get queued Dataset events for a Dataset. + +Get queued Dataset events for a Dataset + +*New in version 2.9.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uri The encoded Dataset URI + @return ApiGetDatasetQueuedEventsRequest +*/ +func (a *DatasetAPIService) GetDatasetQueuedEvents(ctx context.Context, uri string) ApiGetDatasetQueuedEventsRequest { + return ApiGetDatasetQueuedEventsRequest{ + ApiService: a, + ctx: ctx, + uri: uri, + } +} + +// Execute executes the request +// @return QueuedEventCollection +func (a *DatasetAPIService) GetDatasetQueuedEventsExecute(r ApiGetDatasetQueuedEventsRequest) (*QueuedEventCollection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *QueuedEventCollection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DatasetAPIService.GetDatasetQueuedEvents") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/datasets/queuedEvent/{uri}" + localVarPath = strings.Replace(localVarPath, "{"+"uri"+"}", url.PathEscape(parameterValueToString(r.uri, "uri")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.before != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "before", r.before, "form", "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -317,7 +1354,7 @@ func (a *DatasetApiService) GetDatasetEventsExecute(r DatasetApiApiGetDatasetEve if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -327,15 +1364,15 @@ func (a *DatasetApiService) GetDatasetEventsExecute(r DatasetApiApiGetDatasetEve return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -346,7 +1383,8 @@ func (a *DatasetApiService) GetDatasetEventsExecute(r DatasetApiApiGetDatasetEve newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -356,7 +1394,8 @@ func (a *DatasetApiService) GetDatasetEventsExecute(r DatasetApiApiGetDatasetEve newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -366,14 +1405,15 @@ func (a *DatasetApiService) GetDatasetEventsExecute(r DatasetApiApiGetDatasetEve newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -383,48 +1423,58 @@ func (a *DatasetApiService) GetDatasetEventsExecute(r DatasetApiApiGetDatasetEve return localVarReturnValue, localVarHTTPResponse, nil } -type DatasetApiApiGetDatasetsRequest struct { - ctx _context.Context - ApiService *DatasetApiService +type ApiGetDatasetsRequest struct { + ctx context.Context + ApiService *DatasetAPIService limit *int32 offset *int32 orderBy *string uriPattern *string + dagIds *string } // The numbers of items to return. -func (r DatasetApiApiGetDatasetsRequest) Limit(limit int32) DatasetApiApiGetDatasetsRequest { +func (r ApiGetDatasetsRequest) Limit(limit int32) ApiGetDatasetsRequest { r.limit = &limit return r } + // The number of items to skip before starting to collect the result set. -func (r DatasetApiApiGetDatasetsRequest) Offset(offset int32) DatasetApiApiGetDatasetsRequest { +func (r ApiGetDatasetsRequest) Offset(offset int32) ApiGetDatasetsRequest { r.offset = &offset return r } + // The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* -func (r DatasetApiApiGetDatasetsRequest) OrderBy(orderBy string) DatasetApiApiGetDatasetsRequest { +func (r ApiGetDatasetsRequest) OrderBy(orderBy string) ApiGetDatasetsRequest { r.orderBy = &orderBy return r } + // If set, only return datasets with uris matching this pattern. -func (r DatasetApiApiGetDatasetsRequest) UriPattern(uriPattern string) DatasetApiApiGetDatasetsRequest { +func (r ApiGetDatasetsRequest) UriPattern(uriPattern string) ApiGetDatasetsRequest { r.uriPattern = &uriPattern return r } -func (r DatasetApiApiGetDatasetsRequest) Execute() (DatasetCollection, *_nethttp.Response, error) { +// One or more DAG IDs separated by commas to filter datasets by associated DAGs either consuming or producing. *New in version 2.9.0* +func (r ApiGetDatasetsRequest) DagIds(dagIds string) ApiGetDatasetsRequest { + r.dagIds = &dagIds + return r +} + +func (r ApiGetDatasetsRequest) Execute() (*DatasetCollection, *http.Response, error) { return r.ApiService.GetDatasetsExecute(r) } /* GetDatasets List datasets - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return DatasetApiApiGetDatasetsRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetDatasetsRequest */ -func (a *DatasetApiService) GetDatasets(ctx _context.Context) DatasetApiApiGetDatasetsRequest { - return DatasetApiApiGetDatasetsRequest{ +func (a *DatasetAPIService) GetDatasets(ctx context.Context) ApiGetDatasetsRequest { + return ApiGetDatasetsRequest{ ApiService: a, ctx: ctx, } @@ -432,38 +1482,42 @@ func (a *DatasetApiService) GetDatasets(ctx _context.Context) DatasetApiApiGetDa // Execute executes the request // @return DatasetCollection -func (a *DatasetApiService) GetDatasetsExecute(r DatasetApiApiGetDatasetsRequest) (DatasetCollection, *_nethttp.Response, error) { +func (a *DatasetAPIService) GetDatasetsExecute(r ApiGetDatasetsRequest) (*DatasetCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue DatasetCollection + formFiles []formFile + localVarReturnValue *DatasetCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DatasetApiService.GetDatasets") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DatasetAPIService.GetDatasets") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/datasets" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue } if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") } if r.orderBy != nil { - localVarQueryParams.Add("order_by", parameterToString(*r.orderBy, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "order_by", r.orderBy, "form", "") } if r.uriPattern != nil { - localVarQueryParams.Add("uri_pattern", parameterToString(*r.uriPattern, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "uri_pattern", r.uriPattern, "form", "") + } + if r.dagIds != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "dag_ids", r.dagIds, "form", "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -482,7 +1536,7 @@ func (a *DatasetApiService) GetDatasetsExecute(r DatasetApiApiGetDatasetsRequest if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -492,15 +1546,15 @@ func (a *DatasetApiService) GetDatasetsExecute(r DatasetApiApiGetDatasetsRequest return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -511,7 +1565,8 @@ func (a *DatasetApiService) GetDatasetsExecute(r DatasetApiApiGetDatasetsRequest newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -521,14 +1576,15 @@ func (a *DatasetApiService) GetDatasetsExecute(r DatasetApiApiGetDatasetsRequest newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -538,15 +1594,14 @@ func (a *DatasetApiService) GetDatasetsExecute(r DatasetApiApiGetDatasetsRequest return localVarReturnValue, localVarHTTPResponse, nil } -type DatasetApiApiGetUpstreamDatasetEventsRequest struct { - ctx _context.Context - ApiService *DatasetApiService +type ApiGetUpstreamDatasetEventsRequest struct { + ctx context.Context + ApiService *DatasetAPIService dagId string dagRunId string } - -func (r DatasetApiApiGetUpstreamDatasetEventsRequest) Execute() (DatasetEventCollection, *_nethttp.Response, error) { +func (r ApiGetUpstreamDatasetEventsRequest) Execute() (*DatasetEventCollection, *http.Response, error) { return r.ApiService.GetUpstreamDatasetEventsExecute(r) } @@ -558,13 +1613,13 @@ Get datasets for a dag run. *New in version 2.4.0* - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. @param dagRunId The DAG run ID. - @return DatasetApiApiGetUpstreamDatasetEventsRequest + @return ApiGetUpstreamDatasetEventsRequest */ -func (a *DatasetApiService) GetUpstreamDatasetEvents(ctx _context.Context, dagId string, dagRunId string) DatasetApiApiGetUpstreamDatasetEventsRequest { - return DatasetApiApiGetUpstreamDatasetEventsRequest{ +func (a *DatasetAPIService) GetUpstreamDatasetEvents(ctx context.Context, dagId string, dagRunId string) ApiGetUpstreamDatasetEventsRequest { + return ApiGetUpstreamDatasetEventsRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -574,28 +1629,26 @@ func (a *DatasetApiService) GetUpstreamDatasetEvents(ctx _context.Context, dagId // Execute executes the request // @return DatasetEventCollection -func (a *DatasetApiService) GetUpstreamDatasetEventsExecute(r DatasetApiApiGetUpstreamDatasetEventsRequest) (DatasetEventCollection, *_nethttp.Response, error) { +func (a *DatasetAPIService) GetUpstreamDatasetEventsExecute(r ApiGetUpstreamDatasetEventsRequest) (*DatasetEventCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue DatasetEventCollection + formFiles []formFile + localVarReturnValue *DatasetEventCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DatasetApiService.GetUpstreamDatasetEvents") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DatasetAPIService.GetUpstreamDatasetEvents") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/upstreamDatasetEvents" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", _neturl.PathEscape(parameterToString(r.dagRunId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -614,7 +1667,7 @@ func (a *DatasetApiService) GetUpstreamDatasetEventsExecute(r DatasetApiApiGetUp if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -624,15 +1677,15 @@ func (a *DatasetApiService) GetUpstreamDatasetEventsExecute(r DatasetApiApiGetUp return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -643,7 +1696,8 @@ func (a *DatasetApiService) GetUpstreamDatasetEventsExecute(r DatasetApiApiGetUp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -653,7 +1707,8 @@ func (a *DatasetApiService) GetUpstreamDatasetEventsExecute(r DatasetApiApiGetUp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -663,14 +1718,15 @@ func (a *DatasetApiService) GetUpstreamDatasetEventsExecute(r DatasetApiApiGetUp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/airflow/api_event_log.go b/airflow/api_event_log.go index b140f38..990b6a1 100644 --- a/airflow/api_event_log.go +++ b/airflow/api_event_log.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -30,41 +13,37 @@ package airflow import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" "strings" + "time" ) -// Linger please -var ( - _ _context.Context -) -// EventLogApiService EventLogApi service -type EventLogApiService service +// EventLogAPIService EventLogAPI service +type EventLogAPIService service -type EventLogApiApiGetEventLogRequest struct { - ctx _context.Context - ApiService *EventLogApiService +type ApiGetEventLogRequest struct { + ctx context.Context + ApiService *EventLogAPIService eventLogId int32 } - -func (r EventLogApiApiGetEventLogRequest) Execute() (EventLog, *_nethttp.Response, error) { +func (r ApiGetEventLogRequest) Execute() (*EventLog, *http.Response, error) { return r.ApiService.GetEventLogExecute(r) } /* GetEventLog Get a log entry - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param eventLogId The event log ID. - @return EventLogApiApiGetEventLogRequest + @return ApiGetEventLogRequest */ -func (a *EventLogApiService) GetEventLog(ctx _context.Context, eventLogId int32) EventLogApiApiGetEventLogRequest { - return EventLogApiApiGetEventLogRequest{ +func (a *EventLogAPIService) GetEventLog(ctx context.Context, eventLogId int32) ApiGetEventLogRequest { + return ApiGetEventLogRequest{ ApiService: a, ctx: ctx, eventLogId: eventLogId, @@ -73,27 +52,25 @@ func (a *EventLogApiService) GetEventLog(ctx _context.Context, eventLogId int32) // Execute executes the request // @return EventLog -func (a *EventLogApiService) GetEventLogExecute(r EventLogApiApiGetEventLogRequest) (EventLog, *_nethttp.Response, error) { +func (a *EventLogAPIService) GetEventLogExecute(r ApiGetEventLogRequest) (*EventLog, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue EventLog + formFiles []formFile + localVarReturnValue *EventLog ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventLogApiService.GetEventLog") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventLogAPIService.GetEventLog") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/eventLogs/{event_log_id}" - localVarPath = strings.Replace(localVarPath, "{"+"event_log_id"+"}", _neturl.PathEscape(parameterToString(r.eventLogId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"event_log_id"+"}", url.PathEscape(parameterValueToString(r.eventLogId, "eventLogId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -112,7 +89,7 @@ func (a *EventLogApiService) GetEventLogExecute(r EventLogApiApiGetEventLogReque if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -122,15 +99,15 @@ func (a *EventLogApiService) GetEventLogExecute(r EventLogApiApiGetEventLogReque return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -141,7 +118,8 @@ func (a *EventLogApiService) GetEventLogExecute(r EventLogApiApiGetEventLogReque newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -151,7 +129,8 @@ func (a *EventLogApiService) GetEventLogExecute(r EventLogApiApiGetEventLogReque newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -161,14 +140,15 @@ func (a *EventLogApiService) GetEventLogExecute(r EventLogApiApiGetEventLogReque newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -178,31 +158,110 @@ func (a *EventLogApiService) GetEventLogExecute(r EventLogApiApiGetEventLogReque return localVarReturnValue, localVarHTTPResponse, nil } -type EventLogApiApiGetEventLogsRequest struct { - ctx _context.Context - ApiService *EventLogApiService +type ApiGetEventLogsRequest struct { + ctx context.Context + ApiService *EventLogAPIService limit *int32 offset *int32 orderBy *string + dagId *string + taskId *string + runId *string + mapIndex *int32 + tryNumber *int32 + event *string + owner *string + before *time.Time + after *time.Time + includedEvents *string + excludedEvents *string } // The numbers of items to return. -func (r EventLogApiApiGetEventLogsRequest) Limit(limit int32) EventLogApiApiGetEventLogsRequest { +func (r ApiGetEventLogsRequest) Limit(limit int32) ApiGetEventLogsRequest { r.limit = &limit return r } + // The number of items to skip before starting to collect the result set. -func (r EventLogApiApiGetEventLogsRequest) Offset(offset int32) EventLogApiApiGetEventLogsRequest { +func (r ApiGetEventLogsRequest) Offset(offset int32) ApiGetEventLogsRequest { r.offset = &offset return r } + // The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* -func (r EventLogApiApiGetEventLogsRequest) OrderBy(orderBy string) EventLogApiApiGetEventLogsRequest { +func (r ApiGetEventLogsRequest) OrderBy(orderBy string) ApiGetEventLogsRequest { r.orderBy = &orderBy return r } -func (r EventLogApiApiGetEventLogsRequest) Execute() (EventLogCollection, *_nethttp.Response, error) { +// Returns objects matched by the DAG ID. +func (r ApiGetEventLogsRequest) DagId(dagId string) ApiGetEventLogsRequest { + r.dagId = &dagId + return r +} + +// Returns objects matched by the Task ID. +func (r ApiGetEventLogsRequest) TaskId(taskId string) ApiGetEventLogsRequest { + r.taskId = &taskId + return r +} + +// Returns objects matched by the Run ID. +func (r ApiGetEventLogsRequest) RunId(runId string) ApiGetEventLogsRequest { + r.runId = &runId + return r +} + +// Filter on map index for mapped task. +func (r ApiGetEventLogsRequest) MapIndex(mapIndex int32) ApiGetEventLogsRequest { + r.mapIndex = &mapIndex + return r +} + +// Filter on try_number for task instance. +func (r ApiGetEventLogsRequest) TryNumber(tryNumber int32) ApiGetEventLogsRequest { + r.tryNumber = &tryNumber + return r +} + +// The name of event log. +func (r ApiGetEventLogsRequest) Event(event string) ApiGetEventLogsRequest { + r.event = &event + return r +} + +// The owner's name of event log. +func (r ApiGetEventLogsRequest) Owner(owner string) ApiGetEventLogsRequest { + r.owner = &owner + return r +} + +// Timestamp to select event logs occurring before. +func (r ApiGetEventLogsRequest) Before(before time.Time) ApiGetEventLogsRequest { + r.before = &before + return r +} + +// Timestamp to select event logs occurring after. +func (r ApiGetEventLogsRequest) After(after time.Time) ApiGetEventLogsRequest { + r.after = &after + return r +} + +// One or more event names separated by commas. If set, only return event logs with events matching this pattern. *New in version 2.9.0* +func (r ApiGetEventLogsRequest) IncludedEvents(includedEvents string) ApiGetEventLogsRequest { + r.includedEvents = &includedEvents + return r +} + +// One or more event names separated by commas. If set, only return event logs with events that do not match this pattern. *New in version 2.9.0* +func (r ApiGetEventLogsRequest) ExcludedEvents(excludedEvents string) ApiGetEventLogsRequest { + r.excludedEvents = &excludedEvents + return r +} + +func (r ApiGetEventLogsRequest) Execute() (*EventLogCollection, *http.Response, error) { return r.ApiService.GetEventLogsExecute(r) } @@ -211,11 +270,11 @@ GetEventLogs List log entries List log entries from event log. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return EventLogApiApiGetEventLogsRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetEventLogsRequest */ -func (a *EventLogApiService) GetEventLogs(ctx _context.Context) EventLogApiApiGetEventLogsRequest { - return EventLogApiApiGetEventLogsRequest{ +func (a *EventLogAPIService) GetEventLogs(ctx context.Context) ApiGetEventLogsRequest { + return ApiGetEventLogsRequest{ ApiService: a, ctx: ctx, } @@ -223,35 +282,69 @@ func (a *EventLogApiService) GetEventLogs(ctx _context.Context) EventLogApiApiGe // Execute executes the request // @return EventLogCollection -func (a *EventLogApiService) GetEventLogsExecute(r EventLogApiApiGetEventLogsRequest) (EventLogCollection, *_nethttp.Response, error) { +func (a *EventLogAPIService) GetEventLogsExecute(r ApiGetEventLogsRequest) (*EventLogCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue EventLogCollection + formFiles []formFile + localVarReturnValue *EventLogCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventLogApiService.GetEventLogs") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventLogAPIService.GetEventLogs") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/eventLogs" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue } if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") } if r.orderBy != nil { - localVarQueryParams.Add("order_by", parameterToString(*r.orderBy, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "order_by", r.orderBy, "form", "") + } + if r.dagId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "dag_id", r.dagId, "form", "") + } + if r.taskId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "task_id", r.taskId, "form", "") + } + if r.runId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "run_id", r.runId, "form", "") + } + if r.mapIndex != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "map_index", r.mapIndex, "form", "") + } + if r.tryNumber != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "try_number", r.tryNumber, "form", "") + } + if r.event != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "event", r.event, "form", "") + } + if r.owner != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "owner", r.owner, "form", "") + } + if r.before != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "before", r.before, "form", "") + } + if r.after != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "after", r.after, "form", "") + } + if r.includedEvents != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "included_events", r.includedEvents, "form", "") + } + if r.excludedEvents != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "excluded_events", r.excludedEvents, "form", "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -270,7 +363,7 @@ func (a *EventLogApiService) GetEventLogsExecute(r EventLogApiApiGetEventLogsReq if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -280,15 +373,15 @@ func (a *EventLogApiService) GetEventLogsExecute(r EventLogApiApiGetEventLogsReq return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -299,7 +392,8 @@ func (a *EventLogApiService) GetEventLogsExecute(r EventLogApiApiGetEventLogsReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -309,14 +403,15 @@ func (a *EventLogApiService) GetEventLogsExecute(r EventLogApiApiGetEventLogsReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/airflow/api_import_error.go b/airflow/api_import_error.go index 3e3c7d6..3a97b63 100644 --- a/airflow/api_import_error.go +++ b/airflow/api_import_error.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -30,41 +13,36 @@ package airflow import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) -// ImportErrorApiService ImportErrorApi service -type ImportErrorApiService service +// ImportErrorAPIService ImportErrorAPI service +type ImportErrorAPIService service -type ImportErrorApiApiGetImportErrorRequest struct { - ctx _context.Context - ApiService *ImportErrorApiService +type ApiGetImportErrorRequest struct { + ctx context.Context + ApiService *ImportErrorAPIService importErrorId int32 } - -func (r ImportErrorApiApiGetImportErrorRequest) Execute() (ImportError, *_nethttp.Response, error) { +func (r ApiGetImportErrorRequest) Execute() (*ImportError, *http.Response, error) { return r.ApiService.GetImportErrorExecute(r) } /* GetImportError Get an import error - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param importErrorId The import error ID. - @return ImportErrorApiApiGetImportErrorRequest + @return ApiGetImportErrorRequest */ -func (a *ImportErrorApiService) GetImportError(ctx _context.Context, importErrorId int32) ImportErrorApiApiGetImportErrorRequest { - return ImportErrorApiApiGetImportErrorRequest{ +func (a *ImportErrorAPIService) GetImportError(ctx context.Context, importErrorId int32) ApiGetImportErrorRequest { + return ApiGetImportErrorRequest{ ApiService: a, ctx: ctx, importErrorId: importErrorId, @@ -73,27 +51,25 @@ func (a *ImportErrorApiService) GetImportError(ctx _context.Context, importError // Execute executes the request // @return ImportError -func (a *ImportErrorApiService) GetImportErrorExecute(r ImportErrorApiApiGetImportErrorRequest) (ImportError, *_nethttp.Response, error) { +func (a *ImportErrorAPIService) GetImportErrorExecute(r ApiGetImportErrorRequest) (*ImportError, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ImportError + formFiles []formFile + localVarReturnValue *ImportError ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportErrorApiService.GetImportError") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportErrorAPIService.GetImportError") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/importErrors/{import_error_id}" - localVarPath = strings.Replace(localVarPath, "{"+"import_error_id"+"}", _neturl.PathEscape(parameterToString(r.importErrorId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"import_error_id"+"}", url.PathEscape(parameterValueToString(r.importErrorId, "importErrorId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -112,7 +88,7 @@ func (a *ImportErrorApiService) GetImportErrorExecute(r ImportErrorApiApiGetImpo if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -122,15 +98,15 @@ func (a *ImportErrorApiService) GetImportErrorExecute(r ImportErrorApiApiGetImpo return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -141,7 +117,8 @@ func (a *ImportErrorApiService) GetImportErrorExecute(r ImportErrorApiApiGetImpo newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -151,7 +128,8 @@ func (a *ImportErrorApiService) GetImportErrorExecute(r ImportErrorApiApiGetImpo newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -161,14 +139,15 @@ func (a *ImportErrorApiService) GetImportErrorExecute(r ImportErrorApiApiGetImpo newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -178,42 +157,44 @@ func (a *ImportErrorApiService) GetImportErrorExecute(r ImportErrorApiApiGetImpo return localVarReturnValue, localVarHTTPResponse, nil } -type ImportErrorApiApiGetImportErrorsRequest struct { - ctx _context.Context - ApiService *ImportErrorApiService +type ApiGetImportErrorsRequest struct { + ctx context.Context + ApiService *ImportErrorAPIService limit *int32 offset *int32 orderBy *string } // The numbers of items to return. -func (r ImportErrorApiApiGetImportErrorsRequest) Limit(limit int32) ImportErrorApiApiGetImportErrorsRequest { +func (r ApiGetImportErrorsRequest) Limit(limit int32) ApiGetImportErrorsRequest { r.limit = &limit return r } + // The number of items to skip before starting to collect the result set. -func (r ImportErrorApiApiGetImportErrorsRequest) Offset(offset int32) ImportErrorApiApiGetImportErrorsRequest { +func (r ApiGetImportErrorsRequest) Offset(offset int32) ApiGetImportErrorsRequest { r.offset = &offset return r } + // The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* -func (r ImportErrorApiApiGetImportErrorsRequest) OrderBy(orderBy string) ImportErrorApiApiGetImportErrorsRequest { +func (r ApiGetImportErrorsRequest) OrderBy(orderBy string) ApiGetImportErrorsRequest { r.orderBy = &orderBy return r } -func (r ImportErrorApiApiGetImportErrorsRequest) Execute() (ImportErrorCollection, *_nethttp.Response, error) { +func (r ApiGetImportErrorsRequest) Execute() (*ImportErrorCollection, *http.Response, error) { return r.ApiService.GetImportErrorsExecute(r) } /* GetImportErrors List import errors - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ImportErrorApiApiGetImportErrorsRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetImportErrorsRequest */ -func (a *ImportErrorApiService) GetImportErrors(ctx _context.Context) ImportErrorApiApiGetImportErrorsRequest { - return ImportErrorApiApiGetImportErrorsRequest{ +func (a *ImportErrorAPIService) GetImportErrors(ctx context.Context) ApiGetImportErrorsRequest { + return ApiGetImportErrorsRequest{ ApiService: a, ctx: ctx, } @@ -221,35 +202,36 @@ func (a *ImportErrorApiService) GetImportErrors(ctx _context.Context) ImportErro // Execute executes the request // @return ImportErrorCollection -func (a *ImportErrorApiService) GetImportErrorsExecute(r ImportErrorApiApiGetImportErrorsRequest) (ImportErrorCollection, *_nethttp.Response, error) { +func (a *ImportErrorAPIService) GetImportErrorsExecute(r ApiGetImportErrorsRequest) (*ImportErrorCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ImportErrorCollection + formFiles []formFile + localVarReturnValue *ImportErrorCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportErrorApiService.GetImportErrors") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ImportErrorAPIService.GetImportErrors") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/importErrors" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue } if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") } if r.orderBy != nil { - localVarQueryParams.Add("order_by", parameterToString(*r.orderBy, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "order_by", r.orderBy, "form", "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -268,7 +250,7 @@ func (a *ImportErrorApiService) GetImportErrorsExecute(r ImportErrorApiApiGetImp if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -278,15 +260,15 @@ func (a *ImportErrorApiService) GetImportErrorsExecute(r ImportErrorApiApiGetImp return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -297,7 +279,8 @@ func (a *ImportErrorApiService) GetImportErrorsExecute(r ImportErrorApiApiGetImp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -307,14 +290,15 @@ func (a *ImportErrorApiService) GetImportErrorsExecute(r ImportErrorApiApiGetImp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/airflow/api_monitoring.go b/airflow/api_monitoring.go index 55cb14b..a749c0d 100644 --- a/airflow/api_monitoring.go +++ b/airflow/api_monitoring.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -30,42 +13,37 @@ package airflow import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" ) -// Linger please -var ( - _ _context.Context -) -// MonitoringApiService MonitoringApi service -type MonitoringApiService service +// MonitoringAPIService MonitoringAPI service +type MonitoringAPIService service -type MonitoringApiApiGetHealthRequest struct { - ctx _context.Context - ApiService *MonitoringApiService +type ApiGetHealthRequest struct { + ctx context.Context + ApiService *MonitoringAPIService } - -func (r MonitoringApiApiGetHealthRequest) Execute() (HealthInfo, *_nethttp.Response, error) { +func (r ApiGetHealthRequest) Execute() (*HealthInfo, *http.Response, error) { return r.ApiService.GetHealthExecute(r) } /* GetHealth Get instance status -Get the status of Airflow's metadatabase and scheduler. It includes info about -metadatabase and last heartbeat of scheduler. +Get the status of Airflow's metadatabase, triggerer and scheduler. It includes info about +metadatabase and last heartbeat of scheduler and triggerer. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return MonitoringApiApiGetHealthRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetHealthRequest */ -func (a *MonitoringApiService) GetHealth(ctx _context.Context) MonitoringApiApiGetHealthRequest { - return MonitoringApiApiGetHealthRequest{ +func (a *MonitoringAPIService) GetHealth(ctx context.Context) ApiGetHealthRequest { + return ApiGetHealthRequest{ ApiService: a, ctx: ctx, } @@ -73,26 +51,24 @@ func (a *MonitoringApiService) GetHealth(ctx _context.Context) MonitoringApiApiG // Execute executes the request // @return HealthInfo -func (a *MonitoringApiService) GetHealthExecute(r MonitoringApiApiGetHealthRequest) (HealthInfo, *_nethttp.Response, error) { +func (a *MonitoringAPIService) GetHealthExecute(r ApiGetHealthRequest) (*HealthInfo, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue HealthInfo + formFiles []formFile + localVarReturnValue *HealthInfo ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitoringApiService.GetHealth") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitoringAPIService.GetHealth") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/health" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -111,7 +87,7 @@ func (a *MonitoringApiService) GetHealthExecute(r MonitoringApiApiGetHealthReque if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -121,15 +97,15 @@ func (a *MonitoringApiService) GetHealthExecute(r MonitoringApiApiGetHealthReque return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -138,7 +114,7 @@ func (a *MonitoringApiService) GetHealthExecute(r MonitoringApiApiGetHealthReque err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -148,24 +124,23 @@ func (a *MonitoringApiService) GetHealthExecute(r MonitoringApiApiGetHealthReque return localVarReturnValue, localVarHTTPResponse, nil } -type MonitoringApiApiGetVersionRequest struct { - ctx _context.Context - ApiService *MonitoringApiService +type ApiGetVersionRequest struct { + ctx context.Context + ApiService *MonitoringAPIService } - -func (r MonitoringApiApiGetVersionRequest) Execute() (VersionInfo, *_nethttp.Response, error) { +func (r ApiGetVersionRequest) Execute() (*VersionInfo, *http.Response, error) { return r.ApiService.GetVersionExecute(r) } /* GetVersion Get version information - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return MonitoringApiApiGetVersionRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetVersionRequest */ -func (a *MonitoringApiService) GetVersion(ctx _context.Context) MonitoringApiApiGetVersionRequest { - return MonitoringApiApiGetVersionRequest{ +func (a *MonitoringAPIService) GetVersion(ctx context.Context) ApiGetVersionRequest { + return ApiGetVersionRequest{ ApiService: a, ctx: ctx, } @@ -173,26 +148,24 @@ func (a *MonitoringApiService) GetVersion(ctx _context.Context) MonitoringApiApi // Execute executes the request // @return VersionInfo -func (a *MonitoringApiService) GetVersionExecute(r MonitoringApiApiGetVersionRequest) (VersionInfo, *_nethttp.Response, error) { +func (a *MonitoringAPIService) GetVersionExecute(r ApiGetVersionRequest) (*VersionInfo, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue VersionInfo + formFiles []formFile + localVarReturnValue *VersionInfo ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitoringApiService.GetVersion") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MonitoringAPIService.GetVersion") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/version" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -211,7 +184,7 @@ func (a *MonitoringApiService) GetVersionExecute(r MonitoringApiApiGetVersionReq if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -221,15 +194,15 @@ func (a *MonitoringApiService) GetVersionExecute(r MonitoringApiApiGetVersionReq return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -238,7 +211,7 @@ func (a *MonitoringApiService) GetVersionExecute(r MonitoringApiApiGetVersionReq err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/airflow/api_permission.go b/airflow/api_permission.go index 8f596de..062100a 100644 --- a/airflow/api_permission.go +++ b/airflow/api_permission.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -30,39 +13,36 @@ package airflow import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" ) -// Linger please -var ( - _ _context.Context -) -// PermissionApiService PermissionApi service -type PermissionApiService service +// PermissionAPIService PermissionAPI service +type PermissionAPIService service -type PermissionApiApiGetPermissionsRequest struct { - ctx _context.Context - ApiService *PermissionApiService +type ApiGetPermissionsRequest struct { + ctx context.Context + ApiService *PermissionAPIService limit *int32 offset *int32 } // The numbers of items to return. -func (r PermissionApiApiGetPermissionsRequest) Limit(limit int32) PermissionApiApiGetPermissionsRequest { +func (r ApiGetPermissionsRequest) Limit(limit int32) ApiGetPermissionsRequest { r.limit = &limit return r } + // The number of items to skip before starting to collect the result set. -func (r PermissionApiApiGetPermissionsRequest) Offset(offset int32) PermissionApiApiGetPermissionsRequest { +func (r ApiGetPermissionsRequest) Offset(offset int32) ApiGetPermissionsRequest { r.offset = &offset return r } -func (r PermissionApiApiGetPermissionsRequest) Execute() (ActionCollection, *_nethttp.Response, error) { +func (r ApiGetPermissionsRequest) Execute() (*ActionCollection, *http.Response, error) { return r.ApiService.GetPermissionsExecute(r) } @@ -71,14 +51,16 @@ GetPermissions List permissions Get a list of permissions. -*New in version 2.1.0* +*This API endpoint is deprecated, please use the endpoint `/auth/fab/v1` for this operation instead.* + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPermissionsRequest - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return PermissionApiApiGetPermissionsRequest +Deprecated */ -func (a *PermissionApiService) GetPermissions(ctx _context.Context) PermissionApiApiGetPermissionsRequest { - return PermissionApiApiGetPermissionsRequest{ +func (a *PermissionAPIService) GetPermissions(ctx context.Context) ApiGetPermissionsRequest { + return ApiGetPermissionsRequest{ ApiService: a, ctx: ctx, } @@ -86,32 +68,34 @@ func (a *PermissionApiService) GetPermissions(ctx _context.Context) PermissionAp // Execute executes the request // @return ActionCollection -func (a *PermissionApiService) GetPermissionsExecute(r PermissionApiApiGetPermissionsRequest) (ActionCollection, *_nethttp.Response, error) { +// Deprecated +func (a *PermissionAPIService) GetPermissionsExecute(r ApiGetPermissionsRequest) (*ActionCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ActionCollection + formFiles []formFile + localVarReturnValue *ActionCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PermissionApiService.GetPermissions") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PermissionAPIService.GetPermissions") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/permissions" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue } if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -130,7 +114,7 @@ func (a *PermissionApiService) GetPermissionsExecute(r PermissionApiApiGetPermis if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -140,15 +124,15 @@ func (a *PermissionApiService) GetPermissionsExecute(r PermissionApiApiGetPermis return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -159,7 +143,8 @@ func (a *PermissionApiService) GetPermissionsExecute(r PermissionApiApiGetPermis newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -169,14 +154,15 @@ func (a *PermissionApiService) GetPermissionsExecute(r PermissionApiApiGetPermis newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/airflow/api_plugin.go b/airflow/api_plugin.go index 72ed584..3bf421c 100644 --- a/airflow/api_plugin.go +++ b/airflow/api_plugin.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -30,39 +13,36 @@ package airflow import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" ) -// Linger please -var ( - _ _context.Context -) -// PluginApiService PluginApi service -type PluginApiService service +// PluginAPIService PluginAPI service +type PluginAPIService service -type PluginApiApiGetPluginsRequest struct { - ctx _context.Context - ApiService *PluginApiService +type ApiGetPluginsRequest struct { + ctx context.Context + ApiService *PluginAPIService limit *int32 offset *int32 } // The numbers of items to return. -func (r PluginApiApiGetPluginsRequest) Limit(limit int32) PluginApiApiGetPluginsRequest { +func (r ApiGetPluginsRequest) Limit(limit int32) ApiGetPluginsRequest { r.limit = &limit return r } + // The number of items to skip before starting to collect the result set. -func (r PluginApiApiGetPluginsRequest) Offset(offset int32) PluginApiApiGetPluginsRequest { +func (r ApiGetPluginsRequest) Offset(offset int32) ApiGetPluginsRequest { r.offset = &offset return r } -func (r PluginApiApiGetPluginsRequest) Execute() (PluginCollection, *_nethttp.Response, error) { +func (r ApiGetPluginsRequest) Execute() (*PluginCollection, *http.Response, error) { return r.ApiService.GetPluginsExecute(r) } @@ -74,11 +54,11 @@ Get a list of loaded plugins. *New in version 2.1.0* - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return PluginApiApiGetPluginsRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPluginsRequest */ -func (a *PluginApiService) GetPlugins(ctx _context.Context) PluginApiApiGetPluginsRequest { - return PluginApiApiGetPluginsRequest{ +func (a *PluginAPIService) GetPlugins(ctx context.Context) ApiGetPluginsRequest { + return ApiGetPluginsRequest{ ApiService: a, ctx: ctx, } @@ -86,32 +66,33 @@ func (a *PluginApiService) GetPlugins(ctx _context.Context) PluginApiApiGetPlugi // Execute executes the request // @return PluginCollection -func (a *PluginApiService) GetPluginsExecute(r PluginApiApiGetPluginsRequest) (PluginCollection, *_nethttp.Response, error) { +func (a *PluginAPIService) GetPluginsExecute(r ApiGetPluginsRequest) (*PluginCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue PluginCollection + formFiles []formFile + localVarReturnValue *PluginCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PluginApiService.GetPlugins") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PluginAPIService.GetPlugins") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/plugins" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue } if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -130,7 +111,7 @@ func (a *PluginApiService) GetPluginsExecute(r PluginApiApiGetPluginsRequest) (P if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -140,15 +121,15 @@ func (a *PluginApiService) GetPluginsExecute(r PluginApiApiGetPluginsRequest) (P return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -159,7 +140,8 @@ func (a *PluginApiService) GetPluginsExecute(r PluginApiApiGetPluginsRequest) (P newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -169,7 +151,8 @@ func (a *PluginApiService) GetPluginsExecute(r PluginApiApiGetPluginsRequest) (P newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -179,14 +162,15 @@ func (a *PluginApiService) GetPluginsExecute(r PluginApiApiGetPluginsRequest) (P newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/airflow/api_pool.go b/airflow/api_pool.go index 8546f6d..4406d35 100644 --- a/airflow/api_pool.go +++ b/airflow/api_pool.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -30,41 +13,36 @@ package airflow import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) -// PoolApiService PoolApi service -type PoolApiService service +// PoolAPIService PoolAPI service +type PoolAPIService service -type PoolApiApiDeletePoolRequest struct { - ctx _context.Context - ApiService *PoolApiService +type ApiDeletePoolRequest struct { + ctx context.Context + ApiService *PoolAPIService poolName string } - -func (r PoolApiApiDeletePoolRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeletePoolRequest) Execute() (*http.Response, error) { return r.ApiService.DeletePoolExecute(r) } /* DeletePool Delete a pool - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param poolName The pool name. - @return PoolApiApiDeletePoolRequest + @return ApiDeletePoolRequest */ -func (a *PoolApiService) DeletePool(ctx _context.Context, poolName string) PoolApiApiDeletePoolRequest { - return PoolApiApiDeletePoolRequest{ +func (a *PoolAPIService) DeletePool(ctx context.Context, poolName string) ApiDeletePoolRequest { + return ApiDeletePoolRequest{ ApiService: a, ctx: ctx, poolName: poolName, @@ -72,26 +50,24 @@ func (a *PoolApiService) DeletePool(ctx _context.Context, poolName string) PoolA } // Execute executes the request -func (a *PoolApiService) DeletePoolExecute(r PoolApiApiDeletePoolRequest) (*_nethttp.Response, error) { +func (a *PoolAPIService) DeletePoolExecute(r ApiDeletePoolRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoolApiService.DeletePool") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoolAPIService.DeletePool") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/pools/{pool_name}" - localVarPath = strings.Replace(localVarPath, "{"+"pool_name"+"}", _neturl.PathEscape(parameterToString(r.poolName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pool_name"+"}", url.PathEscape(parameterValueToString(r.poolName, "poolName")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -110,7 +86,7 @@ func (a *PoolApiService) DeletePoolExecute(r PoolApiApiDeletePoolRequest) (*_net if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -120,15 +96,15 @@ func (a *PoolApiService) DeletePoolExecute(r PoolApiApiDeletePoolRequest) (*_net return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -139,7 +115,8 @@ func (a *PoolApiService) DeletePoolExecute(r PoolApiApiDeletePoolRequest) (*_net newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -149,7 +126,8 @@ func (a *PoolApiService) DeletePoolExecute(r PoolApiApiDeletePoolRequest) (*_net newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -159,7 +137,8 @@ func (a *PoolApiService) DeletePoolExecute(r PoolApiApiDeletePoolRequest) (*_net newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -169,7 +148,8 @@ func (a *PoolApiService) DeletePoolExecute(r PoolApiApiDeletePoolRequest) (*_net newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -177,26 +157,25 @@ func (a *PoolApiService) DeletePoolExecute(r PoolApiApiDeletePoolRequest) (*_net return localVarHTTPResponse, nil } -type PoolApiApiGetPoolRequest struct { - ctx _context.Context - ApiService *PoolApiService +type ApiGetPoolRequest struct { + ctx context.Context + ApiService *PoolAPIService poolName string } - -func (r PoolApiApiGetPoolRequest) Execute() (Pool, *_nethttp.Response, error) { +func (r ApiGetPoolRequest) Execute() (*Pool, *http.Response, error) { return r.ApiService.GetPoolExecute(r) } /* GetPool Get a pool - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param poolName The pool name. - @return PoolApiApiGetPoolRequest + @return ApiGetPoolRequest */ -func (a *PoolApiService) GetPool(ctx _context.Context, poolName string) PoolApiApiGetPoolRequest { - return PoolApiApiGetPoolRequest{ +func (a *PoolAPIService) GetPool(ctx context.Context, poolName string) ApiGetPoolRequest { + return ApiGetPoolRequest{ ApiService: a, ctx: ctx, poolName: poolName, @@ -205,27 +184,25 @@ func (a *PoolApiService) GetPool(ctx _context.Context, poolName string) PoolApiA // Execute executes the request // @return Pool -func (a *PoolApiService) GetPoolExecute(r PoolApiApiGetPoolRequest) (Pool, *_nethttp.Response, error) { +func (a *PoolAPIService) GetPoolExecute(r ApiGetPoolRequest) (*Pool, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Pool + formFiles []formFile + localVarReturnValue *Pool ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoolApiService.GetPool") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoolAPIService.GetPool") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/pools/{pool_name}" - localVarPath = strings.Replace(localVarPath, "{"+"pool_name"+"}", _neturl.PathEscape(parameterToString(r.poolName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pool_name"+"}", url.PathEscape(parameterValueToString(r.poolName, "poolName")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -244,7 +221,7 @@ func (a *PoolApiService) GetPoolExecute(r PoolApiApiGetPoolRequest) (Pool, *_net if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -254,15 +231,15 @@ func (a *PoolApiService) GetPoolExecute(r PoolApiApiGetPoolRequest) (Pool, *_net return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -273,7 +250,8 @@ func (a *PoolApiService) GetPoolExecute(r PoolApiApiGetPoolRequest) (Pool, *_net newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -283,7 +261,8 @@ func (a *PoolApiService) GetPoolExecute(r PoolApiApiGetPoolRequest) (Pool, *_net newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -293,14 +272,15 @@ func (a *PoolApiService) GetPoolExecute(r PoolApiApiGetPoolRequest) (Pool, *_net newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -310,42 +290,44 @@ func (a *PoolApiService) GetPoolExecute(r PoolApiApiGetPoolRequest) (Pool, *_net return localVarReturnValue, localVarHTTPResponse, nil } -type PoolApiApiGetPoolsRequest struct { - ctx _context.Context - ApiService *PoolApiService +type ApiGetPoolsRequest struct { + ctx context.Context + ApiService *PoolAPIService limit *int32 offset *int32 orderBy *string } // The numbers of items to return. -func (r PoolApiApiGetPoolsRequest) Limit(limit int32) PoolApiApiGetPoolsRequest { +func (r ApiGetPoolsRequest) Limit(limit int32) ApiGetPoolsRequest { r.limit = &limit return r } + // The number of items to skip before starting to collect the result set. -func (r PoolApiApiGetPoolsRequest) Offset(offset int32) PoolApiApiGetPoolsRequest { +func (r ApiGetPoolsRequest) Offset(offset int32) ApiGetPoolsRequest { r.offset = &offset return r } + // The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* -func (r PoolApiApiGetPoolsRequest) OrderBy(orderBy string) PoolApiApiGetPoolsRequest { +func (r ApiGetPoolsRequest) OrderBy(orderBy string) ApiGetPoolsRequest { r.orderBy = &orderBy return r } -func (r PoolApiApiGetPoolsRequest) Execute() (PoolCollection, *_nethttp.Response, error) { +func (r ApiGetPoolsRequest) Execute() (*PoolCollection, *http.Response, error) { return r.ApiService.GetPoolsExecute(r) } /* GetPools List pools - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return PoolApiApiGetPoolsRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPoolsRequest */ -func (a *PoolApiService) GetPools(ctx _context.Context) PoolApiApiGetPoolsRequest { - return PoolApiApiGetPoolsRequest{ +func (a *PoolAPIService) GetPools(ctx context.Context) ApiGetPoolsRequest { + return ApiGetPoolsRequest{ ApiService: a, ctx: ctx, } @@ -353,35 +335,36 @@ func (a *PoolApiService) GetPools(ctx _context.Context) PoolApiApiGetPoolsReques // Execute executes the request // @return PoolCollection -func (a *PoolApiService) GetPoolsExecute(r PoolApiApiGetPoolsRequest) (PoolCollection, *_nethttp.Response, error) { +func (a *PoolAPIService) GetPoolsExecute(r ApiGetPoolsRequest) (*PoolCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue PoolCollection + formFiles []formFile + localVarReturnValue *PoolCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoolApiService.GetPools") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoolAPIService.GetPools") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/pools" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue } if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") } if r.orderBy != nil { - localVarQueryParams.Add("order_by", parameterToString(*r.orderBy, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "order_by", r.orderBy, "form", "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -400,7 +383,7 @@ func (a *PoolApiService) GetPoolsExecute(r PoolApiApiGetPoolsRequest) (PoolColle if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -410,15 +393,15 @@ func (a *PoolApiService) GetPoolsExecute(r PoolApiApiGetPoolsRequest) (PoolColle return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -429,7 +412,8 @@ func (a *PoolApiService) GetPoolsExecute(r PoolApiApiGetPoolsRequest) (PoolColle newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -439,14 +423,15 @@ func (a *PoolApiService) GetPoolsExecute(r PoolApiApiGetPoolsRequest) (PoolColle newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -456,37 +441,38 @@ func (a *PoolApiService) GetPoolsExecute(r PoolApiApiGetPoolsRequest) (PoolColle return localVarReturnValue, localVarHTTPResponse, nil } -type PoolApiApiPatchPoolRequest struct { - ctx _context.Context - ApiService *PoolApiService +type ApiPatchPoolRequest struct { + ctx context.Context + ApiService *PoolAPIService poolName string pool *Pool updateMask *[]string } -func (r PoolApiApiPatchPoolRequest) Pool(pool Pool) PoolApiApiPatchPoolRequest { +func (r ApiPatchPoolRequest) Pool(pool Pool) ApiPatchPoolRequest { r.pool = &pool return r } + // The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. -func (r PoolApiApiPatchPoolRequest) UpdateMask(updateMask []string) PoolApiApiPatchPoolRequest { +func (r ApiPatchPoolRequest) UpdateMask(updateMask []string) ApiPatchPoolRequest { r.updateMask = &updateMask return r } -func (r PoolApiApiPatchPoolRequest) Execute() (Pool, *_nethttp.Response, error) { +func (r ApiPatchPoolRequest) Execute() (*Pool, *http.Response, error) { return r.ApiService.PatchPoolExecute(r) } /* PatchPool Update a pool - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param poolName The pool name. - @return PoolApiApiPatchPoolRequest + @return ApiPatchPoolRequest */ -func (a *PoolApiService) PatchPool(ctx _context.Context, poolName string) PoolApiApiPatchPoolRequest { - return PoolApiApiPatchPoolRequest{ +func (a *PoolAPIService) PatchPool(ctx context.Context, poolName string) ApiPatchPoolRequest { + return ApiPatchPoolRequest{ ApiService: a, ctx: ctx, poolName: poolName, @@ -495,33 +481,31 @@ func (a *PoolApiService) PatchPool(ctx _context.Context, poolName string) PoolAp // Execute executes the request // @return Pool -func (a *PoolApiService) PatchPoolExecute(r PoolApiApiPatchPoolRequest) (Pool, *_nethttp.Response, error) { +func (a *PoolAPIService) PatchPoolExecute(r ApiPatchPoolRequest) (*Pool, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Pool + formFiles []formFile + localVarReturnValue *Pool ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoolApiService.PatchPool") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoolAPIService.PatchPool") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/pools/{pool_name}" - localVarPath = strings.Replace(localVarPath, "{"+"pool_name"+"}", _neturl.PathEscape(parameterToString(r.poolName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"pool_name"+"}", url.PathEscape(parameterValueToString(r.poolName, "poolName")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.pool == nil { return localVarReturnValue, nil, reportError("pool is required and must be specified") } if r.updateMask != nil { - localVarQueryParams.Add("update_mask", parameterToString(*r.updateMask, "csv")) + parameterAddToHeaderOrQuery(localVarQueryParams, "update_mask", r.updateMask, "form", "csv") } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -542,7 +526,7 @@ func (a *PoolApiService) PatchPoolExecute(r PoolApiApiPatchPoolRequest) (Pool, * } // body params localVarPostBody = r.pool - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -552,15 +536,15 @@ func (a *PoolApiService) PatchPoolExecute(r PoolApiApiPatchPoolRequest) (Pool, * return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -571,7 +555,8 @@ func (a *PoolApiService) PatchPoolExecute(r PoolApiApiPatchPoolRequest) (Pool, * newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -581,7 +566,8 @@ func (a *PoolApiService) PatchPoolExecute(r PoolApiApiPatchPoolRequest) (Pool, * newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -591,7 +577,8 @@ func (a *PoolApiService) PatchPoolExecute(r PoolApiApiPatchPoolRequest) (Pool, * newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -601,7 +588,8 @@ func (a *PoolApiService) PatchPoolExecute(r PoolApiApiPatchPoolRequest) (Pool, * newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -611,14 +599,15 @@ func (a *PoolApiService) PatchPoolExecute(r PoolApiApiPatchPoolRequest) (Pool, * newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -628,29 +617,29 @@ func (a *PoolApiService) PatchPoolExecute(r PoolApiApiPatchPoolRequest) (Pool, * return localVarReturnValue, localVarHTTPResponse, nil } -type PoolApiApiPostPoolRequest struct { - ctx _context.Context - ApiService *PoolApiService +type ApiPostPoolRequest struct { + ctx context.Context + ApiService *PoolAPIService pool *Pool } -func (r PoolApiApiPostPoolRequest) Pool(pool Pool) PoolApiApiPostPoolRequest { +func (r ApiPostPoolRequest) Pool(pool Pool) ApiPostPoolRequest { r.pool = &pool return r } -func (r PoolApiApiPostPoolRequest) Execute() (Pool, *_nethttp.Response, error) { +func (r ApiPostPoolRequest) Execute() (*Pool, *http.Response, error) { return r.ApiService.PostPoolExecute(r) } /* PostPool Create a pool - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return PoolApiApiPostPoolRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPostPoolRequest */ -func (a *PoolApiService) PostPool(ctx _context.Context) PoolApiApiPostPoolRequest { - return PoolApiApiPostPoolRequest{ +func (a *PoolAPIService) PostPool(ctx context.Context) ApiPostPoolRequest { + return ApiPostPoolRequest{ ApiService: a, ctx: ctx, } @@ -658,26 +647,24 @@ func (a *PoolApiService) PostPool(ctx _context.Context) PoolApiApiPostPoolReques // Execute executes the request // @return Pool -func (a *PoolApiService) PostPoolExecute(r PoolApiApiPostPoolRequest) (Pool, *_nethttp.Response, error) { +func (a *PoolAPIService) PostPoolExecute(r ApiPostPoolRequest) (*Pool, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Pool + formFiles []formFile + localVarReturnValue *Pool ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoolApiService.PostPool") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoolAPIService.PostPool") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/pools" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.pool == nil { return localVarReturnValue, nil, reportError("pool is required and must be specified") } @@ -701,7 +688,7 @@ func (a *PoolApiService) PostPoolExecute(r PoolApiApiPostPoolRequest) (Pool, *_n } // body params localVarPostBody = r.pool - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -711,15 +698,15 @@ func (a *PoolApiService) PostPoolExecute(r PoolApiApiPostPoolRequest) (Pool, *_n return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -730,7 +717,8 @@ func (a *PoolApiService) PostPoolExecute(r PoolApiApiPostPoolRequest) (Pool, *_n newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -740,7 +728,8 @@ func (a *PoolApiService) PostPoolExecute(r PoolApiApiPostPoolRequest) (Pool, *_n newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -750,14 +739,15 @@ func (a *PoolApiService) PostPoolExecute(r PoolApiApiPostPoolRequest) (Pool, *_n newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/airflow/api_provider.go b/airflow/api_provider.go index 0fb17f9..80cac1c 100644 --- a/airflow/api_provider.go +++ b/airflow/api_provider.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -30,27 +13,22 @@ package airflow import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" ) -// Linger please -var ( - _ _context.Context -) -// ProviderApiService ProviderApi service -type ProviderApiService service +// ProviderAPIService ProviderAPI service +type ProviderAPIService service -type ProviderApiApiGetProvidersRequest struct { - ctx _context.Context - ApiService *ProviderApiService +type ApiGetProvidersRequest struct { + ctx context.Context + ApiService *ProviderAPIService } - -func (r ProviderApiApiGetProvidersRequest) Execute() (ProviderCollection, *_nethttp.Response, error) { +func (r ApiGetProvidersRequest) Execute() (*GetProviders200Response, *http.Response, error) { return r.ApiService.GetProvidersExecute(r) } @@ -62,38 +40,36 @@ Get a list of providers. *New in version 2.1.0* - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ProviderApiApiGetProvidersRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetProvidersRequest */ -func (a *ProviderApiService) GetProviders(ctx _context.Context) ProviderApiApiGetProvidersRequest { - return ProviderApiApiGetProvidersRequest{ +func (a *ProviderAPIService) GetProviders(ctx context.Context) ApiGetProvidersRequest { + return ApiGetProvidersRequest{ ApiService: a, ctx: ctx, } } // Execute executes the request -// @return ProviderCollection -func (a *ProviderApiService) GetProvidersExecute(r ProviderApiApiGetProvidersRequest) (ProviderCollection, *_nethttp.Response, error) { +// @return GetProviders200Response +func (a *ProviderAPIService) GetProvidersExecute(r ApiGetProvidersRequest) (*GetProviders200Response, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ProviderCollection + formFiles []formFile + localVarReturnValue *GetProviders200Response ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProviderApiService.GetProviders") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProviderAPIService.GetProviders") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/providers" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -112,7 +88,7 @@ func (a *ProviderApiService) GetProvidersExecute(r ProviderApiApiGetProvidersReq if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -122,15 +98,15 @@ func (a *ProviderApiService) GetProvidersExecute(r ProviderApiApiGetProvidersReq return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -141,7 +117,8 @@ func (a *ProviderApiService) GetProvidersExecute(r ProviderApiApiGetProvidersReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -151,14 +128,15 @@ func (a *ProviderApiService) GetProvidersExecute(r ProviderApiApiGetProvidersReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/airflow/api_role.go b/airflow/api_role.go index 2560ea9..4329b04 100644 --- a/airflow/api_role.go +++ b/airflow/api_role.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -30,29 +13,24 @@ package airflow import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) -// RoleApiService RoleApi service -type RoleApiService service +// RoleAPIService RoleAPI service +type RoleAPIService service -type RoleApiApiDeleteRoleRequest struct { - ctx _context.Context - ApiService *RoleApiService +type ApiDeleteRoleRequest struct { + ctx context.Context + ApiService *RoleAPIService roleName string } - -func (r RoleApiApiDeleteRoleRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeleteRoleRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteRoleExecute(r) } @@ -61,15 +39,17 @@ DeleteRole Delete a role Delete a role. -*New in version 2.1.0* +*This API endpoint is deprecated, please use the endpoint `/auth/fab/v1` for this operation instead.* - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param roleName The role name - @return RoleApiApiDeleteRoleRequest + @return ApiDeleteRoleRequest + +Deprecated */ -func (a *RoleApiService) DeleteRole(ctx _context.Context, roleName string) RoleApiApiDeleteRoleRequest { - return RoleApiApiDeleteRoleRequest{ +func (a *RoleAPIService) DeleteRole(ctx context.Context, roleName string) ApiDeleteRoleRequest { + return ApiDeleteRoleRequest{ ApiService: a, ctx: ctx, roleName: roleName, @@ -77,26 +57,25 @@ func (a *RoleApiService) DeleteRole(ctx _context.Context, roleName string) RoleA } // Execute executes the request -func (a *RoleApiService) DeleteRoleExecute(r RoleApiApiDeleteRoleRequest) (*_nethttp.Response, error) { +// Deprecated +func (a *RoleAPIService) DeleteRoleExecute(r ApiDeleteRoleRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RoleApiService.DeleteRole") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RoleAPIService.DeleteRole") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/roles/{role_name}" - localVarPath = strings.Replace(localVarPath, "{"+"role_name"+"}", _neturl.PathEscape(parameterToString(r.roleName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"role_name"+"}", url.PathEscape(parameterValueToString(r.roleName, "roleName")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -115,7 +94,7 @@ func (a *RoleApiService) DeleteRoleExecute(r RoleApiApiDeleteRoleRequest) (*_net if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -125,15 +104,15 @@ func (a *RoleApiService) DeleteRoleExecute(r RoleApiApiDeleteRoleRequest) (*_net return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -144,7 +123,8 @@ func (a *RoleApiService) DeleteRoleExecute(r RoleApiApiDeleteRoleRequest) (*_net newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -154,7 +134,8 @@ func (a *RoleApiService) DeleteRoleExecute(r RoleApiApiDeleteRoleRequest) (*_net newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -164,7 +145,8 @@ func (a *RoleApiService) DeleteRoleExecute(r RoleApiApiDeleteRoleRequest) (*_net newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -174,7 +156,8 @@ func (a *RoleApiService) DeleteRoleExecute(r RoleApiApiDeleteRoleRequest) (*_net newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -182,14 +165,13 @@ func (a *RoleApiService) DeleteRoleExecute(r RoleApiApiDeleteRoleRequest) (*_net return localVarHTTPResponse, nil } -type RoleApiApiGetRoleRequest struct { - ctx _context.Context - ApiService *RoleApiService +type ApiGetRoleRequest struct { + ctx context.Context + ApiService *RoleAPIService roleName string } - -func (r RoleApiApiGetRoleRequest) Execute() (Role, *_nethttp.Response, error) { +func (r ApiGetRoleRequest) Execute() (*Role, *http.Response, error) { return r.ApiService.GetRoleExecute(r) } @@ -198,15 +180,17 @@ GetRole Get a role Get a role. -*New in version 2.1.0* +*This API endpoint is deprecated, please use the endpoint `/auth/fab/v1` for this operation instead.* - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param roleName The role name - @return RoleApiApiGetRoleRequest + @return ApiGetRoleRequest + +Deprecated */ -func (a *RoleApiService) GetRole(ctx _context.Context, roleName string) RoleApiApiGetRoleRequest { - return RoleApiApiGetRoleRequest{ +func (a *RoleAPIService) GetRole(ctx context.Context, roleName string) ApiGetRoleRequest { + return ApiGetRoleRequest{ ApiService: a, ctx: ctx, roleName: roleName, @@ -215,27 +199,26 @@ func (a *RoleApiService) GetRole(ctx _context.Context, roleName string) RoleApiA // Execute executes the request // @return Role -func (a *RoleApiService) GetRoleExecute(r RoleApiApiGetRoleRequest) (Role, *_nethttp.Response, error) { +// Deprecated +func (a *RoleAPIService) GetRoleExecute(r ApiGetRoleRequest) (*Role, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Role + formFiles []formFile + localVarReturnValue *Role ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RoleApiService.GetRole") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RoleAPIService.GetRole") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/roles/{role_name}" - localVarPath = strings.Replace(localVarPath, "{"+"role_name"+"}", _neturl.PathEscape(parameterToString(r.roleName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"role_name"+"}", url.PathEscape(parameterValueToString(r.roleName, "roleName")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -254,7 +237,7 @@ func (a *RoleApiService) GetRoleExecute(r RoleApiApiGetRoleRequest) (Role, *_net if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -264,15 +247,15 @@ func (a *RoleApiService) GetRoleExecute(r RoleApiApiGetRoleRequest) (Role, *_net return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -283,7 +266,8 @@ func (a *RoleApiService) GetRoleExecute(r RoleApiApiGetRoleRequest) (Role, *_net newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -293,7 +277,8 @@ func (a *RoleApiService) GetRoleExecute(r RoleApiApiGetRoleRequest) (Role, *_net newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -303,14 +288,15 @@ func (a *RoleApiService) GetRoleExecute(r RoleApiApiGetRoleRequest) (Role, *_net newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -320,31 +306,33 @@ func (a *RoleApiService) GetRoleExecute(r RoleApiApiGetRoleRequest) (Role, *_net return localVarReturnValue, localVarHTTPResponse, nil } -type RoleApiApiGetRolesRequest struct { - ctx _context.Context - ApiService *RoleApiService +type ApiGetRolesRequest struct { + ctx context.Context + ApiService *RoleAPIService limit *int32 offset *int32 orderBy *string } // The numbers of items to return. -func (r RoleApiApiGetRolesRequest) Limit(limit int32) RoleApiApiGetRolesRequest { +func (r ApiGetRolesRequest) Limit(limit int32) ApiGetRolesRequest { r.limit = &limit return r } + // The number of items to skip before starting to collect the result set. -func (r RoleApiApiGetRolesRequest) Offset(offset int32) RoleApiApiGetRolesRequest { +func (r ApiGetRolesRequest) Offset(offset int32) ApiGetRolesRequest { r.offset = &offset return r } + // The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* -func (r RoleApiApiGetRolesRequest) OrderBy(orderBy string) RoleApiApiGetRolesRequest { +func (r ApiGetRolesRequest) OrderBy(orderBy string) ApiGetRolesRequest { r.orderBy = &orderBy return r } -func (r RoleApiApiGetRolesRequest) Execute() (RoleCollection, *_nethttp.Response, error) { +func (r ApiGetRolesRequest) Execute() (*RoleCollection, *http.Response, error) { return r.ApiService.GetRolesExecute(r) } @@ -353,14 +341,16 @@ GetRoles List roles Get a list of roles. -*New in version 2.1.0* +*This API endpoint is deprecated, please use the endpoint `/auth/fab/v1` for this operation instead.* + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetRolesRequest - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return RoleApiApiGetRolesRequest +Deprecated */ -func (a *RoleApiService) GetRoles(ctx _context.Context) RoleApiApiGetRolesRequest { - return RoleApiApiGetRolesRequest{ +func (a *RoleAPIService) GetRoles(ctx context.Context) ApiGetRolesRequest { + return ApiGetRolesRequest{ ApiService: a, ctx: ctx, } @@ -368,35 +358,37 @@ func (a *RoleApiService) GetRoles(ctx _context.Context) RoleApiApiGetRolesReques // Execute executes the request // @return RoleCollection -func (a *RoleApiService) GetRolesExecute(r RoleApiApiGetRolesRequest) (RoleCollection, *_nethttp.Response, error) { +// Deprecated +func (a *RoleAPIService) GetRolesExecute(r ApiGetRolesRequest) (*RoleCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue RoleCollection + formFiles []formFile + localVarReturnValue *RoleCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RoleApiService.GetRoles") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RoleAPIService.GetRoles") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/roles" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue } if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") } if r.orderBy != nil { - localVarQueryParams.Add("order_by", parameterToString(*r.orderBy, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "order_by", r.orderBy, "form", "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -415,7 +407,7 @@ func (a *RoleApiService) GetRolesExecute(r RoleApiApiGetRolesRequest) (RoleColle if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -425,15 +417,15 @@ func (a *RoleApiService) GetRolesExecute(r RoleApiApiGetRolesRequest) (RoleColle return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -444,7 +436,8 @@ func (a *RoleApiService) GetRolesExecute(r RoleApiApiGetRolesRequest) (RoleColle newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -454,14 +447,15 @@ func (a *RoleApiService) GetRolesExecute(r RoleApiApiGetRolesRequest) (RoleColle newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -471,25 +465,26 @@ func (a *RoleApiService) GetRolesExecute(r RoleApiApiGetRolesRequest) (RoleColle return localVarReturnValue, localVarHTTPResponse, nil } -type RoleApiApiPatchRoleRequest struct { - ctx _context.Context - ApiService *RoleApiService +type ApiPatchRoleRequest struct { + ctx context.Context + ApiService *RoleAPIService roleName string role *Role updateMask *[]string } -func (r RoleApiApiPatchRoleRequest) Role(role Role) RoleApiApiPatchRoleRequest { +func (r ApiPatchRoleRequest) Role(role Role) ApiPatchRoleRequest { r.role = &role return r } + // The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. -func (r RoleApiApiPatchRoleRequest) UpdateMask(updateMask []string) RoleApiApiPatchRoleRequest { +func (r ApiPatchRoleRequest) UpdateMask(updateMask []string) ApiPatchRoleRequest { r.updateMask = &updateMask return r } -func (r RoleApiApiPatchRoleRequest) Execute() (Role, *_nethttp.Response, error) { +func (r ApiPatchRoleRequest) Execute() (*Role, *http.Response, error) { return r.ApiService.PatchRoleExecute(r) } @@ -498,15 +493,17 @@ PatchRole Update a role Update a role. -*New in version 2.1.0* +*This API endpoint is deprecated, please use the endpoint `/auth/fab/v1` for this operation instead.* - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param roleName The role name - @return RoleApiApiPatchRoleRequest + @return ApiPatchRoleRequest + +Deprecated */ -func (a *RoleApiService) PatchRole(ctx _context.Context, roleName string) RoleApiApiPatchRoleRequest { - return RoleApiApiPatchRoleRequest{ +func (a *RoleAPIService) PatchRole(ctx context.Context, roleName string) ApiPatchRoleRequest { + return ApiPatchRoleRequest{ ApiService: a, ctx: ctx, roleName: roleName, @@ -515,33 +512,32 @@ func (a *RoleApiService) PatchRole(ctx _context.Context, roleName string) RoleAp // Execute executes the request // @return Role -func (a *RoleApiService) PatchRoleExecute(r RoleApiApiPatchRoleRequest) (Role, *_nethttp.Response, error) { +// Deprecated +func (a *RoleAPIService) PatchRoleExecute(r ApiPatchRoleRequest) (*Role, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Role + formFiles []formFile + localVarReturnValue *Role ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RoleApiService.PatchRole") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RoleAPIService.PatchRole") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/roles/{role_name}" - localVarPath = strings.Replace(localVarPath, "{"+"role_name"+"}", _neturl.PathEscape(parameterToString(r.roleName, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"role_name"+"}", url.PathEscape(parameterValueToString(r.roleName, "roleName")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.role == nil { return localVarReturnValue, nil, reportError("role is required and must be specified") } if r.updateMask != nil { - localVarQueryParams.Add("update_mask", parameterToString(*r.updateMask, "csv")) + parameterAddToHeaderOrQuery(localVarQueryParams, "update_mask", r.updateMask, "form", "csv") } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -562,7 +558,7 @@ func (a *RoleApiService) PatchRoleExecute(r RoleApiApiPatchRoleRequest) (Role, * } // body params localVarPostBody = r.role - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -572,15 +568,15 @@ func (a *RoleApiService) PatchRoleExecute(r RoleApiApiPatchRoleRequest) (Role, * return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -591,7 +587,8 @@ func (a *RoleApiService) PatchRoleExecute(r RoleApiApiPatchRoleRequest) (Role, * newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -601,7 +598,8 @@ func (a *RoleApiService) PatchRoleExecute(r RoleApiApiPatchRoleRequest) (Role, * newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -611,7 +609,8 @@ func (a *RoleApiService) PatchRoleExecute(r RoleApiApiPatchRoleRequest) (Role, * newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -621,14 +620,15 @@ func (a *RoleApiService) PatchRoleExecute(r RoleApiApiPatchRoleRequest) (Role, * newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -638,18 +638,18 @@ func (a *RoleApiService) PatchRoleExecute(r RoleApiApiPatchRoleRequest) (Role, * return localVarReturnValue, localVarHTTPResponse, nil } -type RoleApiApiPostRoleRequest struct { - ctx _context.Context - ApiService *RoleApiService +type ApiPostRoleRequest struct { + ctx context.Context + ApiService *RoleAPIService role *Role } -func (r RoleApiApiPostRoleRequest) Role(role Role) RoleApiApiPostRoleRequest { +func (r ApiPostRoleRequest) Role(role Role) ApiPostRoleRequest { r.role = &role return r } -func (r RoleApiApiPostRoleRequest) Execute() (Role, *_nethttp.Response, error) { +func (r ApiPostRoleRequest) Execute() (*Role, *http.Response, error) { return r.ApiService.PostRoleExecute(r) } @@ -658,14 +658,16 @@ PostRole Create a role Create a new role. -*New in version 2.1.0* +*This API endpoint is deprecated, please use the endpoint `/auth/fab/v1` for this operation instead.* + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPostRoleRequest - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return RoleApiApiPostRoleRequest +Deprecated */ -func (a *RoleApiService) PostRole(ctx _context.Context) RoleApiApiPostRoleRequest { - return RoleApiApiPostRoleRequest{ +func (a *RoleAPIService) PostRole(ctx context.Context) ApiPostRoleRequest { + return ApiPostRoleRequest{ ApiService: a, ctx: ctx, } @@ -673,26 +675,25 @@ func (a *RoleApiService) PostRole(ctx _context.Context) RoleApiApiPostRoleReques // Execute executes the request // @return Role -func (a *RoleApiService) PostRoleExecute(r RoleApiApiPostRoleRequest) (Role, *_nethttp.Response, error) { +// Deprecated +func (a *RoleAPIService) PostRoleExecute(r ApiPostRoleRequest) (*Role, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Role + formFiles []formFile + localVarReturnValue *Role ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RoleApiService.PostRole") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RoleAPIService.PostRole") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/roles" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.role == nil { return localVarReturnValue, nil, reportError("role is required and must be specified") } @@ -716,7 +717,7 @@ func (a *RoleApiService) PostRoleExecute(r RoleApiApiPostRoleRequest) (Role, *_n } // body params localVarPostBody = r.role - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -726,15 +727,15 @@ func (a *RoleApiService) PostRoleExecute(r RoleApiApiPostRoleRequest) (Role, *_n return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -745,7 +746,8 @@ func (a *RoleApiService) PostRoleExecute(r RoleApiApiPostRoleRequest) (Role, *_n newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -755,7 +757,8 @@ func (a *RoleApiService) PostRoleExecute(r RoleApiApiPostRoleRequest) (Role, *_n newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -765,14 +768,15 @@ func (a *RoleApiService) PostRoleExecute(r RoleApiApiPostRoleRequest) (Role, *_n newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/airflow/api_task_instance.go b/airflow/api_task_instance.go index 1517631..6abb920 100644 --- a/airflow/api_task_instance.go +++ b/airflow/api_task_instance.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -30,33 +13,35 @@ package airflow import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" "strings" "time" "reflect" ) -// Linger please -var ( - _ _context.Context -) -// TaskInstanceApiService TaskInstanceApi service -type TaskInstanceApiService service +// TaskInstanceAPIService TaskInstanceAPI service +type TaskInstanceAPIService service -type TaskInstanceApiApiGetExtraLinksRequest struct { - ctx _context.Context - ApiService *TaskInstanceApiService +type ApiGetExtraLinksRequest struct { + ctx context.Context + ApiService *TaskInstanceAPIService dagId string dagRunId string taskId string + mapIndex *int32 } +// Filter on map index for mapped task. +func (r ApiGetExtraLinksRequest) MapIndex(mapIndex int32) ApiGetExtraLinksRequest { + r.mapIndex = &mapIndex + return r +} -func (r TaskInstanceApiApiGetExtraLinksRequest) Execute() (ExtraLinkCollection, *_nethttp.Response, error) { +func (r ApiGetExtraLinksRequest) Execute() (*ExtraLinkCollection, *http.Response, error) { return r.ApiService.GetExtraLinksExecute(r) } @@ -66,14 +51,14 @@ GetExtraLinks List extra links List extra links for task instance. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. @param dagRunId The DAG run ID. @param taskId The task ID. - @return TaskInstanceApiApiGetExtraLinksRequest + @return ApiGetExtraLinksRequest */ -func (a *TaskInstanceApiService) GetExtraLinks(ctx _context.Context, dagId string, dagRunId string, taskId string) TaskInstanceApiApiGetExtraLinksRequest { - return TaskInstanceApiApiGetExtraLinksRequest{ +func (a *TaskInstanceAPIService) GetExtraLinks(ctx context.Context, dagId string, dagRunId string, taskId string) ApiGetExtraLinksRequest { + return ApiGetExtraLinksRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -84,30 +69,31 @@ func (a *TaskInstanceApiService) GetExtraLinks(ctx _context.Context, dagId strin // Execute executes the request // @return ExtraLinkCollection -func (a *TaskInstanceApiService) GetExtraLinksExecute(r TaskInstanceApiApiGetExtraLinksRequest) (ExtraLinkCollection, *_nethttp.Response, error) { +func (a *TaskInstanceAPIService) GetExtraLinksExecute(r ApiGetExtraLinksRequest) (*ExtraLinkCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue ExtraLinkCollection + formFiles []formFile + localVarReturnValue *ExtraLinkCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceApiService.GetExtraLinks") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceAPIService.GetExtraLinks") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/links" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", _neturl.PathEscape(parameterToString(r.dagRunId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", _neturl.PathEscape(parameterToString(r.taskId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", url.PathEscape(parameterValueToString(r.taskId, "taskId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.mapIndex != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "map_index", r.mapIndex, "form", "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -125,7 +111,7 @@ func (a *TaskInstanceApiService) GetExtraLinksExecute(r TaskInstanceApiApiGetExt if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -135,15 +121,15 @@ func (a *TaskInstanceApiService) GetExtraLinksExecute(r TaskInstanceApiApiGetExt return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -154,7 +140,8 @@ func (a *TaskInstanceApiService) GetExtraLinksExecute(r TaskInstanceApiApiGetExt newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -164,7 +151,8 @@ func (a *TaskInstanceApiService) GetExtraLinksExecute(r TaskInstanceApiApiGetExt newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -174,14 +162,15 @@ func (a *TaskInstanceApiService) GetExtraLinksExecute(r TaskInstanceApiApiGetExt newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -191,9 +180,9 @@ func (a *TaskInstanceApiService) GetExtraLinksExecute(r TaskInstanceApiApiGetExt return localVarReturnValue, localVarHTTPResponse, nil } -type TaskInstanceApiApiGetLogRequest struct { - ctx _context.Context - ApiService *TaskInstanceApiService +type ApiGetLogRequest struct { + ctx context.Context + ApiService *TaskInstanceAPIService dagId string dagRunId string taskId string @@ -204,22 +193,24 @@ type TaskInstanceApiApiGetLogRequest struct { } // A full content will be returned. By default, only the first fragment will be returned. -func (r TaskInstanceApiApiGetLogRequest) FullContent(fullContent bool) TaskInstanceApiApiGetLogRequest { +func (r ApiGetLogRequest) FullContent(fullContent bool) ApiGetLogRequest { r.fullContent = &fullContent return r } + // Filter on map index for mapped task. -func (r TaskInstanceApiApiGetLogRequest) MapIndex(mapIndex int32) TaskInstanceApiApiGetLogRequest { +func (r ApiGetLogRequest) MapIndex(mapIndex int32) ApiGetLogRequest { r.mapIndex = &mapIndex return r } + // A token that allows you to continue fetching logs. If passed, it will specify the location from which the download should be continued. -func (r TaskInstanceApiApiGetLogRequest) Token(token string) TaskInstanceApiApiGetLogRequest { +func (r ApiGetLogRequest) Token(token string) ApiGetLogRequest { r.token = &token return r } -func (r TaskInstanceApiApiGetLogRequest) Execute() (InlineResponse200, *_nethttp.Response, error) { +func (r ApiGetLogRequest) Execute() (*GetLog200Response, *http.Response, error) { return r.ApiService.GetLogExecute(r) } @@ -227,16 +218,43 @@ func (r TaskInstanceApiApiGetLogRequest) Execute() (InlineResponse200, *_nethttp GetLog Get logs Get logs for a specific task instance and its try number. +To get log from specific character position, following way of using +URLSafeSerializer can be used. + +Example: +``` +from itsdangerous.url_safe import URLSafeSerializer + +request_url = f"api/v1/dags/{DAG_ID}/dagRuns/{RUN_ID}/taskInstances/{TASK_ID}/logs/1" +key = app.config["SECRET_KEY"] +serializer = URLSafeSerializer(key) +token = serializer.dumps({"log_pos": 10000}) + +response = self.client.get( + request_url, + query_string={"token": token}, + headers={"Accept": "text/plain"}, + environ_overrides={"REMOTE_USER": "test"}, +) +continuation_token = response.json["continuation_token"] + metadata = URLSafeSerializer(key).loads(continuation_token) + log_pos = metadata["log_pos"] + end_of_log = metadata["end_of_log"] +``` +If log_pos is passed as 10000 like the above example, it renders the logs starting +from char position 10000 to last (not the end as the logs may be tailing behind in +running state). This way pagination can be done with metadata as part of the token. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. @param dagRunId The DAG run ID. @param taskId The task ID. @param taskTryNumber The task try number. - @return TaskInstanceApiApiGetLogRequest + @return ApiGetLogRequest */ -func (a *TaskInstanceApiService) GetLog(ctx _context.Context, dagId string, dagRunId string, taskId string, taskTryNumber int32) TaskInstanceApiApiGetLogRequest { - return TaskInstanceApiApiGetLogRequest{ +func (a *TaskInstanceAPIService) GetLog(ctx context.Context, dagId string, dagRunId string, taskId string, taskTryNumber int32) ApiGetLogRequest { + return ApiGetLogRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -247,40 +265,38 @@ func (a *TaskInstanceApiService) GetLog(ctx _context.Context, dagId string, dagR } // Execute executes the request -// @return InlineResponse200 -func (a *TaskInstanceApiService) GetLogExecute(r TaskInstanceApiApiGetLogRequest) (InlineResponse200, *_nethttp.Response, error) { +// @return GetLog200Response +func (a *TaskInstanceAPIService) GetLogExecute(r ApiGetLogRequest) (*GetLog200Response, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue InlineResponse200 + formFiles []formFile + localVarReturnValue *GetLog200Response ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceApiService.GetLog") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceAPIService.GetLog") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/logs/{task_try_number}" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", _neturl.PathEscape(parameterToString(r.dagRunId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", _neturl.PathEscape(parameterToString(r.taskId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"task_try_number"+"}", _neturl.PathEscape(parameterToString(r.taskTryNumber, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", url.PathEscape(parameterValueToString(r.taskId, "taskId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"task_try_number"+"}", url.PathEscape(parameterValueToString(r.taskTryNumber, "taskTryNumber")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.fullContent != nil { - localVarQueryParams.Add("full_content", parameterToString(*r.fullContent, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "full_content", r.fullContent, "form", "") } if r.mapIndex != nil { - localVarQueryParams.Add("map_index", parameterToString(*r.mapIndex, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "map_index", r.mapIndex, "form", "") } if r.token != nil { - localVarQueryParams.Add("token", parameterToString(*r.token, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "token", r.token, "form", "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -299,7 +315,7 @@ func (a *TaskInstanceApiService) GetLogExecute(r TaskInstanceApiApiGetLogRequest if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -309,15 +325,15 @@ func (a *TaskInstanceApiService) GetLogExecute(r TaskInstanceApiApiGetLogRequest return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -328,7 +344,8 @@ func (a *TaskInstanceApiService) GetLogExecute(r TaskInstanceApiApiGetLogRequest newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -338,7 +355,8 @@ func (a *TaskInstanceApiService) GetLogExecute(r TaskInstanceApiApiGetLogRequest newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -348,7 +366,8 @@ func (a *TaskInstanceApiService) GetLogExecute(r TaskInstanceApiApiGetLogRequest newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -358,14 +377,15 @@ func (a *TaskInstanceApiService) GetLogExecute(r TaskInstanceApiApiGetLogRequest newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -375,17 +395,16 @@ func (a *TaskInstanceApiService) GetLogExecute(r TaskInstanceApiApiGetLogRequest return localVarReturnValue, localVarHTTPResponse, nil } -type TaskInstanceApiApiGetMappedTaskInstanceRequest struct { - ctx _context.Context - ApiService *TaskInstanceApiService +type ApiGetMappedTaskInstanceRequest struct { + ctx context.Context + ApiService *TaskInstanceAPIService dagId string dagRunId string taskId string mapIndex int32 } - -func (r TaskInstanceApiApiGetMappedTaskInstanceRequest) Execute() (TaskInstance, *_nethttp.Response, error) { +func (r ApiGetMappedTaskInstanceRequest) Execute() (*TaskInstance, *http.Response, error) { return r.ApiService.GetMappedTaskInstanceExecute(r) } @@ -397,15 +416,15 @@ Get details of a mapped task instance. *New in version 2.3.0* - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. @param dagRunId The DAG run ID. @param taskId The task ID. @param mapIndex The map index. - @return TaskInstanceApiApiGetMappedTaskInstanceRequest + @return ApiGetMappedTaskInstanceRequest */ -func (a *TaskInstanceApiService) GetMappedTaskInstance(ctx _context.Context, dagId string, dagRunId string, taskId string, mapIndex int32) TaskInstanceApiApiGetMappedTaskInstanceRequest { - return TaskInstanceApiApiGetMappedTaskInstanceRequest{ +func (a *TaskInstanceAPIService) GetMappedTaskInstance(ctx context.Context, dagId string, dagRunId string, taskId string, mapIndex int32) ApiGetMappedTaskInstanceRequest { + return ApiGetMappedTaskInstanceRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -417,30 +436,28 @@ func (a *TaskInstanceApiService) GetMappedTaskInstance(ctx _context.Context, dag // Execute executes the request // @return TaskInstance -func (a *TaskInstanceApiService) GetMappedTaskInstanceExecute(r TaskInstanceApiApiGetMappedTaskInstanceRequest) (TaskInstance, *_nethttp.Response, error) { +func (a *TaskInstanceAPIService) GetMappedTaskInstanceExecute(r ApiGetMappedTaskInstanceRequest) (*TaskInstance, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue TaskInstance + formFiles []formFile + localVarReturnValue *TaskInstance ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceApiService.GetMappedTaskInstance") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceAPIService.GetMappedTaskInstance") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", _neturl.PathEscape(parameterToString(r.dagRunId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", _neturl.PathEscape(parameterToString(r.taskId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"map_index"+"}", _neturl.PathEscape(parameterToString(r.mapIndex, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", url.PathEscape(parameterValueToString(r.taskId, "taskId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"map_index"+"}", url.PathEscape(parameterValueToString(r.mapIndex, "mapIndex")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -459,7 +476,7 @@ func (a *TaskInstanceApiService) GetMappedTaskInstanceExecute(r TaskInstanceApiA if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -469,15 +486,15 @@ func (a *TaskInstanceApiService) GetMappedTaskInstanceExecute(r TaskInstanceApiA return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -488,7 +505,8 @@ func (a *TaskInstanceApiService) GetMappedTaskInstanceExecute(r TaskInstanceApiA newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -498,7 +516,8 @@ func (a *TaskInstanceApiService) GetMappedTaskInstanceExecute(r TaskInstanceApiA newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -508,14 +527,15 @@ func (a *TaskInstanceApiService) GetMappedTaskInstanceExecute(r TaskInstanceApiA newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -525,219 +545,70 @@ func (a *TaskInstanceApiService) GetMappedTaskInstanceExecute(r TaskInstanceApiA return localVarReturnValue, localVarHTTPResponse, nil } -type TaskInstanceApiApiGetMappedTaskInstancesRequest struct { - ctx _context.Context - ApiService *TaskInstanceApiService +type ApiGetMappedTaskInstanceDependenciesRequest struct { + ctx context.Context + ApiService *TaskInstanceAPIService dagId string dagRunId string taskId string - limit *int32 - offset *int32 - executionDateGte *time.Time - executionDateLte *time.Time - startDateGte *time.Time - startDateLte *time.Time - endDateGte *time.Time - endDateLte *time.Time - durationGte *float32 - durationLte *float32 - state *[]string - pool *[]string - queue *[]string - orderBy *string -} - -// The numbers of items to return. -func (r TaskInstanceApiApiGetMappedTaskInstancesRequest) Limit(limit int32) TaskInstanceApiApiGetMappedTaskInstancesRequest { - r.limit = &limit - return r -} -// The number of items to skip before starting to collect the result set. -func (r TaskInstanceApiApiGetMappedTaskInstancesRequest) Offset(offset int32) TaskInstanceApiApiGetMappedTaskInstancesRequest { - r.offset = &offset - return r -} -// Returns objects greater or equal to the specified date. This can be combined with execution_date_lte parameter to receive only the selected period. -func (r TaskInstanceApiApiGetMappedTaskInstancesRequest) ExecutionDateGte(executionDateGte time.Time) TaskInstanceApiApiGetMappedTaskInstancesRequest { - r.executionDateGte = &executionDateGte - return r -} -// Returns objects less than or equal to the specified date. This can be combined with execution_date_gte parameter to receive only the selected period. -func (r TaskInstanceApiApiGetMappedTaskInstancesRequest) ExecutionDateLte(executionDateLte time.Time) TaskInstanceApiApiGetMappedTaskInstancesRequest { - r.executionDateLte = &executionDateLte - return r -} -// Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. -func (r TaskInstanceApiApiGetMappedTaskInstancesRequest) StartDateGte(startDateGte time.Time) TaskInstanceApiApiGetMappedTaskInstancesRequest { - r.startDateGte = &startDateGte - return r -} -// Returns objects less or equal the specified date. This can be combined with start_date_gte parameter to receive only the selected period. -func (r TaskInstanceApiApiGetMappedTaskInstancesRequest) StartDateLte(startDateLte time.Time) TaskInstanceApiApiGetMappedTaskInstancesRequest { - r.startDateLte = &startDateLte - return r -} -// Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. -func (r TaskInstanceApiApiGetMappedTaskInstancesRequest) EndDateGte(endDateGte time.Time) TaskInstanceApiApiGetMappedTaskInstancesRequest { - r.endDateGte = &endDateGte - return r -} -// Returns objects less than or equal to the specified date. This can be combined with start_date_gte parameter to receive only the selected period. -func (r TaskInstanceApiApiGetMappedTaskInstancesRequest) EndDateLte(endDateLte time.Time) TaskInstanceApiApiGetMappedTaskInstancesRequest { - r.endDateLte = &endDateLte - return r -} -// Returns objects greater than or equal to the specified values. This can be combined with duration_lte parameter to receive only the selected period. -func (r TaskInstanceApiApiGetMappedTaskInstancesRequest) DurationGte(durationGte float32) TaskInstanceApiApiGetMappedTaskInstancesRequest { - r.durationGte = &durationGte - return r -} -// Returns objects less than or equal to the specified values. This can be combined with duration_gte parameter to receive only the selected range. -func (r TaskInstanceApiApiGetMappedTaskInstancesRequest) DurationLte(durationLte float32) TaskInstanceApiApiGetMappedTaskInstancesRequest { - r.durationLte = &durationLte - return r -} -// The value can be repeated to retrieve multiple matching values (OR condition). -func (r TaskInstanceApiApiGetMappedTaskInstancesRequest) State(state []string) TaskInstanceApiApiGetMappedTaskInstancesRequest { - r.state = &state - return r -} -// The value can be repeated to retrieve multiple matching values (OR condition). -func (r TaskInstanceApiApiGetMappedTaskInstancesRequest) Pool(pool []string) TaskInstanceApiApiGetMappedTaskInstancesRequest { - r.pool = &pool - return r -} -// The value can be repeated to retrieve multiple matching values (OR condition). -func (r TaskInstanceApiApiGetMappedTaskInstancesRequest) Queue(queue []string) TaskInstanceApiApiGetMappedTaskInstancesRequest { - r.queue = &queue - return r -} -// The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* -func (r TaskInstanceApiApiGetMappedTaskInstancesRequest) OrderBy(orderBy string) TaskInstanceApiApiGetMappedTaskInstancesRequest { - r.orderBy = &orderBy - return r + mapIndex int32 } -func (r TaskInstanceApiApiGetMappedTaskInstancesRequest) Execute() (TaskInstanceCollection, *_nethttp.Response, error) { - return r.ApiService.GetMappedTaskInstancesExecute(r) +func (r ApiGetMappedTaskInstanceDependenciesRequest) Execute() (*TaskInstanceDependencyCollection, *http.Response, error) { + return r.ApiService.GetMappedTaskInstanceDependenciesExecute(r) } /* -GetMappedTaskInstances List mapped task instances +GetMappedTaskInstanceDependencies Get task dependencies blocking task from getting scheduled. -Get details of all mapped task instances. +Get task dependencies blocking task from getting scheduled. -*New in version 2.3.0* +*New in version 2.10.0* - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. @param dagRunId The DAG run ID. @param taskId The task ID. - @return TaskInstanceApiApiGetMappedTaskInstancesRequest + @param mapIndex The map index. + @return ApiGetMappedTaskInstanceDependenciesRequest */ -func (a *TaskInstanceApiService) GetMappedTaskInstances(ctx _context.Context, dagId string, dagRunId string, taskId string) TaskInstanceApiApiGetMappedTaskInstancesRequest { - return TaskInstanceApiApiGetMappedTaskInstancesRequest{ +func (a *TaskInstanceAPIService) GetMappedTaskInstanceDependencies(ctx context.Context, dagId string, dagRunId string, taskId string, mapIndex int32) ApiGetMappedTaskInstanceDependenciesRequest { + return ApiGetMappedTaskInstanceDependenciesRequest{ ApiService: a, ctx: ctx, dagId: dagId, dagRunId: dagRunId, taskId: taskId, + mapIndex: mapIndex, } } // Execute executes the request -// @return TaskInstanceCollection -func (a *TaskInstanceApiService) GetMappedTaskInstancesExecute(r TaskInstanceApiApiGetMappedTaskInstancesRequest) (TaskInstanceCollection, *_nethttp.Response, error) { +// @return TaskInstanceDependencyCollection +func (a *TaskInstanceAPIService) GetMappedTaskInstanceDependenciesExecute(r ApiGetMappedTaskInstanceDependenciesRequest) (*TaskInstanceDependencyCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue TaskInstanceCollection + formFiles []formFile + localVarReturnValue *TaskInstanceDependencyCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceApiService.GetMappedTaskInstances") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceAPIService.GetMappedTaskInstanceDependencies") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/listMapped" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", _neturl.PathEscape(parameterToString(r.dagRunId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", _neturl.PathEscape(parameterToString(r.taskId, "")), -1) + localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}/dependencies" + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", url.PathEscape(parameterValueToString(r.taskId, "taskId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"map_index"+"}", url.PathEscape(parameterValueToString(r.mapIndex, "mapIndex")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} - if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) - } - if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) - } - if r.executionDateGte != nil { - localVarQueryParams.Add("execution_date_gte", parameterToString(*r.executionDateGte, "")) - } - if r.executionDateLte != nil { - localVarQueryParams.Add("execution_date_lte", parameterToString(*r.executionDateLte, "")) - } - if r.startDateGte != nil { - localVarQueryParams.Add("start_date_gte", parameterToString(*r.startDateGte, "")) - } - if r.startDateLte != nil { - localVarQueryParams.Add("start_date_lte", parameterToString(*r.startDateLte, "")) - } - if r.endDateGte != nil { - localVarQueryParams.Add("end_date_gte", parameterToString(*r.endDateGte, "")) - } - if r.endDateLte != nil { - localVarQueryParams.Add("end_date_lte", parameterToString(*r.endDateLte, "")) - } - if r.durationGte != nil { - localVarQueryParams.Add("duration_gte", parameterToString(*r.durationGte, "")) - } - if r.durationLte != nil { - localVarQueryParams.Add("duration_lte", parameterToString(*r.durationLte, "")) - } - if r.state != nil { - t := *r.state - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("state", parameterToString(s.Index(i), "multi")) - } - } else { - localVarQueryParams.Add("state", parameterToString(t, "multi")) - } - } - if r.pool != nil { - t := *r.pool - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("pool", parameterToString(s.Index(i), "multi")) - } - } else { - localVarQueryParams.Add("pool", parameterToString(t, "multi")) - } - } - if r.queue != nil { - t := *r.queue - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("queue", parameterToString(s.Index(i), "multi")) - } - } else { - localVarQueryParams.Add("queue", parameterToString(t, "multi")) - } - } - if r.orderBy != nil { - localVarQueryParams.Add("order_by", parameterToString(*r.orderBy, "")) - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -755,7 +626,7 @@ func (a *TaskInstanceApiService) GetMappedTaskInstancesExecute(r TaskInstanceApi if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -765,18 +636,29 @@ func (a *TaskInstanceApiService) GetMappedTaskInstancesExecute(r TaskInstanceApi return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -784,7 +666,8 @@ func (a *TaskInstanceApiService) GetMappedTaskInstancesExecute(r TaskInstanceApi newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -794,7 +677,8 @@ func (a *TaskInstanceApiService) GetMappedTaskInstancesExecute(r TaskInstanceApi newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -804,14 +688,15 @@ func (a *TaskInstanceApiService) GetMappedTaskInstancesExecute(r TaskInstanceApi newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -821,64 +706,103 @@ func (a *TaskInstanceApiService) GetMappedTaskInstancesExecute(r TaskInstanceApi return localVarReturnValue, localVarHTTPResponse, nil } -type TaskInstanceApiApiGetTaskInstanceRequest struct { - ctx _context.Context - ApiService *TaskInstanceApiService +type ApiGetMappedTaskInstanceTriesRequest struct { + ctx context.Context + ApiService *TaskInstanceAPIService dagId string dagRunId string taskId string + mapIndex int32 + limit *int32 + offset *int32 + orderBy *string +} + +// The numbers of items to return. +func (r ApiGetMappedTaskInstanceTriesRequest) Limit(limit int32) ApiGetMappedTaskInstanceTriesRequest { + r.limit = &limit + return r } +// The number of items to skip before starting to collect the result set. +func (r ApiGetMappedTaskInstanceTriesRequest) Offset(offset int32) ApiGetMappedTaskInstanceTriesRequest { + r.offset = &offset + return r +} -func (r TaskInstanceApiApiGetTaskInstanceRequest) Execute() (TaskInstance, *_nethttp.Response, error) { - return r.ApiService.GetTaskInstanceExecute(r) +// The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* +func (r ApiGetMappedTaskInstanceTriesRequest) OrderBy(orderBy string) ApiGetMappedTaskInstanceTriesRequest { + r.orderBy = &orderBy + return r +} + +func (r ApiGetMappedTaskInstanceTriesRequest) Execute() (*TaskInstanceHistoryCollection, *http.Response, error) { + return r.ApiService.GetMappedTaskInstanceTriesExecute(r) } /* -GetTaskInstance Get a task instance +GetMappedTaskInstanceTries List mapped task instance tries - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +Get details of all task instance tries. + +*New in version 2.10.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. @param dagRunId The DAG run ID. @param taskId The task ID. - @return TaskInstanceApiApiGetTaskInstanceRequest + @param mapIndex The map index. + @return ApiGetMappedTaskInstanceTriesRequest */ -func (a *TaskInstanceApiService) GetTaskInstance(ctx _context.Context, dagId string, dagRunId string, taskId string) TaskInstanceApiApiGetTaskInstanceRequest { - return TaskInstanceApiApiGetTaskInstanceRequest{ +func (a *TaskInstanceAPIService) GetMappedTaskInstanceTries(ctx context.Context, dagId string, dagRunId string, taskId string, mapIndex int32) ApiGetMappedTaskInstanceTriesRequest { + return ApiGetMappedTaskInstanceTriesRequest{ ApiService: a, ctx: ctx, dagId: dagId, dagRunId: dagRunId, taskId: taskId, + mapIndex: mapIndex, } } // Execute executes the request -// @return TaskInstance -func (a *TaskInstanceApiService) GetTaskInstanceExecute(r TaskInstanceApiApiGetTaskInstanceRequest) (TaskInstance, *_nethttp.Response, error) { +// @return TaskInstanceHistoryCollection +func (a *TaskInstanceAPIService) GetMappedTaskInstanceTriesExecute(r ApiGetMappedTaskInstanceTriesRequest) (*TaskInstanceHistoryCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue TaskInstance + formFiles []formFile + localVarReturnValue *TaskInstanceHistoryCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceApiService.GetTaskInstance") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceAPIService.GetMappedTaskInstanceTries") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", _neturl.PathEscape(parameterToString(r.dagRunId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", _neturl.PathEscape(parameterToString(r.taskId, "")), -1) + localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}/tries" + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", url.PathEscape(parameterValueToString(r.taskId, "taskId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"map_index"+"}", url.PathEscape(parameterValueToString(r.mapIndex, "mapIndex")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.orderBy != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "order_by", r.orderBy, "form", "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -896,7 +820,7 @@ func (a *TaskInstanceApiService) GetTaskInstanceExecute(r TaskInstanceApiApiGetT if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -906,15 +830,15 @@ func (a *TaskInstanceApiService) GetTaskInstanceExecute(r TaskInstanceApiApiGetT return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -925,7 +849,8 @@ func (a *TaskInstanceApiService) GetTaskInstanceExecute(r TaskInstanceApiApiGetT newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -935,7 +860,8 @@ func (a *TaskInstanceApiService) GetTaskInstanceExecute(r TaskInstanceApiApiGetT newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -945,14 +871,15 @@ func (a *TaskInstanceApiService) GetTaskInstanceExecute(r TaskInstanceApiApiGetT newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -962,109 +889,1274 @@ func (a *TaskInstanceApiService) GetTaskInstanceExecute(r TaskInstanceApiApiGetT return localVarReturnValue, localVarHTTPResponse, nil } -type TaskInstanceApiApiGetTaskInstancesRequest struct { - ctx _context.Context - ApiService *TaskInstanceApiService +type ApiGetMappedTaskInstanceTryDetailsRequest struct { + ctx context.Context + ApiService *TaskInstanceAPIService dagId string dagRunId string - executionDateGte *time.Time - executionDateLte *time.Time - startDateGte *time.Time - startDateLte *time.Time - endDateGte *time.Time - endDateLte *time.Time - durationGte *float32 - durationLte *float32 - state *[]string - pool *[]string - queue *[]string - limit *int32 - offset *int32 -} - -// Returns objects greater or equal to the specified date. This can be combined with execution_date_lte parameter to receive only the selected period. -func (r TaskInstanceApiApiGetTaskInstancesRequest) ExecutionDateGte(executionDateGte time.Time) TaskInstanceApiApiGetTaskInstancesRequest { - r.executionDateGte = &executionDateGte - return r -} -// Returns objects less than or equal to the specified date. This can be combined with execution_date_gte parameter to receive only the selected period. -func (r TaskInstanceApiApiGetTaskInstancesRequest) ExecutionDateLte(executionDateLte time.Time) TaskInstanceApiApiGetTaskInstancesRequest { - r.executionDateLte = &executionDateLte - return r -} -// Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. -func (r TaskInstanceApiApiGetTaskInstancesRequest) StartDateGte(startDateGte time.Time) TaskInstanceApiApiGetTaskInstancesRequest { - r.startDateGte = &startDateGte - return r -} -// Returns objects less or equal the specified date. This can be combined with start_date_gte parameter to receive only the selected period. -func (r TaskInstanceApiApiGetTaskInstancesRequest) StartDateLte(startDateLte time.Time) TaskInstanceApiApiGetTaskInstancesRequest { - r.startDateLte = &startDateLte - return r -} -// Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. -func (r TaskInstanceApiApiGetTaskInstancesRequest) EndDateGte(endDateGte time.Time) TaskInstanceApiApiGetTaskInstancesRequest { - r.endDateGte = &endDateGte - return r -} -// Returns objects less than or equal to the specified date. This can be combined with start_date_gte parameter to receive only the selected period. -func (r TaskInstanceApiApiGetTaskInstancesRequest) EndDateLte(endDateLte time.Time) TaskInstanceApiApiGetTaskInstancesRequest { - r.endDateLte = &endDateLte - return r -} -// Returns objects greater than or equal to the specified values. This can be combined with duration_lte parameter to receive only the selected period. -func (r TaskInstanceApiApiGetTaskInstancesRequest) DurationGte(durationGte float32) TaskInstanceApiApiGetTaskInstancesRequest { - r.durationGte = &durationGte - return r -} -// Returns objects less than or equal to the specified values. This can be combined with duration_gte parameter to receive only the selected range. -func (r TaskInstanceApiApiGetTaskInstancesRequest) DurationLte(durationLte float32) TaskInstanceApiApiGetTaskInstancesRequest { - r.durationLte = &durationLte - return r -} -// The value can be repeated to retrieve multiple matching values (OR condition). -func (r TaskInstanceApiApiGetTaskInstancesRequest) State(state []string) TaskInstanceApiApiGetTaskInstancesRequest { - r.state = &state - return r -} -// The value can be repeated to retrieve multiple matching values (OR condition). -func (r TaskInstanceApiApiGetTaskInstancesRequest) Pool(pool []string) TaskInstanceApiApiGetTaskInstancesRequest { - r.pool = &pool - return r -} -// The value can be repeated to retrieve multiple matching values (OR condition). -func (r TaskInstanceApiApiGetTaskInstancesRequest) Queue(queue []string) TaskInstanceApiApiGetTaskInstancesRequest { - r.queue = &queue - return r -} -// The numbers of items to return. -func (r TaskInstanceApiApiGetTaskInstancesRequest) Limit(limit int32) TaskInstanceApiApiGetTaskInstancesRequest { - r.limit = &limit - return r -} -// The number of items to skip before starting to collect the result set. -func (r TaskInstanceApiApiGetTaskInstancesRequest) Offset(offset int32) TaskInstanceApiApiGetTaskInstancesRequest { - r.offset = &offset - return r + taskId string + mapIndex int32 + taskTryNumber int32 } -func (r TaskInstanceApiApiGetTaskInstancesRequest) Execute() (TaskInstanceCollection, *_nethttp.Response, error) { - return r.ApiService.GetTaskInstancesExecute(r) +func (r ApiGetMappedTaskInstanceTryDetailsRequest) Execute() (*TaskInstanceHistory, *http.Response, error) { + return r.ApiService.GetMappedTaskInstanceTryDetailsExecute(r) } /* -GetTaskInstances List task instances +GetMappedTaskInstanceTryDetails get mapped taskinstance try + +Get details of a mapped task instance try. + +*New in version 2.10.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param dagId The DAG ID. + @param dagRunId The DAG run ID. + @param taskId The task ID. + @param mapIndex The map index. + @param taskTryNumber The task try number. + @return ApiGetMappedTaskInstanceTryDetailsRequest +*/ +func (a *TaskInstanceAPIService) GetMappedTaskInstanceTryDetails(ctx context.Context, dagId string, dagRunId string, taskId string, mapIndex int32, taskTryNumber int32) ApiGetMappedTaskInstanceTryDetailsRequest { + return ApiGetMappedTaskInstanceTryDetailsRequest{ + ApiService: a, + ctx: ctx, + dagId: dagId, + dagRunId: dagRunId, + taskId: taskId, + mapIndex: mapIndex, + taskTryNumber: taskTryNumber, + } +} + +// Execute executes the request +// @return TaskInstanceHistory +func (a *TaskInstanceAPIService) GetMappedTaskInstanceTryDetailsExecute(r ApiGetMappedTaskInstanceTryDetailsRequest) (*TaskInstanceHistory, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TaskInstanceHistory + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceAPIService.GetMappedTaskInstanceTryDetails") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}/tries/{task_try_number}" + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", url.PathEscape(parameterValueToString(r.taskId, "taskId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"map_index"+"}", url.PathEscape(parameterValueToString(r.mapIndex, "mapIndex")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"task_try_number"+"}", url.PathEscape(parameterValueToString(r.taskTryNumber, "taskTryNumber")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetMappedTaskInstancesRequest struct { + ctx context.Context + ApiService *TaskInstanceAPIService + dagId string + dagRunId string + taskId string + limit *int32 + offset *int32 + executionDateGte *time.Time + executionDateLte *time.Time + startDateGte *time.Time + startDateLte *time.Time + endDateGte *time.Time + endDateLte *time.Time + updatedAtGte *time.Time + updatedAtLte *time.Time + durationGte *float32 + durationLte *float32 + state *[]string + pool *[]string + queue *[]string + executor *[]string + orderBy *string +} + +// The numbers of items to return. +func (r ApiGetMappedTaskInstancesRequest) Limit(limit int32) ApiGetMappedTaskInstancesRequest { + r.limit = &limit + return r +} + +// The number of items to skip before starting to collect the result set. +func (r ApiGetMappedTaskInstancesRequest) Offset(offset int32) ApiGetMappedTaskInstancesRequest { + r.offset = &offset + return r +} + +// Returns objects greater or equal to the specified date. This can be combined with execution_date_lte parameter to receive only the selected period. +func (r ApiGetMappedTaskInstancesRequest) ExecutionDateGte(executionDateGte time.Time) ApiGetMappedTaskInstancesRequest { + r.executionDateGte = &executionDateGte + return r +} + +// Returns objects less than or equal to the specified date. This can be combined with execution_date_gte parameter to receive only the selected period. +func (r ApiGetMappedTaskInstancesRequest) ExecutionDateLte(executionDateLte time.Time) ApiGetMappedTaskInstancesRequest { + r.executionDateLte = &executionDateLte + return r +} + +// Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. +func (r ApiGetMappedTaskInstancesRequest) StartDateGte(startDateGte time.Time) ApiGetMappedTaskInstancesRequest { + r.startDateGte = &startDateGte + return r +} + +// Returns objects less or equal the specified date. This can be combined with start_date_gte parameter to receive only the selected period. +func (r ApiGetMappedTaskInstancesRequest) StartDateLte(startDateLte time.Time) ApiGetMappedTaskInstancesRequest { + r.startDateLte = &startDateLte + return r +} + +// Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. +func (r ApiGetMappedTaskInstancesRequest) EndDateGte(endDateGte time.Time) ApiGetMappedTaskInstancesRequest { + r.endDateGte = &endDateGte + return r +} + +// Returns objects less than or equal to the specified date. This can be combined with start_date_gte parameter to receive only the selected period. +func (r ApiGetMappedTaskInstancesRequest) EndDateLte(endDateLte time.Time) ApiGetMappedTaskInstancesRequest { + r.endDateLte = &endDateLte + return r +} + +// Returns objects greater or equal the specified date. This can be combined with updated_at_lte parameter to receive only the selected period. *New in version 2.6.0* +func (r ApiGetMappedTaskInstancesRequest) UpdatedAtGte(updatedAtGte time.Time) ApiGetMappedTaskInstancesRequest { + r.updatedAtGte = &updatedAtGte + return r +} + +// Returns objects less or equal the specified date. This can be combined with updated_at_gte parameter to receive only the selected period. *New in version 2.6.0* +func (r ApiGetMappedTaskInstancesRequest) UpdatedAtLte(updatedAtLte time.Time) ApiGetMappedTaskInstancesRequest { + r.updatedAtLte = &updatedAtLte + return r +} + +// Returns objects greater than or equal to the specified values. This can be combined with duration_lte parameter to receive only the selected period. +func (r ApiGetMappedTaskInstancesRequest) DurationGte(durationGte float32) ApiGetMappedTaskInstancesRequest { + r.durationGte = &durationGte + return r +} + +// Returns objects less than or equal to the specified values. This can be combined with duration_gte parameter to receive only the selected range. +func (r ApiGetMappedTaskInstancesRequest) DurationLte(durationLte float32) ApiGetMappedTaskInstancesRequest { + r.durationLte = &durationLte + return r +} + +// The value can be repeated to retrieve multiple matching values (OR condition). +func (r ApiGetMappedTaskInstancesRequest) State(state []string) ApiGetMappedTaskInstancesRequest { + r.state = &state + return r +} + +// The value can be repeated to retrieve multiple matching values (OR condition). +func (r ApiGetMappedTaskInstancesRequest) Pool(pool []string) ApiGetMappedTaskInstancesRequest { + r.pool = &pool + return r +} + +// The value can be repeated to retrieve multiple matching values (OR condition). +func (r ApiGetMappedTaskInstancesRequest) Queue(queue []string) ApiGetMappedTaskInstancesRequest { + r.queue = &queue + return r +} + +// The value can be repeated to retrieve multiple matching values (OR condition). +func (r ApiGetMappedTaskInstancesRequest) Executor(executor []string) ApiGetMappedTaskInstancesRequest { + r.executor = &executor + return r +} + +// The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* +func (r ApiGetMappedTaskInstancesRequest) OrderBy(orderBy string) ApiGetMappedTaskInstancesRequest { + r.orderBy = &orderBy + return r +} + +func (r ApiGetMappedTaskInstancesRequest) Execute() (*TaskInstanceCollection, *http.Response, error) { + return r.ApiService.GetMappedTaskInstancesExecute(r) +} + +/* +GetMappedTaskInstances List mapped task instances + +Get details of all mapped task instances. + +*New in version 2.3.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param dagId The DAG ID. + @param dagRunId The DAG run ID. + @param taskId The task ID. + @return ApiGetMappedTaskInstancesRequest +*/ +func (a *TaskInstanceAPIService) GetMappedTaskInstances(ctx context.Context, dagId string, dagRunId string, taskId string) ApiGetMappedTaskInstancesRequest { + return ApiGetMappedTaskInstancesRequest{ + ApiService: a, + ctx: ctx, + dagId: dagId, + dagRunId: dagRunId, + taskId: taskId, + } +} + +// Execute executes the request +// @return TaskInstanceCollection +func (a *TaskInstanceAPIService) GetMappedTaskInstancesExecute(r ApiGetMappedTaskInstancesRequest) (*TaskInstanceCollection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TaskInstanceCollection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceAPIService.GetMappedTaskInstances") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/listMapped" + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", url.PathEscape(parameterValueToString(r.taskId, "taskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.executionDateGte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "execution_date_gte", r.executionDateGte, "form", "") + } + if r.executionDateLte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "execution_date_lte", r.executionDateLte, "form", "") + } + if r.startDateGte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "start_date_gte", r.startDateGte, "form", "") + } + if r.startDateLte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "start_date_lte", r.startDateLte, "form", "") + } + if r.endDateGte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "end_date_gte", r.endDateGte, "form", "") + } + if r.endDateLte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "end_date_lte", r.endDateLte, "form", "") + } + if r.updatedAtGte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_at_gte", r.updatedAtGte, "form", "") + } + if r.updatedAtLte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_at_lte", r.updatedAtLte, "form", "") + } + if r.durationGte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "duration_gte", r.durationGte, "form", "") + } + if r.durationLte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "duration_lte", r.durationLte, "form", "") + } + if r.state != nil { + t := *r.state + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "state", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "state", t, "form", "multi") + } + } + if r.pool != nil { + t := *r.pool + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "pool", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "pool", t, "form", "multi") + } + } + if r.queue != nil { + t := *r.queue + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "queue", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "queue", t, "form", "multi") + } + } + if r.executor != nil { + t := *r.executor + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "executor", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "executor", t, "form", "multi") + } + } + if r.orderBy != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "order_by", r.orderBy, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetTaskInstanceRequest struct { + ctx context.Context + ApiService *TaskInstanceAPIService + dagId string + dagRunId string + taskId string +} + +func (r ApiGetTaskInstanceRequest) Execute() (*TaskInstance, *http.Response, error) { + return r.ApiService.GetTaskInstanceExecute(r) +} + +/* +GetTaskInstance Get a task instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param dagId The DAG ID. + @param dagRunId The DAG run ID. + @param taskId The task ID. + @return ApiGetTaskInstanceRequest +*/ +func (a *TaskInstanceAPIService) GetTaskInstance(ctx context.Context, dagId string, dagRunId string, taskId string) ApiGetTaskInstanceRequest { + return ApiGetTaskInstanceRequest{ + ApiService: a, + ctx: ctx, + dagId: dagId, + dagRunId: dagRunId, + taskId: taskId, + } +} + +// Execute executes the request +// @return TaskInstance +func (a *TaskInstanceAPIService) GetTaskInstanceExecute(r ApiGetTaskInstanceRequest) (*TaskInstance, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TaskInstance + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceAPIService.GetTaskInstance") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}" + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", url.PathEscape(parameterValueToString(r.taskId, "taskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetTaskInstanceDependenciesRequest struct { + ctx context.Context + ApiService *TaskInstanceAPIService + dagId string + dagRunId string + taskId string +} + +func (r ApiGetTaskInstanceDependenciesRequest) Execute() (*TaskInstanceDependencyCollection, *http.Response, error) { + return r.ApiService.GetTaskInstanceDependenciesExecute(r) +} + +/* +GetTaskInstanceDependencies Get task dependencies blocking task from getting scheduled. + +Get task dependencies blocking task from getting scheduled. + +*New in version 2.10.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param dagId The DAG ID. + @param dagRunId The DAG run ID. + @param taskId The task ID. + @return ApiGetTaskInstanceDependenciesRequest +*/ +func (a *TaskInstanceAPIService) GetTaskInstanceDependencies(ctx context.Context, dagId string, dagRunId string, taskId string) ApiGetTaskInstanceDependenciesRequest { + return ApiGetTaskInstanceDependenciesRequest{ + ApiService: a, + ctx: ctx, + dagId: dagId, + dagRunId: dagRunId, + taskId: taskId, + } +} + +// Execute executes the request +// @return TaskInstanceDependencyCollection +func (a *TaskInstanceAPIService) GetTaskInstanceDependenciesExecute(r ApiGetTaskInstanceDependenciesRequest) (*TaskInstanceDependencyCollection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TaskInstanceDependencyCollection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceAPIService.GetTaskInstanceDependencies") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/dependencies" + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", url.PathEscape(parameterValueToString(r.taskId, "taskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetTaskInstanceTriesRequest struct { + ctx context.Context + ApiService *TaskInstanceAPIService + dagId string + dagRunId string + taskId string + limit *int32 + offset *int32 + orderBy *string +} + +// The numbers of items to return. +func (r ApiGetTaskInstanceTriesRequest) Limit(limit int32) ApiGetTaskInstanceTriesRequest { + r.limit = &limit + return r +} + +// The number of items to skip before starting to collect the result set. +func (r ApiGetTaskInstanceTriesRequest) Offset(offset int32) ApiGetTaskInstanceTriesRequest { + r.offset = &offset + return r +} + +// The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* +func (r ApiGetTaskInstanceTriesRequest) OrderBy(orderBy string) ApiGetTaskInstanceTriesRequest { + r.orderBy = &orderBy + return r +} + +func (r ApiGetTaskInstanceTriesRequest) Execute() (*TaskInstanceHistoryCollection, *http.Response, error) { + return r.ApiService.GetTaskInstanceTriesExecute(r) +} + +/* +GetTaskInstanceTries List task instance tries + +Get details of all task instance tries. + +*New in version 2.10.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param dagId The DAG ID. + @param dagRunId The DAG run ID. + @param taskId The task ID. + @return ApiGetTaskInstanceTriesRequest +*/ +func (a *TaskInstanceAPIService) GetTaskInstanceTries(ctx context.Context, dagId string, dagRunId string, taskId string) ApiGetTaskInstanceTriesRequest { + return ApiGetTaskInstanceTriesRequest{ + ApiService: a, + ctx: ctx, + dagId: dagId, + dagRunId: dagRunId, + taskId: taskId, + } +} + +// Execute executes the request +// @return TaskInstanceHistoryCollection +func (a *TaskInstanceAPIService) GetTaskInstanceTriesExecute(r ApiGetTaskInstanceTriesRequest) (*TaskInstanceHistoryCollection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TaskInstanceHistoryCollection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceAPIService.GetTaskInstanceTries") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/tries" + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", url.PathEscape(parameterValueToString(r.taskId, "taskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.orderBy != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "order_by", r.orderBy, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetTaskInstanceTryDetailsRequest struct { + ctx context.Context + ApiService *TaskInstanceAPIService + dagId string + dagRunId string + taskId string + taskTryNumber int32 +} + +func (r ApiGetTaskInstanceTryDetailsRequest) Execute() (*TaskInstanceHistory, *http.Response, error) { + return r.ApiService.GetTaskInstanceTryDetailsExecute(r) +} + +/* +GetTaskInstanceTryDetails get taskinstance try + +Get details of a task instance try. + +*New in version 2.10.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param dagId The DAG ID. + @param dagRunId The DAG run ID. + @param taskId The task ID. + @param taskTryNumber The task try number. + @return ApiGetTaskInstanceTryDetailsRequest +*/ +func (a *TaskInstanceAPIService) GetTaskInstanceTryDetails(ctx context.Context, dagId string, dagRunId string, taskId string, taskTryNumber int32) ApiGetTaskInstanceTryDetailsRequest { + return ApiGetTaskInstanceTryDetailsRequest{ + ApiService: a, + ctx: ctx, + dagId: dagId, + dagRunId: dagRunId, + taskId: taskId, + taskTryNumber: taskTryNumber, + } +} + +// Execute executes the request +// @return TaskInstanceHistory +func (a *TaskInstanceAPIService) GetTaskInstanceTryDetailsExecute(r ApiGetTaskInstanceTryDetailsRequest) (*TaskInstanceHistory, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TaskInstanceHistory + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceAPIService.GetTaskInstanceTryDetails") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/tries/{task_try_number}" + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", url.PathEscape(parameterValueToString(r.taskId, "taskId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"task_try_number"+"}", url.PathEscape(parameterValueToString(r.taskTryNumber, "taskTryNumber")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetTaskInstancesRequest struct { + ctx context.Context + ApiService *TaskInstanceAPIService + dagId string + dagRunId string + executionDateGte *time.Time + executionDateLte *time.Time + startDateGte *time.Time + startDateLte *time.Time + endDateGte *time.Time + endDateLte *time.Time + updatedAtGte *time.Time + updatedAtLte *time.Time + durationGte *float32 + durationLte *float32 + state *[]string + pool *[]string + queue *[]string + executor *[]string + limit *int32 + offset *int32 +} + +// Returns objects greater or equal to the specified date. This can be combined with execution_date_lte parameter to receive only the selected period. +func (r ApiGetTaskInstancesRequest) ExecutionDateGte(executionDateGte time.Time) ApiGetTaskInstancesRequest { + r.executionDateGte = &executionDateGte + return r +} + +// Returns objects less than or equal to the specified date. This can be combined with execution_date_gte parameter to receive only the selected period. +func (r ApiGetTaskInstancesRequest) ExecutionDateLte(executionDateLte time.Time) ApiGetTaskInstancesRequest { + r.executionDateLte = &executionDateLte + return r +} + +// Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. +func (r ApiGetTaskInstancesRequest) StartDateGte(startDateGte time.Time) ApiGetTaskInstancesRequest { + r.startDateGte = &startDateGte + return r +} + +// Returns objects less or equal the specified date. This can be combined with start_date_gte parameter to receive only the selected period. +func (r ApiGetTaskInstancesRequest) StartDateLte(startDateLte time.Time) ApiGetTaskInstancesRequest { + r.startDateLte = &startDateLte + return r +} + +// Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. +func (r ApiGetTaskInstancesRequest) EndDateGte(endDateGte time.Time) ApiGetTaskInstancesRequest { + r.endDateGte = &endDateGte + return r +} + +// Returns objects less than or equal to the specified date. This can be combined with start_date_gte parameter to receive only the selected period. +func (r ApiGetTaskInstancesRequest) EndDateLte(endDateLte time.Time) ApiGetTaskInstancesRequest { + r.endDateLte = &endDateLte + return r +} + +// Returns objects greater or equal the specified date. This can be combined with updated_at_lte parameter to receive only the selected period. *New in version 2.6.0* +func (r ApiGetTaskInstancesRequest) UpdatedAtGte(updatedAtGte time.Time) ApiGetTaskInstancesRequest { + r.updatedAtGte = &updatedAtGte + return r +} + +// Returns objects less or equal the specified date. This can be combined with updated_at_gte parameter to receive only the selected period. *New in version 2.6.0* +func (r ApiGetTaskInstancesRequest) UpdatedAtLte(updatedAtLte time.Time) ApiGetTaskInstancesRequest { + r.updatedAtLte = &updatedAtLte + return r +} + +// Returns objects greater than or equal to the specified values. This can be combined with duration_lte parameter to receive only the selected period. +func (r ApiGetTaskInstancesRequest) DurationGte(durationGte float32) ApiGetTaskInstancesRequest { + r.durationGte = &durationGte + return r +} + +// Returns objects less than or equal to the specified values. This can be combined with duration_gte parameter to receive only the selected range. +func (r ApiGetTaskInstancesRequest) DurationLte(durationLte float32) ApiGetTaskInstancesRequest { + r.durationLte = &durationLte + return r +} + +// The value can be repeated to retrieve multiple matching values (OR condition). +func (r ApiGetTaskInstancesRequest) State(state []string) ApiGetTaskInstancesRequest { + r.state = &state + return r +} + +// The value can be repeated to retrieve multiple matching values (OR condition). +func (r ApiGetTaskInstancesRequest) Pool(pool []string) ApiGetTaskInstancesRequest { + r.pool = &pool + return r +} + +// The value can be repeated to retrieve multiple matching values (OR condition). +func (r ApiGetTaskInstancesRequest) Queue(queue []string) ApiGetTaskInstancesRequest { + r.queue = &queue + return r +} + +// The value can be repeated to retrieve multiple matching values (OR condition). +func (r ApiGetTaskInstancesRequest) Executor(executor []string) ApiGetTaskInstancesRequest { + r.executor = &executor + return r +} + +// The numbers of items to return. +func (r ApiGetTaskInstancesRequest) Limit(limit int32) ApiGetTaskInstancesRequest { + r.limit = &limit + return r +} + +// The number of items to skip before starting to collect the result set. +func (r ApiGetTaskInstancesRequest) Offset(offset int32) ApiGetTaskInstancesRequest { + r.offset = &offset + return r +} + +func (r ApiGetTaskInstancesRequest) Execute() (*TaskInstanceCollection, *http.Response, error) { + return r.ApiService.GetTaskInstancesExecute(r) +} + +/* +GetTaskInstances List task instances This endpoint allows specifying `~` as the dag_id, dag_run_id to retrieve DAG runs for all DAGs and DAG runs. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. @param dagRunId The DAG run ID. - @return TaskInstanceApiApiGetTaskInstancesRequest + @return ApiGetTaskInstancesRequest */ -func (a *TaskInstanceApiService) GetTaskInstances(ctx _context.Context, dagId string, dagRunId string) TaskInstanceApiApiGetTaskInstancesRequest { - return TaskInstanceApiApiGetTaskInstancesRequest{ +func (a *TaskInstanceAPIService) GetTaskInstances(ctx context.Context, dagId string, dagRunId string) ApiGetTaskInstancesRequest { + return ApiGetTaskInstancesRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -1074,62 +2166,66 @@ func (a *TaskInstanceApiService) GetTaskInstances(ctx _context.Context, dagId st // Execute executes the request // @return TaskInstanceCollection -func (a *TaskInstanceApiService) GetTaskInstancesExecute(r TaskInstanceApiApiGetTaskInstancesRequest) (TaskInstanceCollection, *_nethttp.Response, error) { +func (a *TaskInstanceAPIService) GetTaskInstancesExecute(r ApiGetTaskInstancesRequest) (*TaskInstanceCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue TaskInstanceCollection + formFiles []formFile + localVarReturnValue *TaskInstanceCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceApiService.GetTaskInstances") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceAPIService.GetTaskInstances") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", _neturl.PathEscape(parameterToString(r.dagRunId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.executionDateGte != nil { - localVarQueryParams.Add("execution_date_gte", parameterToString(*r.executionDateGte, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "execution_date_gte", r.executionDateGte, "form", "") } if r.executionDateLte != nil { - localVarQueryParams.Add("execution_date_lte", parameterToString(*r.executionDateLte, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "execution_date_lte", r.executionDateLte, "form", "") } if r.startDateGte != nil { - localVarQueryParams.Add("start_date_gte", parameterToString(*r.startDateGte, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "start_date_gte", r.startDateGte, "form", "") } if r.startDateLte != nil { - localVarQueryParams.Add("start_date_lte", parameterToString(*r.startDateLte, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "start_date_lte", r.startDateLte, "form", "") } if r.endDateGte != nil { - localVarQueryParams.Add("end_date_gte", parameterToString(*r.endDateGte, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "end_date_gte", r.endDateGte, "form", "") } if r.endDateLte != nil { - localVarQueryParams.Add("end_date_lte", parameterToString(*r.endDateLte, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "end_date_lte", r.endDateLte, "form", "") + } + if r.updatedAtGte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_at_gte", r.updatedAtGte, "form", "") + } + if r.updatedAtLte != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "updated_at_lte", r.updatedAtLte, "form", "") } if r.durationGte != nil { - localVarQueryParams.Add("duration_gte", parameterToString(*r.durationGte, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "duration_gte", r.durationGte, "form", "") } if r.durationLte != nil { - localVarQueryParams.Add("duration_lte", parameterToString(*r.durationLte, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "duration_lte", r.durationLte, "form", "") } if r.state != nil { t := *r.state if reflect.TypeOf(t).Kind() == reflect.Slice { s := reflect.ValueOf(t) for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("state", parameterToString(s.Index(i), "multi")) + parameterAddToHeaderOrQuery(localVarQueryParams, "state", s.Index(i).Interface(), "form", "multi") } } else { - localVarQueryParams.Add("state", parameterToString(t, "multi")) + parameterAddToHeaderOrQuery(localVarQueryParams, "state", t, "form", "multi") } } if r.pool != nil { @@ -1137,10 +2233,10 @@ func (a *TaskInstanceApiService) GetTaskInstancesExecute(r TaskInstanceApiApiGet if reflect.TypeOf(t).Kind() == reflect.Slice { s := reflect.ValueOf(t) for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("pool", parameterToString(s.Index(i), "multi")) + parameterAddToHeaderOrQuery(localVarQueryParams, "pool", s.Index(i).Interface(), "form", "multi") } } else { - localVarQueryParams.Add("pool", parameterToString(t, "multi")) + parameterAddToHeaderOrQuery(localVarQueryParams, "pool", t, "form", "multi") } } if r.queue != nil { @@ -1148,17 +2244,31 @@ func (a *TaskInstanceApiService) GetTaskInstancesExecute(r TaskInstanceApiApiGet if reflect.TypeOf(t).Kind() == reflect.Slice { s := reflect.ValueOf(t) for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("queue", parameterToString(s.Index(i), "multi")) + parameterAddToHeaderOrQuery(localVarQueryParams, "queue", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "queue", t, "form", "multi") + } + } + if r.executor != nil { + t := *r.executor + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "executor", s.Index(i).Interface(), "form", "multi") } } else { - localVarQueryParams.Add("queue", parameterToString(t, "multi")) + parameterAddToHeaderOrQuery(localVarQueryParams, "executor", t, "form", "multi") } } if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue } if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -1177,7 +2287,7 @@ func (a *TaskInstanceApiService) GetTaskInstancesExecute(r TaskInstanceApiApiGet if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1187,15 +2297,15 @@ func (a *TaskInstanceApiService) GetTaskInstancesExecute(r TaskInstanceApiApiGet return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1206,7 +2316,8 @@ func (a *TaskInstanceApiService) GetTaskInstancesExecute(r TaskInstanceApiApiGet newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1216,14 +2327,15 @@ func (a *TaskInstanceApiService) GetTaskInstancesExecute(r TaskInstanceApiApiGet newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1233,18 +2345,18 @@ func (a *TaskInstanceApiService) GetTaskInstancesExecute(r TaskInstanceApiApiGet return localVarReturnValue, localVarHTTPResponse, nil } -type TaskInstanceApiApiGetTaskInstancesBatchRequest struct { - ctx _context.Context - ApiService *TaskInstanceApiService +type ApiGetTaskInstancesBatchRequest struct { + ctx context.Context + ApiService *TaskInstanceAPIService listTaskInstanceForm *ListTaskInstanceForm } -func (r TaskInstanceApiApiGetTaskInstancesBatchRequest) ListTaskInstanceForm(listTaskInstanceForm ListTaskInstanceForm) TaskInstanceApiApiGetTaskInstancesBatchRequest { +func (r ApiGetTaskInstancesBatchRequest) ListTaskInstanceForm(listTaskInstanceForm ListTaskInstanceForm) ApiGetTaskInstancesBatchRequest { r.listTaskInstanceForm = &listTaskInstanceForm return r } -func (r TaskInstanceApiApiGetTaskInstancesBatchRequest) Execute() (TaskInstanceCollection, *_nethttp.Response, error) { +func (r ApiGetTaskInstancesBatchRequest) Execute() (*TaskInstanceCollection, *http.Response, error) { return r.ApiService.GetTaskInstancesBatchExecute(r) } @@ -1255,11 +2367,11 @@ List task instances from all DAGs and DAG runs. This endpoint is a POST to allow filtering across a large number of DAG IDs, where as a GET it would run in to maximum HTTP request URL length limits. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return TaskInstanceApiApiGetTaskInstancesBatchRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetTaskInstancesBatchRequest */ -func (a *TaskInstanceApiService) GetTaskInstancesBatch(ctx _context.Context) TaskInstanceApiApiGetTaskInstancesBatchRequest { - return TaskInstanceApiApiGetTaskInstancesBatchRequest{ +func (a *TaskInstanceAPIService) GetTaskInstancesBatch(ctx context.Context) ApiGetTaskInstancesBatchRequest { + return ApiGetTaskInstancesBatchRequest{ ApiService: a, ctx: ctx, } @@ -1267,26 +2379,24 @@ func (a *TaskInstanceApiService) GetTaskInstancesBatch(ctx _context.Context) Tas // Execute executes the request // @return TaskInstanceCollection -func (a *TaskInstanceApiService) GetTaskInstancesBatchExecute(r TaskInstanceApiApiGetTaskInstancesBatchRequest) (TaskInstanceCollection, *_nethttp.Response, error) { +func (a *TaskInstanceAPIService) GetTaskInstancesBatchExecute(r ApiGetTaskInstancesBatchRequest) (*TaskInstanceCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue TaskInstanceCollection + formFiles []formFile + localVarReturnValue *TaskInstanceCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceApiService.GetTaskInstancesBatch") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceAPIService.GetTaskInstancesBatch") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/~/dagRuns/~/taskInstances/list" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.listTaskInstanceForm == nil { return localVarReturnValue, nil, reportError("listTaskInstanceForm is required and must be specified") } @@ -1310,7 +2420,7 @@ func (a *TaskInstanceApiService) GetTaskInstancesBatchExecute(r TaskInstanceApiA } // body params localVarPostBody = r.listTaskInstanceForm - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1320,15 +2430,15 @@ func (a *TaskInstanceApiService) GetTaskInstancesBatchExecute(r TaskInstanceApiA return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1339,7 +2449,8 @@ func (a *TaskInstanceApiService) GetTaskInstancesBatchExecute(r TaskInstanceApiA newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1349,7 +2460,8 @@ func (a *TaskInstanceApiService) GetTaskInstancesBatchExecute(r TaskInstanceApiA newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1359,14 +2471,15 @@ func (a *TaskInstanceApiService) GetTaskInstancesBatchExecute(r TaskInstanceApiA newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1376,9 +2489,9 @@ func (a *TaskInstanceApiService) GetTaskInstancesBatchExecute(r TaskInstanceApiA return localVarReturnValue, localVarHTTPResponse, nil } -type TaskInstanceApiApiPatchMappedTaskInstanceRequest struct { - ctx _context.Context - ApiService *TaskInstanceApiService +type ApiPatchMappedTaskInstanceRequest struct { + ctx context.Context + ApiService *TaskInstanceAPIService dagId string dagRunId string taskId string @@ -1387,12 +2500,12 @@ type TaskInstanceApiApiPatchMappedTaskInstanceRequest struct { } // Parameters of action -func (r TaskInstanceApiApiPatchMappedTaskInstanceRequest) UpdateTaskInstance(updateTaskInstance UpdateTaskInstance) TaskInstanceApiApiPatchMappedTaskInstanceRequest { +func (r ApiPatchMappedTaskInstanceRequest) UpdateTaskInstance(updateTaskInstance UpdateTaskInstance) ApiPatchMappedTaskInstanceRequest { r.updateTaskInstance = &updateTaskInstance return r } -func (r TaskInstanceApiApiPatchMappedTaskInstanceRequest) Execute() (TaskInstanceReference, *_nethttp.Response, error) { +func (r ApiPatchMappedTaskInstanceRequest) Execute() (*TaskInstanceReference, *http.Response, error) { return r.ApiService.PatchMappedTaskInstanceExecute(r) } @@ -1403,15 +2516,15 @@ Updates the state for single mapped task instance. *New in version 2.5.0* - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. @param dagRunId The DAG run ID. @param taskId The task ID. @param mapIndex The map index. - @return TaskInstanceApiApiPatchMappedTaskInstanceRequest + @return ApiPatchMappedTaskInstanceRequest */ -func (a *TaskInstanceApiService) PatchMappedTaskInstance(ctx _context.Context, dagId string, dagRunId string, taskId string, mapIndex int32) TaskInstanceApiApiPatchMappedTaskInstanceRequest { - return TaskInstanceApiApiPatchMappedTaskInstanceRequest{ +func (a *TaskInstanceAPIService) PatchMappedTaskInstance(ctx context.Context, dagId string, dagRunId string, taskId string, mapIndex int32) ApiPatchMappedTaskInstanceRequest { + return ApiPatchMappedTaskInstanceRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -1423,30 +2536,28 @@ func (a *TaskInstanceApiService) PatchMappedTaskInstance(ctx _context.Context, d // Execute executes the request // @return TaskInstanceReference -func (a *TaskInstanceApiService) PatchMappedTaskInstanceExecute(r TaskInstanceApiApiPatchMappedTaskInstanceRequest) (TaskInstanceReference, *_nethttp.Response, error) { +func (a *TaskInstanceAPIService) PatchMappedTaskInstanceExecute(r ApiPatchMappedTaskInstanceRequest) (*TaskInstanceReference, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue TaskInstanceReference + formFiles []formFile + localVarReturnValue *TaskInstanceReference ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceApiService.PatchMappedTaskInstance") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceAPIService.PatchMappedTaskInstance") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", _neturl.PathEscape(parameterToString(r.dagRunId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", _neturl.PathEscape(parameterToString(r.taskId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"map_index"+"}", _neturl.PathEscape(parameterToString(r.mapIndex, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", url.PathEscape(parameterValueToString(r.taskId, "taskId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"map_index"+"}", url.PathEscape(parameterValueToString(r.mapIndex, "mapIndex")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -1467,7 +2578,7 @@ func (a *TaskInstanceApiService) PatchMappedTaskInstanceExecute(r TaskInstanceAp } // body params localVarPostBody = r.updateTaskInstance - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1477,15 +2588,15 @@ func (a *TaskInstanceApiService) PatchMappedTaskInstanceExecute(r TaskInstanceAp return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -1496,7 +2607,8 @@ func (a *TaskInstanceApiService) PatchMappedTaskInstanceExecute(r TaskInstanceAp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1506,7 +2618,8 @@ func (a *TaskInstanceApiService) PatchMappedTaskInstanceExecute(r TaskInstanceAp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1516,14 +2629,15 @@ func (a *TaskInstanceApiService) PatchMappedTaskInstanceExecute(r TaskInstanceAp newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -1533,9 +2647,9 @@ func (a *TaskInstanceApiService) PatchMappedTaskInstanceExecute(r TaskInstanceAp return localVarReturnValue, localVarHTTPResponse, nil } -type TaskInstanceApiApiPatchTaskInstanceRequest struct { - ctx _context.Context - ApiService *TaskInstanceApiService +type ApiPatchTaskInstanceRequest struct { + ctx context.Context + ApiService *TaskInstanceAPIService dagId string dagRunId string taskId string @@ -1543,12 +2657,12 @@ type TaskInstanceApiApiPatchTaskInstanceRequest struct { } // Parameters of action -func (r TaskInstanceApiApiPatchTaskInstanceRequest) UpdateTaskInstance(updateTaskInstance UpdateTaskInstance) TaskInstanceApiApiPatchTaskInstanceRequest { +func (r ApiPatchTaskInstanceRequest) UpdateTaskInstance(updateTaskInstance UpdateTaskInstance) ApiPatchTaskInstanceRequest { r.updateTaskInstance = &updateTaskInstance return r } -func (r TaskInstanceApiApiPatchTaskInstanceRequest) Execute() (TaskInstanceReference, *_nethttp.Response, error) { +func (r ApiPatchTaskInstanceRequest) Execute() (*TaskInstanceReference, *http.Response, error) { return r.ApiService.PatchTaskInstanceExecute(r) } @@ -1559,14 +2673,14 @@ Updates the state for single task instance. *New in version 2.5.0* - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. @param dagRunId The DAG run ID. @param taskId The task ID. - @return TaskInstanceApiApiPatchTaskInstanceRequest + @return ApiPatchTaskInstanceRequest */ -func (a *TaskInstanceApiService) PatchTaskInstance(ctx _context.Context, dagId string, dagRunId string, taskId string) TaskInstanceApiApiPatchTaskInstanceRequest { - return TaskInstanceApiApiPatchTaskInstanceRequest{ +func (a *TaskInstanceAPIService) PatchTaskInstance(ctx context.Context, dagId string, dagRunId string, taskId string) ApiPatchTaskInstanceRequest { + return ApiPatchTaskInstanceRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -1577,29 +2691,27 @@ func (a *TaskInstanceApiService) PatchTaskInstance(ctx _context.Context, dagId s // Execute executes the request // @return TaskInstanceReference -func (a *TaskInstanceApiService) PatchTaskInstanceExecute(r TaskInstanceApiApiPatchTaskInstanceRequest) (TaskInstanceReference, *_nethttp.Response, error) { +func (a *TaskInstanceAPIService) PatchTaskInstanceExecute(r ApiPatchTaskInstanceRequest) (*TaskInstanceReference, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue TaskInstanceReference + formFiles []formFile + localVarReturnValue *TaskInstanceReference ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceApiService.PatchTaskInstance") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceAPIService.PatchTaskInstance") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", _neturl.PathEscape(parameterToString(r.dagRunId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", _neturl.PathEscape(parameterToString(r.taskId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", url.PathEscape(parameterValueToString(r.taskId, "taskId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.updateTaskInstance == nil { return localVarReturnValue, nil, reportError("updateTaskInstance is required and must be specified") } @@ -1623,7 +2735,338 @@ func (a *TaskInstanceApiService) PatchTaskInstanceExecute(r TaskInstanceApiApiPa } // body params localVarPostBody = r.updateTaskInstance - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSetMappedTaskInstanceNoteRequest struct { + ctx context.Context + ApiService *TaskInstanceAPIService + dagId string + dagRunId string + taskId string + mapIndex int32 + setTaskInstanceNote *SetTaskInstanceNote +} + +// Parameters of set Task Instance note. +func (r ApiSetMappedTaskInstanceNoteRequest) SetTaskInstanceNote(setTaskInstanceNote SetTaskInstanceNote) ApiSetMappedTaskInstanceNoteRequest { + r.setTaskInstanceNote = &setTaskInstanceNote + return r +} + +func (r ApiSetMappedTaskInstanceNoteRequest) Execute() (*TaskInstance, *http.Response, error) { + return r.ApiService.SetMappedTaskInstanceNoteExecute(r) +} + +/* +SetMappedTaskInstanceNote Update the TaskInstance note. + +Update the manual user note of a mapped Task Instance. + +*New in version 2.5.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param dagId The DAG ID. + @param dagRunId The DAG run ID. + @param taskId The task ID. + @param mapIndex The map index. + @return ApiSetMappedTaskInstanceNoteRequest +*/ +func (a *TaskInstanceAPIService) SetMappedTaskInstanceNote(ctx context.Context, dagId string, dagRunId string, taskId string, mapIndex int32) ApiSetMappedTaskInstanceNoteRequest { + return ApiSetMappedTaskInstanceNoteRequest{ + ApiService: a, + ctx: ctx, + dagId: dagId, + dagRunId: dagRunId, + taskId: taskId, + mapIndex: mapIndex, + } +} + +// Execute executes the request +// @return TaskInstance +func (a *TaskInstanceAPIService) SetMappedTaskInstanceNoteExecute(r ApiSetMappedTaskInstanceNoteRequest) (*TaskInstance, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TaskInstance + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceAPIService.SetMappedTaskInstanceNote") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}/setNote" + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", url.PathEscape(parameterValueToString(r.taskId, "taskId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"map_index"+"}", url.PathEscape(parameterValueToString(r.mapIndex, "mapIndex")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.setTaskInstanceNote == nil { + return localVarReturnValue, nil, reportError("setTaskInstanceNote is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.setTaskInstanceNote + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSetTaskInstanceNoteRequest struct { + ctx context.Context + ApiService *TaskInstanceAPIService + dagId string + dagRunId string + taskId string + setTaskInstanceNote *SetTaskInstanceNote +} + +// Parameters of set Task Instance note. +func (r ApiSetTaskInstanceNoteRequest) SetTaskInstanceNote(setTaskInstanceNote SetTaskInstanceNote) ApiSetTaskInstanceNoteRequest { + r.setTaskInstanceNote = &setTaskInstanceNote + return r +} + +func (r ApiSetTaskInstanceNoteRequest) Execute() (*TaskInstance, *http.Response, error) { + return r.ApiService.SetTaskInstanceNoteExecute(r) +} + +/* +SetTaskInstanceNote Update the TaskInstance note. + +Update the manual user note of a non-mapped Task Instance. + +*New in version 2.5.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param dagId The DAG ID. + @param dagRunId The DAG run ID. + @param taskId The task ID. + @return ApiSetTaskInstanceNoteRequest +*/ +func (a *TaskInstanceAPIService) SetTaskInstanceNote(ctx context.Context, dagId string, dagRunId string, taskId string) ApiSetTaskInstanceNoteRequest { + return ApiSetTaskInstanceNoteRequest{ + ApiService: a, + ctx: ctx, + dagId: dagId, + dagRunId: dagRunId, + taskId: taskId, + } +} + +// Execute executes the request +// @return TaskInstance +func (a *TaskInstanceAPIService) SetTaskInstanceNoteExecute(r ApiSetTaskInstanceNoteRequest) (*TaskInstance, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TaskInstance + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TaskInstanceAPIService.SetTaskInstanceNote") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/setNote" + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", url.PathEscape(parameterValueToString(r.taskId, "taskId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.setTaskInstanceNote == nil { + return localVarReturnValue, nil, reportError("setTaskInstanceNote is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.setTaskInstanceNote + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -1633,18 +3076,29 @@ func (a *TaskInstanceApiService) PatchTaskInstanceExecute(r TaskInstanceApiApiPa return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } if localVarHTTPResponse.StatusCode == 401 { var v Error err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1652,7 +3106,8 @@ func (a *TaskInstanceApiService) PatchTaskInstanceExecute(r TaskInstanceApiApiPa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -1662,7 +3117,8 @@ func (a *TaskInstanceApiService) PatchTaskInstanceExecute(r TaskInstanceApiApiPa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -1672,14 +3128,15 @@ func (a *TaskInstanceApiService) PatchTaskInstanceExecute(r TaskInstanceApiApiPa newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/airflow/api_user.go b/airflow/api_user.go index e98fb79..1113215 100644 --- a/airflow/api_user.go +++ b/airflow/api_user.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -30,29 +13,24 @@ package airflow import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) -// UserApiService UserApi service -type UserApiService service +// UserAPIService UserAPI service +type UserAPIService service -type UserApiApiDeleteUserRequest struct { - ctx _context.Context - ApiService *UserApiService +type ApiDeleteUserRequest struct { + ctx context.Context + ApiService *UserAPIService username string } - -func (r UserApiApiDeleteUserRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeleteUserRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteUserExecute(r) } @@ -61,15 +39,17 @@ DeleteUser Delete a user Delete a user with a specific username. -*New in version 2.2.0* +*This API endpoint is deprecated, please use the endpoint `/auth/fab/v1` for this operation instead.* - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param username The username of the user. *New in version 2.1.0* - @return UserApiApiDeleteUserRequest + @return ApiDeleteUserRequest + +Deprecated */ -func (a *UserApiService) DeleteUser(ctx _context.Context, username string) UserApiApiDeleteUserRequest { - return UserApiApiDeleteUserRequest{ +func (a *UserAPIService) DeleteUser(ctx context.Context, username string) ApiDeleteUserRequest { + return ApiDeleteUserRequest{ ApiService: a, ctx: ctx, username: username, @@ -77,26 +57,25 @@ func (a *UserApiService) DeleteUser(ctx _context.Context, username string) UserA } // Execute executes the request -func (a *UserApiService) DeleteUserExecute(r UserApiApiDeleteUserRequest) (*_nethttp.Response, error) { +// Deprecated +func (a *UserAPIService) DeleteUserExecute(r ApiDeleteUserRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserAPIService.DeleteUser") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/users/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(r.username, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -115,7 +94,7 @@ func (a *UserApiService) DeleteUserExecute(r UserApiApiDeleteUserRequest) (*_net if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -125,15 +104,15 @@ func (a *UserApiService) DeleteUserExecute(r UserApiApiDeleteUserRequest) (*_net return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -144,7 +123,8 @@ func (a *UserApiService) DeleteUserExecute(r UserApiApiDeleteUserRequest) (*_net newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -154,7 +134,8 @@ func (a *UserApiService) DeleteUserExecute(r UserApiApiDeleteUserRequest) (*_net newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -164,7 +145,8 @@ func (a *UserApiService) DeleteUserExecute(r UserApiApiDeleteUserRequest) (*_net newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -174,7 +156,8 @@ func (a *UserApiService) DeleteUserExecute(r UserApiApiDeleteUserRequest) (*_net newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -182,14 +165,13 @@ func (a *UserApiService) DeleteUserExecute(r UserApiApiDeleteUserRequest) (*_net return localVarHTTPResponse, nil } -type UserApiApiGetUserRequest struct { - ctx _context.Context - ApiService *UserApiService +type ApiGetUserRequest struct { + ctx context.Context + ApiService *UserAPIService username string } - -func (r UserApiApiGetUserRequest) Execute() (UserCollectionItem, *_nethttp.Response, error) { +func (r ApiGetUserRequest) Execute() (*UserCollectionItem, *http.Response, error) { return r.ApiService.GetUserExecute(r) } @@ -198,15 +180,17 @@ GetUser Get a user Get a user with a specific username. -*New in version 2.1.0* +*This API endpoint is deprecated, please use the endpoint `/auth/fab/v1` for this operation instead.* - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param username The username of the user. *New in version 2.1.0* - @return UserApiApiGetUserRequest + @return ApiGetUserRequest + +Deprecated */ -func (a *UserApiService) GetUser(ctx _context.Context, username string) UserApiApiGetUserRequest { - return UserApiApiGetUserRequest{ +func (a *UserAPIService) GetUser(ctx context.Context, username string) ApiGetUserRequest { + return ApiGetUserRequest{ ApiService: a, ctx: ctx, username: username, @@ -215,27 +199,26 @@ func (a *UserApiService) GetUser(ctx _context.Context, username string) UserApiA // Execute executes the request // @return UserCollectionItem -func (a *UserApiService) GetUserExecute(r UserApiApiGetUserRequest) (UserCollectionItem, *_nethttp.Response, error) { +// Deprecated +func (a *UserAPIService) GetUserExecute(r ApiGetUserRequest) (*UserCollectionItem, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue UserCollectionItem + formFiles []formFile + localVarReturnValue *UserCollectionItem ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.GetUser") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserAPIService.GetUser") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/users/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(r.username, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -254,7 +237,7 @@ func (a *UserApiService) GetUserExecute(r UserApiApiGetUserRequest) (UserCollect if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -264,15 +247,15 @@ func (a *UserApiService) GetUserExecute(r UserApiApiGetUserRequest) (UserCollect return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -283,7 +266,8 @@ func (a *UserApiService) GetUserExecute(r UserApiApiGetUserRequest) (UserCollect newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -293,7 +277,8 @@ func (a *UserApiService) GetUserExecute(r UserApiApiGetUserRequest) (UserCollect newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -303,14 +288,15 @@ func (a *UserApiService) GetUserExecute(r UserApiApiGetUserRequest) (UserCollect newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -320,31 +306,33 @@ func (a *UserApiService) GetUserExecute(r UserApiApiGetUserRequest) (UserCollect return localVarReturnValue, localVarHTTPResponse, nil } -type UserApiApiGetUsersRequest struct { - ctx _context.Context - ApiService *UserApiService +type ApiGetUsersRequest struct { + ctx context.Context + ApiService *UserAPIService limit *int32 offset *int32 orderBy *string } // The numbers of items to return. -func (r UserApiApiGetUsersRequest) Limit(limit int32) UserApiApiGetUsersRequest { +func (r ApiGetUsersRequest) Limit(limit int32) ApiGetUsersRequest { r.limit = &limit return r } + // The number of items to skip before starting to collect the result set. -func (r UserApiApiGetUsersRequest) Offset(offset int32) UserApiApiGetUsersRequest { +func (r ApiGetUsersRequest) Offset(offset int32) ApiGetUsersRequest { r.offset = &offset return r } + // The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* -func (r UserApiApiGetUsersRequest) OrderBy(orderBy string) UserApiApiGetUsersRequest { +func (r ApiGetUsersRequest) OrderBy(orderBy string) ApiGetUsersRequest { r.orderBy = &orderBy return r } -func (r UserApiApiGetUsersRequest) Execute() (UserCollection, *_nethttp.Response, error) { +func (r ApiGetUsersRequest) Execute() (*UserCollection, *http.Response, error) { return r.ApiService.GetUsersExecute(r) } @@ -353,14 +341,16 @@ GetUsers List users Get a list of users. -*New in version 2.1.0* +*This API endpoint is deprecated, please use the endpoint `/auth/fab/v1` for this operation instead.* + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetUsersRequest - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return UserApiApiGetUsersRequest +Deprecated */ -func (a *UserApiService) GetUsers(ctx _context.Context) UserApiApiGetUsersRequest { - return UserApiApiGetUsersRequest{ +func (a *UserAPIService) GetUsers(ctx context.Context) ApiGetUsersRequest { + return ApiGetUsersRequest{ ApiService: a, ctx: ctx, } @@ -368,35 +358,37 @@ func (a *UserApiService) GetUsers(ctx _context.Context) UserApiApiGetUsersReques // Execute executes the request // @return UserCollection -func (a *UserApiService) GetUsersExecute(r UserApiApiGetUsersRequest) (UserCollection, *_nethttp.Response, error) { +// Deprecated +func (a *UserAPIService) GetUsersExecute(r ApiGetUsersRequest) (*UserCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue UserCollection + formFiles []formFile + localVarReturnValue *UserCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.GetUsers") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserAPIService.GetUsers") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/users" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue } if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") } if r.orderBy != nil { - localVarQueryParams.Add("order_by", parameterToString(*r.orderBy, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "order_by", r.orderBy, "form", "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -415,7 +407,7 @@ func (a *UserApiService) GetUsersExecute(r UserApiApiGetUsersRequest) (UserColle if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -425,15 +417,15 @@ func (a *UserApiService) GetUsersExecute(r UserApiApiGetUsersRequest) (UserColle return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -444,7 +436,8 @@ func (a *UserApiService) GetUsersExecute(r UserApiApiGetUsersRequest) (UserColle newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -454,14 +447,15 @@ func (a *UserApiService) GetUsersExecute(r UserApiApiGetUsersRequest) (UserColle newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -471,25 +465,26 @@ func (a *UserApiService) GetUsersExecute(r UserApiApiGetUsersRequest) (UserColle return localVarReturnValue, localVarHTTPResponse, nil } -type UserApiApiPatchUserRequest struct { - ctx _context.Context - ApiService *UserApiService +type ApiPatchUserRequest struct { + ctx context.Context + ApiService *UserAPIService username string user *User updateMask *[]string } -func (r UserApiApiPatchUserRequest) User(user User) UserApiApiPatchUserRequest { +func (r ApiPatchUserRequest) User(user User) ApiPatchUserRequest { r.user = &user return r } + // The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. -func (r UserApiApiPatchUserRequest) UpdateMask(updateMask []string) UserApiApiPatchUserRequest { +func (r ApiPatchUserRequest) UpdateMask(updateMask []string) ApiPatchUserRequest { r.updateMask = &updateMask return r } -func (r UserApiApiPatchUserRequest) Execute() (Role, *_nethttp.Response, error) { +func (r ApiPatchUserRequest) Execute() (*UserCollectionItem, *http.Response, error) { return r.ApiService.PatchUserExecute(r) } @@ -498,15 +493,17 @@ PatchUser Update a user Update fields for a user. -*New in version 2.2.0* +*This API endpoint is deprecated, please use the endpoint `/auth/fab/v1` for this operation instead.* - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param username The username of the user. *New in version 2.1.0* - @return UserApiApiPatchUserRequest + @return ApiPatchUserRequest + +Deprecated */ -func (a *UserApiService) PatchUser(ctx _context.Context, username string) UserApiApiPatchUserRequest { - return UserApiApiPatchUserRequest{ +func (a *UserAPIService) PatchUser(ctx context.Context, username string) ApiPatchUserRequest { + return ApiPatchUserRequest{ ApiService: a, ctx: ctx, username: username, @@ -514,34 +511,33 @@ func (a *UserApiService) PatchUser(ctx _context.Context, username string) UserAp } // Execute executes the request -// @return Role -func (a *UserApiService) PatchUserExecute(r UserApiApiPatchUserRequest) (Role, *_nethttp.Response, error) { +// @return UserCollectionItem +// Deprecated +func (a *UserAPIService) PatchUserExecute(r ApiPatchUserRequest) (*UserCollectionItem, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Role + formFiles []formFile + localVarReturnValue *UserCollectionItem ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.PatchUser") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserAPIService.PatchUser") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/users/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.PathEscape(parameterToString(r.username, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.user == nil { return localVarReturnValue, nil, reportError("user is required and must be specified") } if r.updateMask != nil { - localVarQueryParams.Add("update_mask", parameterToString(*r.updateMask, "csv")) + parameterAddToHeaderOrQuery(localVarQueryParams, "update_mask", r.updateMask, "form", "csv") } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -562,7 +558,7 @@ func (a *UserApiService) PatchUserExecute(r UserApiApiPatchUserRequest) (Role, * } // body params localVarPostBody = r.user - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -572,15 +568,15 @@ func (a *UserApiService) PatchUserExecute(r UserApiApiPatchUserRequest) (Role, * return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -591,7 +587,8 @@ func (a *UserApiService) PatchUserExecute(r UserApiApiPatchUserRequest) (Role, * newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -601,7 +598,8 @@ func (a *UserApiService) PatchUserExecute(r UserApiApiPatchUserRequest) (Role, * newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -611,7 +609,8 @@ func (a *UserApiService) PatchUserExecute(r UserApiApiPatchUserRequest) (Role, * newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -621,14 +620,15 @@ func (a *UserApiService) PatchUserExecute(r UserApiApiPatchUserRequest) (Role, * newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -638,18 +638,18 @@ func (a *UserApiService) PatchUserExecute(r UserApiApiPatchUserRequest) (Role, * return localVarReturnValue, localVarHTTPResponse, nil } -type UserApiApiPostUserRequest struct { - ctx _context.Context - ApiService *UserApiService +type ApiPostUserRequest struct { + ctx context.Context + ApiService *UserAPIService user *User } -func (r UserApiApiPostUserRequest) User(user User) UserApiApiPostUserRequest { +func (r ApiPostUserRequest) User(user User) ApiPostUserRequest { r.user = &user return r } -func (r UserApiApiPostUserRequest) Execute() (User, *_nethttp.Response, error) { +func (r ApiPostUserRequest) Execute() (*User, *http.Response, error) { return r.ApiService.PostUserExecute(r) } @@ -658,14 +658,16 @@ PostUser Create a user Create a new user with unique username and email. -*New in version 2.2.0* +*This API endpoint is deprecated, please use the endpoint `/auth/fab/v1` for this operation instead.* + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPostUserRequest - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return UserApiApiPostUserRequest +Deprecated */ -func (a *UserApiService) PostUser(ctx _context.Context) UserApiApiPostUserRequest { - return UserApiApiPostUserRequest{ +func (a *UserAPIService) PostUser(ctx context.Context) ApiPostUserRequest { + return ApiPostUserRequest{ ApiService: a, ctx: ctx, } @@ -673,26 +675,25 @@ func (a *UserApiService) PostUser(ctx _context.Context) UserApiApiPostUserReques // Execute executes the request // @return User -func (a *UserApiService) PostUserExecute(r UserApiApiPostUserRequest) (User, *_nethttp.Response, error) { +// Deprecated +func (a *UserAPIService) PostUserExecute(r ApiPostUserRequest) (*User, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue User + formFiles []formFile + localVarReturnValue *User ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.PostUser") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserAPIService.PostUser") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/users" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.user == nil { return localVarReturnValue, nil, reportError("user is required and must be specified") } @@ -716,7 +717,7 @@ func (a *UserApiService) PostUserExecute(r UserApiApiPostUserRequest) (User, *_n } // body params localVarPostBody = r.user - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -726,15 +727,15 @@ func (a *UserApiService) PostUserExecute(r UserApiApiPostUserRequest) (User, *_n return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -745,7 +746,8 @@ func (a *UserApiService) PostUserExecute(r UserApiApiPostUserRequest) (User, *_n newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -755,7 +757,8 @@ func (a *UserApiService) PostUserExecute(r UserApiApiPostUserRequest) (User, *_n newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -765,7 +768,8 @@ func (a *UserApiService) PostUserExecute(r UserApiApiPostUserRequest) (User, *_n newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 409 { @@ -775,14 +779,15 @@ func (a *UserApiService) PostUserExecute(r UserApiApiPostUserRequest) (User, *_n newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/airflow/api_variable.go b/airflow/api_variable.go index f9acf87..9b2d197 100644 --- a/airflow/api_variable.go +++ b/airflow/api_variable.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -30,41 +13,36 @@ package airflow import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) -// VariableApiService VariableApi service -type VariableApiService service +// VariableAPIService VariableAPI service +type VariableAPIService service -type VariableApiApiDeleteVariableRequest struct { - ctx _context.Context - ApiService *VariableApiService +type ApiDeleteVariableRequest struct { + ctx context.Context + ApiService *VariableAPIService variableKey string } - -func (r VariableApiApiDeleteVariableRequest) Execute() (*_nethttp.Response, error) { +func (r ApiDeleteVariableRequest) Execute() (*http.Response, error) { return r.ApiService.DeleteVariableExecute(r) } /* DeleteVariable Delete a variable - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param variableKey The variable Key. - @return VariableApiApiDeleteVariableRequest + @return ApiDeleteVariableRequest */ -func (a *VariableApiService) DeleteVariable(ctx _context.Context, variableKey string) VariableApiApiDeleteVariableRequest { - return VariableApiApiDeleteVariableRequest{ +func (a *VariableAPIService) DeleteVariable(ctx context.Context, variableKey string) ApiDeleteVariableRequest { + return ApiDeleteVariableRequest{ ApiService: a, ctx: ctx, variableKey: variableKey, @@ -72,26 +50,24 @@ func (a *VariableApiService) DeleteVariable(ctx _context.Context, variableKey st } // Execute executes the request -func (a *VariableApiService) DeleteVariableExecute(r VariableApiApiDeleteVariableRequest) (*_nethttp.Response, error) { +func (a *VariableAPIService) DeleteVariableExecute(r ApiDeleteVariableRequest) (*http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodDelete + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte + formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VariableApiService.DeleteVariable") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VariableAPIService.DeleteVariable") if err != nil { - return nil, GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/variables/{variable_key}" - localVarPath = strings.Replace(localVarPath, "{"+"variable_key"+"}", _neturl.PathEscape(parameterToString(r.variableKey, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"variable_key"+"}", url.PathEscape(parameterValueToString(r.variableKey, "variableKey")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -110,7 +86,7 @@ func (a *VariableApiService) DeleteVariableExecute(r VariableApiApiDeleteVariabl if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return nil, err } @@ -120,15 +96,15 @@ func (a *VariableApiService) DeleteVariableExecute(r VariableApiApiDeleteVariabl return localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -139,7 +115,8 @@ func (a *VariableApiService) DeleteVariableExecute(r VariableApiApiDeleteVariabl newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -149,7 +126,8 @@ func (a *VariableApiService) DeleteVariableExecute(r VariableApiApiDeleteVariabl newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -159,7 +137,8 @@ func (a *VariableApiService) DeleteVariableExecute(r VariableApiApiDeleteVariabl newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -169,7 +148,8 @@ func (a *VariableApiService) DeleteVariableExecute(r VariableApiApiDeleteVariabl newErr.error = err.Error() return localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarHTTPResponse, newErr } @@ -177,14 +157,13 @@ func (a *VariableApiService) DeleteVariableExecute(r VariableApiApiDeleteVariabl return localVarHTTPResponse, nil } -type VariableApiApiGetVariableRequest struct { - ctx _context.Context - ApiService *VariableApiService +type ApiGetVariableRequest struct { + ctx context.Context + ApiService *VariableAPIService variableKey string } - -func (r VariableApiApiGetVariableRequest) Execute() (Variable, *_nethttp.Response, error) { +func (r ApiGetVariableRequest) Execute() (*Variable, *http.Response, error) { return r.ApiService.GetVariableExecute(r) } @@ -193,12 +172,12 @@ GetVariable Get a variable Get a variable by key. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param variableKey The variable Key. - @return VariableApiApiGetVariableRequest + @return ApiGetVariableRequest */ -func (a *VariableApiService) GetVariable(ctx _context.Context, variableKey string) VariableApiApiGetVariableRequest { - return VariableApiApiGetVariableRequest{ +func (a *VariableAPIService) GetVariable(ctx context.Context, variableKey string) ApiGetVariableRequest { + return ApiGetVariableRequest{ ApiService: a, ctx: ctx, variableKey: variableKey, @@ -207,27 +186,25 @@ func (a *VariableApiService) GetVariable(ctx _context.Context, variableKey strin // Execute executes the request // @return Variable -func (a *VariableApiService) GetVariableExecute(r VariableApiApiGetVariableRequest) (Variable, *_nethttp.Response, error) { +func (a *VariableAPIService) GetVariableExecute(r ApiGetVariableRequest) (*Variable, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Variable + formFiles []formFile + localVarReturnValue *Variable ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VariableApiService.GetVariable") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VariableAPIService.GetVariable") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/variables/{variable_key}" - localVarPath = strings.Replace(localVarPath, "{"+"variable_key"+"}", _neturl.PathEscape(parameterToString(r.variableKey, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"variable_key"+"}", url.PathEscape(parameterValueToString(r.variableKey, "variableKey")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -246,7 +223,7 @@ func (a *VariableApiService) GetVariableExecute(r VariableApiApiGetVariableReque if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -256,15 +233,15 @@ func (a *VariableApiService) GetVariableExecute(r VariableApiApiGetVariableReque return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -275,7 +252,8 @@ func (a *VariableApiService) GetVariableExecute(r VariableApiApiGetVariableReque newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -285,7 +263,8 @@ func (a *VariableApiService) GetVariableExecute(r VariableApiApiGetVariableReque newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -295,14 +274,15 @@ func (a *VariableApiService) GetVariableExecute(r VariableApiApiGetVariableReque newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -312,31 +292,33 @@ func (a *VariableApiService) GetVariableExecute(r VariableApiApiGetVariableReque return localVarReturnValue, localVarHTTPResponse, nil } -type VariableApiApiGetVariablesRequest struct { - ctx _context.Context - ApiService *VariableApiService +type ApiGetVariablesRequest struct { + ctx context.Context + ApiService *VariableAPIService limit *int32 offset *int32 orderBy *string } // The numbers of items to return. -func (r VariableApiApiGetVariablesRequest) Limit(limit int32) VariableApiApiGetVariablesRequest { +func (r ApiGetVariablesRequest) Limit(limit int32) ApiGetVariablesRequest { r.limit = &limit return r } + // The number of items to skip before starting to collect the result set. -func (r VariableApiApiGetVariablesRequest) Offset(offset int32) VariableApiApiGetVariablesRequest { +func (r ApiGetVariablesRequest) Offset(offset int32) ApiGetVariablesRequest { r.offset = &offset return r } + // The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* -func (r VariableApiApiGetVariablesRequest) OrderBy(orderBy string) VariableApiApiGetVariablesRequest { +func (r ApiGetVariablesRequest) OrderBy(orderBy string) ApiGetVariablesRequest { r.orderBy = &orderBy return r } -func (r VariableApiApiGetVariablesRequest) Execute() (VariableCollection, *_nethttp.Response, error) { +func (r ApiGetVariablesRequest) Execute() (*VariableCollection, *http.Response, error) { return r.ApiService.GetVariablesExecute(r) } @@ -345,11 +327,11 @@ GetVariables List variables The collection does not contain data. To get data, you must get a single entity. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return VariableApiApiGetVariablesRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetVariablesRequest */ -func (a *VariableApiService) GetVariables(ctx _context.Context) VariableApiApiGetVariablesRequest { - return VariableApiApiGetVariablesRequest{ +func (a *VariableAPIService) GetVariables(ctx context.Context) ApiGetVariablesRequest { + return ApiGetVariablesRequest{ ApiService: a, ctx: ctx, } @@ -357,35 +339,36 @@ func (a *VariableApiService) GetVariables(ctx _context.Context) VariableApiApiGe // Execute executes the request // @return VariableCollection -func (a *VariableApiService) GetVariablesExecute(r VariableApiApiGetVariablesRequest) (VariableCollection, *_nethttp.Response, error) { +func (a *VariableAPIService) GetVariablesExecute(r ApiGetVariablesRequest) (*VariableCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue VariableCollection + formFiles []formFile + localVarReturnValue *VariableCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VariableApiService.GetVariables") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VariableAPIService.GetVariables") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/variables" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue } if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") } if r.orderBy != nil { - localVarQueryParams.Add("order_by", parameterToString(*r.orderBy, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "order_by", r.orderBy, "form", "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -404,7 +387,7 @@ func (a *VariableApiService) GetVariablesExecute(r VariableApiApiGetVariablesReq if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -414,15 +397,15 @@ func (a *VariableApiService) GetVariablesExecute(r VariableApiApiGetVariablesReq return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -433,7 +416,8 @@ func (a *VariableApiService) GetVariablesExecute(r VariableApiApiGetVariablesReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -443,14 +427,15 @@ func (a *VariableApiService) GetVariablesExecute(r VariableApiApiGetVariablesReq newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -460,25 +445,26 @@ func (a *VariableApiService) GetVariablesExecute(r VariableApiApiGetVariablesReq return localVarReturnValue, localVarHTTPResponse, nil } -type VariableApiApiPatchVariableRequest struct { - ctx _context.Context - ApiService *VariableApiService +type ApiPatchVariableRequest struct { + ctx context.Context + ApiService *VariableAPIService variableKey string variable *Variable updateMask *[]string } -func (r VariableApiApiPatchVariableRequest) Variable(variable Variable) VariableApiApiPatchVariableRequest { +func (r ApiPatchVariableRequest) Variable(variable Variable) ApiPatchVariableRequest { r.variable = &variable return r } + // The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. -func (r VariableApiApiPatchVariableRequest) UpdateMask(updateMask []string) VariableApiApiPatchVariableRequest { +func (r ApiPatchVariableRequest) UpdateMask(updateMask []string) ApiPatchVariableRequest { r.updateMask = &updateMask return r } -func (r VariableApiApiPatchVariableRequest) Execute() (Variable, *_nethttp.Response, error) { +func (r ApiPatchVariableRequest) Execute() (*Variable, *http.Response, error) { return r.ApiService.PatchVariableExecute(r) } @@ -487,12 +473,12 @@ PatchVariable Update a variable Update a variable by key. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param variableKey The variable Key. - @return VariableApiApiPatchVariableRequest + @return ApiPatchVariableRequest */ -func (a *VariableApiService) PatchVariable(ctx _context.Context, variableKey string) VariableApiApiPatchVariableRequest { - return VariableApiApiPatchVariableRequest{ +func (a *VariableAPIService) PatchVariable(ctx context.Context, variableKey string) ApiPatchVariableRequest { + return ApiPatchVariableRequest{ ApiService: a, ctx: ctx, variableKey: variableKey, @@ -501,33 +487,31 @@ func (a *VariableApiService) PatchVariable(ctx _context.Context, variableKey str // Execute executes the request // @return Variable -func (a *VariableApiService) PatchVariableExecute(r VariableApiApiPatchVariableRequest) (Variable, *_nethttp.Response, error) { +func (a *VariableAPIService) PatchVariableExecute(r ApiPatchVariableRequest) (*Variable, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPatch + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Variable + formFiles []formFile + localVarReturnValue *Variable ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VariableApiService.PatchVariable") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VariableAPIService.PatchVariable") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/variables/{variable_key}" - localVarPath = strings.Replace(localVarPath, "{"+"variable_key"+"}", _neturl.PathEscape(parameterToString(r.variableKey, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"variable_key"+"}", url.PathEscape(parameterValueToString(r.variableKey, "variableKey")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.variable == nil { return localVarReturnValue, nil, reportError("variable is required and must be specified") } if r.updateMask != nil { - localVarQueryParams.Add("update_mask", parameterToString(*r.updateMask, "csv")) + parameterAddToHeaderOrQuery(localVarQueryParams, "update_mask", r.updateMask, "form", "csv") } // to determine the Content-Type header localVarHTTPContentTypes := []string{"application/json"} @@ -548,7 +532,7 @@ func (a *VariableApiService) PatchVariableExecute(r VariableApiApiPatchVariableR } // body params localVarPostBody = r.variable - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -558,15 +542,15 @@ func (a *VariableApiService) PatchVariableExecute(r VariableApiApiPatchVariableR return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -577,7 +561,8 @@ func (a *VariableApiService) PatchVariableExecute(r VariableApiApiPatchVariableR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -587,7 +572,8 @@ func (a *VariableApiService) PatchVariableExecute(r VariableApiApiPatchVariableR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -597,7 +583,8 @@ func (a *VariableApiService) PatchVariableExecute(r VariableApiApiPatchVariableR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -607,14 +594,15 @@ func (a *VariableApiService) PatchVariableExecute(r VariableApiApiPatchVariableR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -624,29 +612,29 @@ func (a *VariableApiService) PatchVariableExecute(r VariableApiApiPatchVariableR return localVarReturnValue, localVarHTTPResponse, nil } -type VariableApiApiPostVariablesRequest struct { - ctx _context.Context - ApiService *VariableApiService +type ApiPostVariablesRequest struct { + ctx context.Context + ApiService *VariableAPIService variable *Variable } -func (r VariableApiApiPostVariablesRequest) Variable(variable Variable) VariableApiApiPostVariablesRequest { +func (r ApiPostVariablesRequest) Variable(variable Variable) ApiPostVariablesRequest { r.variable = &variable return r } -func (r VariableApiApiPostVariablesRequest) Execute() (Variable, *_nethttp.Response, error) { +func (r ApiPostVariablesRequest) Execute() (*Variable, *http.Response, error) { return r.ApiService.PostVariablesExecute(r) } /* PostVariables Create a variable - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return VariableApiApiPostVariablesRequest + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPostVariablesRequest */ -func (a *VariableApiService) PostVariables(ctx _context.Context) VariableApiApiPostVariablesRequest { - return VariableApiApiPostVariablesRequest{ +func (a *VariableAPIService) PostVariables(ctx context.Context) ApiPostVariablesRequest { + return ApiPostVariablesRequest{ ApiService: a, ctx: ctx, } @@ -654,26 +642,24 @@ func (a *VariableApiService) PostVariables(ctx _context.Context) VariableApiApiP // Execute executes the request // @return Variable -func (a *VariableApiService) PostVariablesExecute(r VariableApiApiPostVariablesRequest) (Variable, *_nethttp.Response, error) { +func (a *VariableAPIService) PostVariablesExecute(r ApiPostVariablesRequest) (*Variable, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodPost + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue Variable + formFiles []formFile + localVarReturnValue *Variable ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VariableApiService.PostVariables") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "VariableAPIService.PostVariables") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/variables" localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} if r.variable == nil { return localVarReturnValue, nil, reportError("variable is required and must be specified") } @@ -697,7 +683,7 @@ func (a *VariableApiService) PostVariablesExecute(r VariableApiApiPostVariablesR } // body params localVarPostBody = r.variable - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -707,15 +693,15 @@ func (a *VariableApiService) PostVariablesExecute(r VariableApiApiPostVariablesR return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -726,7 +712,8 @@ func (a *VariableApiService) PostVariablesExecute(r VariableApiApiPostVariablesR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { @@ -736,7 +723,8 @@ func (a *VariableApiService) PostVariablesExecute(r VariableApiApiPostVariablesR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -746,14 +734,15 @@ func (a *VariableApiService) PostVariablesExecute(r VariableApiApiPostVariablesR newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/airflow/api_x_com.go b/airflow/api_x_com.go index 94ad07c..ca970c4 100644 --- a/airflow/api_x_com.go +++ b/airflow/api_x_com.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -30,43 +13,54 @@ package airflow import ( "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" + "context" + "io" + "net/http" + "net/url" "strings" ) -// Linger please -var ( - _ _context.Context -) -// XComApiService XComApi service -type XComApiService service +// XComAPIService XComAPI service +type XComAPIService service -type XComApiApiGetXcomEntriesRequest struct { - ctx _context.Context - ApiService *XComApiService +type ApiGetXcomEntriesRequest struct { + ctx context.Context + ApiService *XComAPIService dagId string dagRunId string taskId string + mapIndex *int32 + xcomKey *string limit *int32 offset *int32 } +// Filter on map index for mapped task. +func (r ApiGetXcomEntriesRequest) MapIndex(mapIndex int32) ApiGetXcomEntriesRequest { + r.mapIndex = &mapIndex + return r +} + +// Only filter the XCom records which have the provided key. +func (r ApiGetXcomEntriesRequest) XcomKey(xcomKey string) ApiGetXcomEntriesRequest { + r.xcomKey = &xcomKey + return r +} + // The numbers of items to return. -func (r XComApiApiGetXcomEntriesRequest) Limit(limit int32) XComApiApiGetXcomEntriesRequest { +func (r ApiGetXcomEntriesRequest) Limit(limit int32) ApiGetXcomEntriesRequest { r.limit = &limit return r } + // The number of items to skip before starting to collect the result set. -func (r XComApiApiGetXcomEntriesRequest) Offset(offset int32) XComApiApiGetXcomEntriesRequest { +func (r ApiGetXcomEntriesRequest) Offset(offset int32) ApiGetXcomEntriesRequest { r.offset = &offset return r } -func (r XComApiApiGetXcomEntriesRequest) Execute() (XComCollection, *_nethttp.Response, error) { +func (r ApiGetXcomEntriesRequest) Execute() (*XComCollection, *http.Response, error) { return r.ApiService.GetXcomEntriesExecute(r) } @@ -75,14 +69,14 @@ GetXcomEntries List XCom entries This endpoint allows specifying `~` as the dag_id, dag_run_id, task_id to retrieve XCOM entries for for all DAGs, DAG runs and task instances. XCom values won't be returned as they can be large. Use this endpoint to get a list of XCom entries and then fetch individual entry to get value. - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. @param dagRunId The DAG run ID. @param taskId The task ID. - @return XComApiApiGetXcomEntriesRequest + @return ApiGetXcomEntriesRequest */ -func (a *XComApiService) GetXcomEntries(ctx _context.Context, dagId string, dagRunId string, taskId string) XComApiApiGetXcomEntriesRequest { - return XComApiApiGetXcomEntriesRequest{ +func (a *XComAPIService) GetXcomEntries(ctx context.Context, dagId string, dagRunId string, taskId string) ApiGetXcomEntriesRequest { + return ApiGetXcomEntriesRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -93,35 +87,42 @@ func (a *XComApiService) GetXcomEntries(ctx _context.Context, dagId string, dagR // Execute executes the request // @return XComCollection -func (a *XComApiService) GetXcomEntriesExecute(r XComApiApiGetXcomEntriesRequest) (XComCollection, *_nethttp.Response, error) { +func (a *XComAPIService) GetXcomEntriesExecute(r ApiGetXcomEntriesRequest) (*XComCollection, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue XComCollection + formFiles []formFile + localVarReturnValue *XComCollection ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "XComApiService.GetXcomEntries") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "XComAPIService.GetXcomEntries") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", _neturl.PathEscape(parameterToString(r.dagRunId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", _neturl.PathEscape(parameterToString(r.taskId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", url.PathEscape(parameterValueToString(r.taskId, "taskId")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.mapIndex != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "map_index", r.mapIndex, "form", "") + } + if r.xcomKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "xcom_key", r.xcomKey, "form", "") + } if r.limit != nil { - localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue } if r.offset != nil { - localVarQueryParams.Add("offset", parameterToString(*r.offset, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -140,7 +141,7 @@ func (a *XComApiService) GetXcomEntriesExecute(r XComApiApiGetXcomEntriesRequest if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -150,15 +151,15 @@ func (a *XComApiService) GetXcomEntriesExecute(r XComApiApiGetXcomEntriesRequest return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -169,7 +170,8 @@ func (a *XComApiService) GetXcomEntriesExecute(r XComApiApiGetXcomEntriesRequest newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -179,14 +181,15 @@ func (a *XComApiService) GetXcomEntriesExecute(r XComApiApiGetXcomEntriesRequest newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } @@ -196,38 +199,52 @@ func (a *XComApiService) GetXcomEntriesExecute(r XComApiApiGetXcomEntriesRequest return localVarReturnValue, localVarHTTPResponse, nil } -type XComApiApiGetXcomEntryRequest struct { - ctx _context.Context - ApiService *XComApiService +type ApiGetXcomEntryRequest struct { + ctx context.Context + ApiService *XComAPIService dagId string dagRunId string taskId string xcomKey string + mapIndex *int32 deserialize *bool + stringify *bool +} + +// Filter on map index for mapped task. +func (r ApiGetXcomEntryRequest) MapIndex(mapIndex int32) ApiGetXcomEntryRequest { + r.mapIndex = &mapIndex + return r } // Whether to deserialize an XCom value when using a custom XCom backend. The XCom API endpoint calls `orm_deserialize_value` by default since an XCom may contain value that is potentially expensive to deserialize in the web server. Setting this to true overrides the consideration, and calls `deserialize_value` instead. This parameter is not meaningful when using the default XCom backend. *New in version 2.4.0* -func (r XComApiApiGetXcomEntryRequest) Deserialize(deserialize bool) XComApiApiGetXcomEntryRequest { +func (r ApiGetXcomEntryRequest) Deserialize(deserialize bool) ApiGetXcomEntryRequest { r.deserialize = &deserialize return r } -func (r XComApiApiGetXcomEntryRequest) Execute() (XCom, *_nethttp.Response, error) { +// Whether to convert the XCom value to be a string. XCom values can be of Any data type. If set to true (default) the Any value will be returned as string, e.g. a Python representation of a dict. If set to false it will return the raw data as dict, list, string or whatever was stored. This parameter is not meaningful when using XCom pickling, then it is always returned as string. *New in version 2.10.0* +func (r ApiGetXcomEntryRequest) Stringify(stringify bool) ApiGetXcomEntryRequest { + r.stringify = &stringify + return r +} + +func (r ApiGetXcomEntryRequest) Execute() (*XCom, *http.Response, error) { return r.ApiService.GetXcomEntryExecute(r) } /* GetXcomEntry Get an XCom entry - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param dagId The DAG ID. @param dagRunId The DAG run ID. @param taskId The task ID. @param xcomKey The XCom key. - @return XComApiApiGetXcomEntryRequest + @return ApiGetXcomEntryRequest */ -func (a *XComApiService) GetXcomEntry(ctx _context.Context, dagId string, dagRunId string, taskId string, xcomKey string) XComApiApiGetXcomEntryRequest { - return XComApiApiGetXcomEntryRequest{ +func (a *XComAPIService) GetXcomEntry(ctx context.Context, dagId string, dagRunId string, taskId string, xcomKey string) ApiGetXcomEntryRequest { + return ApiGetXcomEntryRequest{ ApiService: a, ctx: ctx, dagId: dagId, @@ -239,33 +256,43 @@ func (a *XComApiService) GetXcomEntry(ctx _context.Context, dagId string, dagRun // Execute executes the request // @return XCom -func (a *XComApiService) GetXcomEntryExecute(r XComApiApiGetXcomEntryRequest) (XCom, *_nethttp.Response, error) { +func (a *XComAPIService) GetXcomEntryExecute(r ApiGetXcomEntryRequest) (*XCom, *http.Response, error) { var ( - localVarHTTPMethod = _nethttp.MethodGet + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue XCom + formFiles []formFile + localVarReturnValue *XCom ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "XComApiService.GetXcomEntry") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "XComAPIService.GetXcomEntry") if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } localVarPath := localBasePath + "/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries/{xcom_key}" - localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", _neturl.PathEscape(parameterToString(r.dagId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", _neturl.PathEscape(parameterToString(r.dagRunId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", _neturl.PathEscape(parameterToString(r.taskId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"xcom_key"+"}", _neturl.PathEscape(parameterToString(r.xcomKey, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_id"+"}", url.PathEscape(parameterValueToString(r.dagId, "dagId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"dag_run_id"+"}", url.PathEscape(parameterValueToString(r.dagRunId, "dagRunId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"task_id"+"}", url.PathEscape(parameterValueToString(r.taskId, "taskId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"xcom_key"+"}", url.PathEscape(parameterValueToString(r.xcomKey, "xcomKey")), -1) localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.mapIndex != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "map_index", r.mapIndex, "form", "") + } if r.deserialize != nil { - localVarQueryParams.Add("deserialize", parameterToString(*r.deserialize, "")) + parameterAddToHeaderOrQuery(localVarQueryParams, "deserialize", r.deserialize, "form", "") + } else { + var defaultValue bool = false + r.deserialize = &defaultValue + } + if r.stringify != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "stringify", r.stringify, "form", "") + } else { + var defaultValue bool = true + r.stringify = &defaultValue } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -284,7 +311,7 @@ func (a *XComApiService) GetXcomEntryExecute(r XComApiApiGetXcomEntryRequest) (X if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, nil, err } @@ -294,15 +321,15 @@ func (a *XComApiService) GetXcomEntryExecute(r XComApiApiGetXcomEntryRequest) (X return localVarReturnValue, localVarHTTPResponse, err } - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: localVarHTTPResponse.Status, } @@ -313,7 +340,8 @@ func (a *XComApiService) GetXcomEntryExecute(r XComApiApiGetXcomEntryRequest) (X newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { @@ -323,7 +351,8 @@ func (a *XComApiService) GetXcomEntryExecute(r XComApiApiGetXcomEntryRequest) (X newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { @@ -333,14 +362,15 @@ func (a *XComApiService) GetXcomEntryExecute(r XComApiApiGetXcomEntryRequest) (X newErr.error = err.Error() return localVarReturnValue, localVarHTTPResponse, newErr } - newErr.model = v + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v } return localVarReturnValue, localVarHTTPResponse, newErr } err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { - newErr := GenericOpenAPIError{ + newErr := &GenericOpenAPIError{ body: localVarBody, error: err.Error(), } diff --git a/airflow/client.go b/airflow/client.go index 9566a78..5d540cd 100644 --- a/airflow/client.go +++ b/airflow/client.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -36,7 +19,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "log" "mime/multipart" "net/http" @@ -51,15 +33,16 @@ import ( "time" "unicode/utf8" - "golang.org/x/oauth2" ) var ( - jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) - xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) ) -// APIClient manages communication with the Airflow API (Stable) API v2.5.0 +// APIClient manages communication with the Airflow API (Stable) API v2.10.5 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *Configuration @@ -67,41 +50,43 @@ type APIClient struct { // API Services - ConfigApi *ConfigApiService + ConfigAPI *ConfigAPIService + + ConnectionAPI *ConnectionAPIService - ConnectionApi *ConnectionApiService + DAGAPI *DAGAPIService - DAGApi *DAGApiService + DAGRunAPI *DAGRunAPIService - DAGRunApi *DAGRunApiService + DagStatsAPI *DagStatsAPIService - DagWarningApi *DagWarningApiService + DagWarningAPI *DagWarningAPIService - DatasetApi *DatasetApiService + DatasetAPI *DatasetAPIService - EventLogApi *EventLogApiService + EventLogAPI *EventLogAPIService - ImportErrorApi *ImportErrorApiService + ImportErrorAPI *ImportErrorAPIService - MonitoringApi *MonitoringApiService + MonitoringAPI *MonitoringAPIService - PermissionApi *PermissionApiService + PermissionAPI *PermissionAPIService - PluginApi *PluginApiService + PluginAPI *PluginAPIService - PoolApi *PoolApiService + PoolAPI *PoolAPIService - ProviderApi *ProviderApiService + ProviderAPI *ProviderAPIService - RoleApi *RoleApiService + RoleAPI *RoleAPIService - TaskInstanceApi *TaskInstanceApiService + TaskInstanceAPI *TaskInstanceAPIService - UserApi *UserApiService + UserAPI *UserAPIService - VariableApi *VariableApiService + VariableAPI *VariableAPIService - XComApi *XComApiService + XComAPI *XComAPIService } type service struct { @@ -120,24 +105,25 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.common.client = c // API Services - c.ConfigApi = (*ConfigApiService)(&c.common) - c.ConnectionApi = (*ConnectionApiService)(&c.common) - c.DAGApi = (*DAGApiService)(&c.common) - c.DAGRunApi = (*DAGRunApiService)(&c.common) - c.DagWarningApi = (*DagWarningApiService)(&c.common) - c.DatasetApi = (*DatasetApiService)(&c.common) - c.EventLogApi = (*EventLogApiService)(&c.common) - c.ImportErrorApi = (*ImportErrorApiService)(&c.common) - c.MonitoringApi = (*MonitoringApiService)(&c.common) - c.PermissionApi = (*PermissionApiService)(&c.common) - c.PluginApi = (*PluginApiService)(&c.common) - c.PoolApi = (*PoolApiService)(&c.common) - c.ProviderApi = (*ProviderApiService)(&c.common) - c.RoleApi = (*RoleApiService)(&c.common) - c.TaskInstanceApi = (*TaskInstanceApiService)(&c.common) - c.UserApi = (*UserApiService)(&c.common) - c.VariableApi = (*VariableApiService)(&c.common) - c.XComApi = (*XComApiService)(&c.common) + c.ConfigAPI = (*ConfigAPIService)(&c.common) + c.ConnectionAPI = (*ConnectionAPIService)(&c.common) + c.DAGAPI = (*DAGAPIService)(&c.common) + c.DAGRunAPI = (*DAGRunAPIService)(&c.common) + c.DagStatsAPI = (*DagStatsAPIService)(&c.common) + c.DagWarningAPI = (*DagWarningAPIService)(&c.common) + c.DatasetAPI = (*DatasetAPIService)(&c.common) + c.EventLogAPI = (*EventLogAPIService)(&c.common) + c.ImportErrorAPI = (*ImportErrorAPIService)(&c.common) + c.MonitoringAPI = (*MonitoringAPIService)(&c.common) + c.PermissionAPI = (*PermissionAPIService)(&c.common) + c.PluginAPI = (*PluginAPIService)(&c.common) + c.PoolAPI = (*PoolAPIService)(&c.common) + c.ProviderAPI = (*ProviderAPIService)(&c.common) + c.RoleAPI = (*RoleAPIService)(&c.common) + c.TaskInstanceAPI = (*TaskInstanceAPIService)(&c.common) + c.UserAPI = (*UserAPIService)(&c.common) + c.VariableAPI = (*VariableAPIService)(&c.common) + c.XComAPI = (*XComAPIService)(&c.common) return c } @@ -173,7 +159,7 @@ func selectHeaderAccept(accepts []string) string { // contains is a case insensitive match, finding needle in a haystack func contains(haystack []string, needle string) bool { for _, a := range haystack { - if strings.ToLower(a) == strings.ToLower(needle) { + if strings.EqualFold(a, needle) { return true } } @@ -189,33 +175,119 @@ func typeCheckParameter(obj interface{}, expected string, name string) error { // Check the type is as expected. if reflect.TypeOf(obj).String() != expected { - return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) } return nil } -// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. -func parameterToString(obj interface{}, collectionFormat string) string { - var delimiter string +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } - switch collectionFormat { - case "pipes": - delimiter = "|" - case "ssv": - delimiter = " " - case "tsv": - delimiter = "\t" - case "csv": - delimiter = "," + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" - if reflect.TypeOf(obj).Kind() == reflect.Slice { - return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") - } else if t, ok := obj.(time.Time); ok { - return t.Format(time.RFC3339) + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(fileBytes) > 0 && fileName != "") { + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { if body != nil { return nil, errors.New("Cannot specify postBody and multipart form at the same time.") } @@ -306,16 +382,17 @@ func (c *APIClient) prepareRequest( } } } - if len(fileBytes) > 0 && fileName != "" { - w.Boundary() - //_, fileNm := filepath.Split(fileName) - part, err := w.CreateFormFile(formFileName, filepath.Base(fileName)) - if err != nil { - return nil, err - } - _, err = part.Write(fileBytes) - if err != nil { - return nil, err + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } } } @@ -362,7 +439,11 @@ func (c *APIClient) prepareRequest( } // Encode the parameters. - url.RawQuery = query.Encode() + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) // Generate a new request if body != nil { @@ -378,7 +459,7 @@ func (c *APIClient) prepareRequest( if len(headerParams) > 0 { headers := http.Header{} for h, v := range headerParams { - headers.Set(h, v) + headers[h] = []string{v} } localVarRequest.Header = headers } @@ -392,27 +473,11 @@ func (c *APIClient) prepareRequest( // Walk through any authentication. - // OAuth2 authentication - if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { - // We were able to grab an oauth2 token from the context - var latestToken *oauth2.Token - if latestToken, err = tok.Token(); err != nil { - return nil, err - } - - latestToken.SetAuthHeader(localVarRequest) - } - // Basic HTTP Authentication if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { localVarRequest.SetBasicAuth(auth.UserName, auth.Password) } - // AccessToken Authentication - if auth, ok := ctx.Value(ContextAccessToken).(string); ok { - localVarRequest.Header.Add("Authorization", "Bearer "+auth) - } - } for header, value := range c.cfg.DefaultHeader { @@ -429,8 +494,20 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err *s = string(b) return nil } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } if f, ok := v.(**os.File); ok { - *f, err = ioutil.TempFile("", "HttpClientFile") + *f, err = os.CreateTemp("", "HttpClientFile") if err != nil { return } @@ -441,13 +518,13 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err _, err = (*f).Seek(0, io.SeekStart) return } - if xmlCheck.MatchString(contentType) { + if XmlCheck.MatchString(contentType) { if err = xml.Unmarshal(b, v); err != nil { return err } return nil } - if jsonCheck.MatchString(contentType) { + if JsonCheck.MatchString(contentType) { if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined if err = unmarshalObj.UnmarshalJSON(b); err != nil { @@ -466,11 +543,14 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err // Add a file to the multipart request func addFile(w *multipart.Writer, fieldName, path string) error { - file, err := os.Open(path) + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() if err != nil { return err } - defer file.Close() part, err := w.CreateFormFile(fieldName, filepath.Base(path)) if err != nil { @@ -481,11 +561,6 @@ func addFile(w *multipart.Writer, fieldName, path string) error { return err } -// Prevent trying to import "fmt" -func reportError(format string, a ...interface{}) error { - return fmt.Errorf(format, a...) -} - // Set request body from an interface{} func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { if bodyBuf == nil { @@ -494,18 +569,22 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e if reader, ok := body.(io.Reader); ok { _, err = bodyBuf.ReadFrom(reader) - } else if fp, ok := body.(**os.File); ok { - _, err = bodyBuf.ReadFrom(*fp) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) } else if b, ok := body.([]byte); ok { _, err = bodyBuf.Write(b) } else if s, ok := body.(string); ok { _, err = bodyBuf.WriteString(s) } else if s, ok := body.(*string); ok { _, err = bodyBuf.WriteString(*s) - } else if jsonCheck.MatchString(contentType) { + } else if JsonCheck.MatchString(contentType) { err = json.NewEncoder(bodyBuf).Encode(body) - } else if xmlCheck.MatchString(contentType) { - err = xml.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } } if err != nil { @@ -513,7 +592,7 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e } if bodyBuf.Len() == 0 { - err = fmt.Errorf("Invalid body type %s\n", contentType) + err = fmt.Errorf("invalid body type %s\n", contentType) return nil, err } return bodyBuf, nil @@ -615,3 +694,23 @@ func (e GenericOpenAPIError) Body() []byte { func (e GenericOpenAPIError) Model() interface{} { return e.model } + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/airflow/configuration.go b/airflow/configuration.go index baaccec..acf68f3 100644 --- a/airflow/configuration.go +++ b/airflow/configuration.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -46,21 +29,9 @@ func (c contextKey) String() string { } var ( - // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. - ContextOAuth2 = contextKey("token") - // ContextBasicAuth takes BasicAuth as authentication for the request. ContextBasicAuth = contextKey("basic") - // ContextAccessToken takes a string oauth2 access token as authentication for the request. - ContextAccessToken = contextKey("accesstoken") - - // ContextAPIKeys takes a string apikey as authentication for the request - ContextAPIKeys = contextKey("apiKeys") - - // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. - ContextHttpSignatureAuth = contextKey("httpsignature") - // ContextServerIndex uses a server configuration from the index. ContextServerIndex = contextKey("serverIndex") @@ -119,12 +90,12 @@ type Configuration struct { func NewConfiguration() *Configuration { cfg := &Configuration{ DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/2.5.0/go", + UserAgent: "OpenAPI-Generator/2.10.5/go", Debug: false, Servers: ServerConfigurations{ { URL: "/api/v1", - Description: "Apache Airflow Stable API.", + Description: "No description provided", }, }, OperationServers: map[string]ServerConfigurations{ @@ -141,7 +112,7 @@ func (c *Configuration) AddDefaultHeader(key string, value string) { // URL formats template on a index using given variables func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { if index < 0 || len(sc) <= index { - return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1) + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) } server := sc[index] url := server.URL @@ -156,7 +127,7 @@ func (sc ServerConfigurations) URL(index int, variables map[string]string) (stri } } if !found { - return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) } url = strings.Replace(url, "{"+name+"}", value, -1) } else { diff --git a/airflow/docs/Action.md b/airflow/docs/Action.md index 7c22436..0b22067 100644 --- a/airflow/docs/Action.md +++ b/airflow/docs/Action.md @@ -1,22 +1,3 @@ - - # Action ## Properties diff --git a/airflow/docs/ActionCollection.md b/airflow/docs/ActionCollection.md index fa911a2..753ff10 100644 --- a/airflow/docs/ActionCollection.md +++ b/airflow/docs/ActionCollection.md @@ -1,30 +1,11 @@ - - # ActionCollection ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] **Actions** | Pointer to [**[]Action**](Action.md) | | [optional] -**TotalEntries** | Pointer to **int32** | Count of objects in the current result set. | [optional] ## Methods @@ -45,55 +26,55 @@ NewActionCollectionWithDefaults instantiates a new ActionCollection object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetActions +### GetTotalEntries -`func (o *ActionCollection) GetActions() []Action` +`func (o *ActionCollection) GetTotalEntries() int32` -GetActions returns the Actions field if non-nil, zero value otherwise. +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. -### GetActionsOk +### GetTotalEntriesOk -`func (o *ActionCollection) GetActionsOk() (*[]Action, bool)` +`func (o *ActionCollection) GetTotalEntriesOk() (*int32, bool)` -GetActionsOk returns a tuple with the Actions field if it's non-nil, zero value otherwise +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetActions +### SetTotalEntries -`func (o *ActionCollection) SetActions(v []Action)` +`func (o *ActionCollection) SetTotalEntries(v int32)` -SetActions sets Actions field to given value. +SetTotalEntries sets TotalEntries field to given value. -### HasActions +### HasTotalEntries -`func (o *ActionCollection) HasActions() bool` +`func (o *ActionCollection) HasTotalEntries() bool` -HasActions returns a boolean if a field has been set. +HasTotalEntries returns a boolean if a field has been set. -### GetTotalEntries +### GetActions -`func (o *ActionCollection) GetTotalEntries() int32` +`func (o *ActionCollection) GetActions() []Action` -GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. +GetActions returns the Actions field if non-nil, zero value otherwise. -### GetTotalEntriesOk +### GetActionsOk -`func (o *ActionCollection) GetTotalEntriesOk() (*int32, bool)` +`func (o *ActionCollection) GetActionsOk() (*[]Action, bool)` -GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +GetActionsOk returns a tuple with the Actions field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTotalEntries +### SetActions -`func (o *ActionCollection) SetTotalEntries(v int32)` +`func (o *ActionCollection) SetActions(v []Action)` -SetTotalEntries sets TotalEntries field to given value. +SetActions sets Actions field to given value. -### HasTotalEntries +### HasActions -`func (o *ActionCollection) HasTotalEntries() bool` +`func (o *ActionCollection) HasActions() bool` -HasTotalEntries returns a boolean if a field has been set. +HasActions returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/ActionResource.md b/airflow/docs/ActionResource.md index 5c6d47c..f541894 100644 --- a/airflow/docs/ActionResource.md +++ b/airflow/docs/ActionResource.md @@ -1,22 +1,3 @@ - - # ActionResource ## Properties diff --git a/airflow/docs/BasicDAGRun.md b/airflow/docs/BasicDAGRun.md index 30cf805..d45a722 100644 --- a/airflow/docs/BasicDAGRun.md +++ b/airflow/docs/BasicDAGRun.md @@ -1,35 +1,16 @@ - - # BasicDAGRun ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**RunId** | Pointer to **string** | Run ID. | [optional] **DagId** | Pointer to **string** | | [optional] [readonly] +**DataIntervalEnd** | Pointer to **NullableTime** | | [optional] [readonly] +**DataIntervalStart** | Pointer to **NullableTime** | | [optional] [readonly] +**EndDate** | Pointer to **NullableTime** | | [optional] [readonly] **LogicalDate** | Pointer to **time.Time** | The logical date (previously called execution date). This is the time or interval covered by this DAG run, according to the DAG definition. The value of this field can be set only when creating the object. If you try to modify the field of an existing object, the request fails with an BAD_REQUEST error. This together with DAG_ID are a unique key. *New in version 2.2.0* | [optional] +**RunId** | Pointer to **string** | Run ID. | [optional] **StartDate** | Pointer to **NullableTime** | The start time. The time when DAG run was actually created. *Changed in version 2.1.3*&#58; Field becomes nullable. | [optional] [readonly] -**EndDate** | Pointer to **NullableTime** | | [optional] [readonly] -**DataIntervalStart** | Pointer to **NullableTime** | | [optional] [readonly] -**DataIntervalEnd** | Pointer to **NullableTime** | | [optional] [readonly] **State** | Pointer to [**DagState**](DagState.md) | | [optional] ## Methods @@ -51,31 +32,6 @@ NewBasicDAGRunWithDefaults instantiates a new BasicDAGRun object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetRunId - -`func (o *BasicDAGRun) GetRunId() string` - -GetRunId returns the RunId field if non-nil, zero value otherwise. - -### GetRunIdOk - -`func (o *BasicDAGRun) GetRunIdOk() (*string, bool)` - -GetRunIdOk returns a tuple with the RunId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRunId - -`func (o *BasicDAGRun) SetRunId(v string)` - -SetRunId sets RunId field to given value. - -### HasRunId - -`func (o *BasicDAGRun) HasRunId() bool` - -HasRunId returns a boolean if a field has been set. - ### GetDagId `func (o *BasicDAGRun) GetDagId() string` @@ -101,66 +57,76 @@ SetDagId sets DagId field to given value. HasDagId returns a boolean if a field has been set. -### GetLogicalDate +### GetDataIntervalEnd -`func (o *BasicDAGRun) GetLogicalDate() time.Time` +`func (o *BasicDAGRun) GetDataIntervalEnd() time.Time` -GetLogicalDate returns the LogicalDate field if non-nil, zero value otherwise. +GetDataIntervalEnd returns the DataIntervalEnd field if non-nil, zero value otherwise. -### GetLogicalDateOk +### GetDataIntervalEndOk -`func (o *BasicDAGRun) GetLogicalDateOk() (*time.Time, bool)` +`func (o *BasicDAGRun) GetDataIntervalEndOk() (*time.Time, bool)` -GetLogicalDateOk returns a tuple with the LogicalDate field if it's non-nil, zero value otherwise +GetDataIntervalEndOk returns a tuple with the DataIntervalEnd field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetLogicalDate +### SetDataIntervalEnd -`func (o *BasicDAGRun) SetLogicalDate(v time.Time)` +`func (o *BasicDAGRun) SetDataIntervalEnd(v time.Time)` -SetLogicalDate sets LogicalDate field to given value. +SetDataIntervalEnd sets DataIntervalEnd field to given value. -### HasLogicalDate +### HasDataIntervalEnd -`func (o *BasicDAGRun) HasLogicalDate() bool` +`func (o *BasicDAGRun) HasDataIntervalEnd() bool` -HasLogicalDate returns a boolean if a field has been set. +HasDataIntervalEnd returns a boolean if a field has been set. -### GetStartDate +### SetDataIntervalEndNil -`func (o *BasicDAGRun) GetStartDate() time.Time` +`func (o *BasicDAGRun) SetDataIntervalEndNil(b bool)` -GetStartDate returns the StartDate field if non-nil, zero value otherwise. + SetDataIntervalEndNil sets the value for DataIntervalEnd to be an explicit nil -### GetStartDateOk +### UnsetDataIntervalEnd +`func (o *BasicDAGRun) UnsetDataIntervalEnd()` -`func (o *BasicDAGRun) GetStartDateOk() (*time.Time, bool)` +UnsetDataIntervalEnd ensures that no value is present for DataIntervalEnd, not even an explicit nil +### GetDataIntervalStart -GetStartDateOk returns a tuple with the StartDate field if it's non-nil, zero value otherwise +`func (o *BasicDAGRun) GetDataIntervalStart() time.Time` + +GetDataIntervalStart returns the DataIntervalStart field if non-nil, zero value otherwise. + +### GetDataIntervalStartOk + +`func (o *BasicDAGRun) GetDataIntervalStartOk() (*time.Time, bool)` + +GetDataIntervalStartOk returns a tuple with the DataIntervalStart field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetStartDate +### SetDataIntervalStart -`func (o *BasicDAGRun) SetStartDate(v time.Time)` +`func (o *BasicDAGRun) SetDataIntervalStart(v time.Time)` -SetStartDate sets StartDate field to given value. +SetDataIntervalStart sets DataIntervalStart field to given value. -### HasStartDate +### HasDataIntervalStart -`func (o *BasicDAGRun) HasStartDate() bool` +`func (o *BasicDAGRun) HasDataIntervalStart() bool` -HasStartDate returns a boolean if a field has been set. +HasDataIntervalStart returns a boolean if a field has been set. -### SetStartDateNil +### SetDataIntervalStartNil -`func (o *BasicDAGRun) SetStartDateNil(b bool)` +`func (o *BasicDAGRun) SetDataIntervalStartNil(b bool)` - SetStartDateNil sets the value for StartDate to be an explicit nil + SetDataIntervalStartNil sets the value for DataIntervalStart to be an explicit nil -### UnsetStartDate -`func (o *BasicDAGRun) UnsetStartDate()` +### UnsetDataIntervalStart +`func (o *BasicDAGRun) UnsetDataIntervalStart()` -UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil +UnsetDataIntervalStart ensures that no value is present for DataIntervalStart, not even an explicit nil ### GetEndDate `func (o *BasicDAGRun) GetEndDate() time.Time` @@ -196,76 +162,91 @@ HasEndDate returns a boolean if a field has been set. `func (o *BasicDAGRun) UnsetEndDate()` UnsetEndDate ensures that no value is present for EndDate, not even an explicit nil -### GetDataIntervalStart +### GetLogicalDate -`func (o *BasicDAGRun) GetDataIntervalStart() time.Time` +`func (o *BasicDAGRun) GetLogicalDate() time.Time` -GetDataIntervalStart returns the DataIntervalStart field if non-nil, zero value otherwise. +GetLogicalDate returns the LogicalDate field if non-nil, zero value otherwise. -### GetDataIntervalStartOk +### GetLogicalDateOk -`func (o *BasicDAGRun) GetDataIntervalStartOk() (*time.Time, bool)` +`func (o *BasicDAGRun) GetLogicalDateOk() (*time.Time, bool)` -GetDataIntervalStartOk returns a tuple with the DataIntervalStart field if it's non-nil, zero value otherwise +GetLogicalDateOk returns a tuple with the LogicalDate field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDataIntervalStart +### SetLogicalDate -`func (o *BasicDAGRun) SetDataIntervalStart(v time.Time)` +`func (o *BasicDAGRun) SetLogicalDate(v time.Time)` -SetDataIntervalStart sets DataIntervalStart field to given value. +SetLogicalDate sets LogicalDate field to given value. -### HasDataIntervalStart +### HasLogicalDate -`func (o *BasicDAGRun) HasDataIntervalStart() bool` +`func (o *BasicDAGRun) HasLogicalDate() bool` -HasDataIntervalStart returns a boolean if a field has been set. +HasLogicalDate returns a boolean if a field has been set. -### SetDataIntervalStartNil +### GetRunId -`func (o *BasicDAGRun) SetDataIntervalStartNil(b bool)` +`func (o *BasicDAGRun) GetRunId() string` - SetDataIntervalStartNil sets the value for DataIntervalStart to be an explicit nil +GetRunId returns the RunId field if non-nil, zero value otherwise. -### UnsetDataIntervalStart -`func (o *BasicDAGRun) UnsetDataIntervalStart()` +### GetRunIdOk -UnsetDataIntervalStart ensures that no value is present for DataIntervalStart, not even an explicit nil -### GetDataIntervalEnd +`func (o *BasicDAGRun) GetRunIdOk() (*string, bool)` -`func (o *BasicDAGRun) GetDataIntervalEnd() time.Time` +GetRunIdOk returns a tuple with the RunId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. -GetDataIntervalEnd returns the DataIntervalEnd field if non-nil, zero value otherwise. +### SetRunId -### GetDataIntervalEndOk +`func (o *BasicDAGRun) SetRunId(v string)` -`func (o *BasicDAGRun) GetDataIntervalEndOk() (*time.Time, bool)` +SetRunId sets RunId field to given value. -GetDataIntervalEndOk returns a tuple with the DataIntervalEnd field if it's non-nil, zero value otherwise +### HasRunId + +`func (o *BasicDAGRun) HasRunId() bool` + +HasRunId returns a boolean if a field has been set. + +### GetStartDate + +`func (o *BasicDAGRun) GetStartDate() time.Time` + +GetStartDate returns the StartDate field if non-nil, zero value otherwise. + +### GetStartDateOk + +`func (o *BasicDAGRun) GetStartDateOk() (*time.Time, bool)` + +GetStartDateOk returns a tuple with the StartDate field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDataIntervalEnd +### SetStartDate -`func (o *BasicDAGRun) SetDataIntervalEnd(v time.Time)` +`func (o *BasicDAGRun) SetStartDate(v time.Time)` -SetDataIntervalEnd sets DataIntervalEnd field to given value. +SetStartDate sets StartDate field to given value. -### HasDataIntervalEnd +### HasStartDate -`func (o *BasicDAGRun) HasDataIntervalEnd() bool` +`func (o *BasicDAGRun) HasStartDate() bool` -HasDataIntervalEnd returns a boolean if a field has been set. +HasStartDate returns a boolean if a field has been set. -### SetDataIntervalEndNil +### SetStartDateNil -`func (o *BasicDAGRun) SetDataIntervalEndNil(b bool)` +`func (o *BasicDAGRun) SetStartDateNil(b bool)` - SetDataIntervalEndNil sets the value for DataIntervalEnd to be an explicit nil + SetStartDateNil sets the value for StartDate to be an explicit nil -### UnsetDataIntervalEnd -`func (o *BasicDAGRun) UnsetDataIntervalEnd()` +### UnsetStartDate +`func (o *BasicDAGRun) UnsetStartDate()` -UnsetDataIntervalEnd ensures that no value is present for DataIntervalEnd, not even an explicit nil +UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil ### GetState `func (o *BasicDAGRun) GetState() DagState` diff --git a/airflow/docs/ClassReference.md b/airflow/docs/ClassReference.md index 45c5d17..31d7c2d 100644 --- a/airflow/docs/ClassReference.md +++ b/airflow/docs/ClassReference.md @@ -1,30 +1,11 @@ - - # ClassReference ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ModulePath** | Pointer to **string** | | [optional] [readonly] **ClassName** | Pointer to **string** | | [optional] [readonly] +**ModulePath** | Pointer to **string** | | [optional] [readonly] ## Methods @@ -45,55 +26,55 @@ NewClassReferenceWithDefaults instantiates a new ClassReference object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetModulePath +### GetClassName -`func (o *ClassReference) GetModulePath() string` +`func (o *ClassReference) GetClassName() string` -GetModulePath returns the ModulePath field if non-nil, zero value otherwise. +GetClassName returns the ClassName field if non-nil, zero value otherwise. -### GetModulePathOk +### GetClassNameOk -`func (o *ClassReference) GetModulePathOk() (*string, bool)` +`func (o *ClassReference) GetClassNameOk() (*string, bool)` -GetModulePathOk returns a tuple with the ModulePath field if it's non-nil, zero value otherwise +GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetModulePath +### SetClassName -`func (o *ClassReference) SetModulePath(v string)` +`func (o *ClassReference) SetClassName(v string)` -SetModulePath sets ModulePath field to given value. +SetClassName sets ClassName field to given value. -### HasModulePath +### HasClassName -`func (o *ClassReference) HasModulePath() bool` +`func (o *ClassReference) HasClassName() bool` -HasModulePath returns a boolean if a field has been set. +HasClassName returns a boolean if a field has been set. -### GetClassName +### GetModulePath -`func (o *ClassReference) GetClassName() string` +`func (o *ClassReference) GetModulePath() string` -GetClassName returns the ClassName field if non-nil, zero value otherwise. +GetModulePath returns the ModulePath field if non-nil, zero value otherwise. -### GetClassNameOk +### GetModulePathOk -`func (o *ClassReference) GetClassNameOk() (*string, bool)` +`func (o *ClassReference) GetModulePathOk() (*string, bool)` -GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise +GetModulePathOk returns a tuple with the ModulePath field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetClassName +### SetModulePath -`func (o *ClassReference) SetClassName(v string)` +`func (o *ClassReference) SetModulePath(v string)` -SetClassName sets ClassName field to given value. +SetModulePath sets ModulePath field to given value. -### HasClassName +### HasModulePath -`func (o *ClassReference) HasClassName() bool` +`func (o *ClassReference) HasModulePath() bool` -HasClassName returns a boolean if a field has been set. +HasModulePath returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/ClearDagRun.md b/airflow/docs/ClearDagRun.md index 366f798..861cc83 100644 --- a/airflow/docs/ClearDagRun.md +++ b/airflow/docs/ClearDagRun.md @@ -1,22 +1,3 @@ - - # ClearDagRun ## Properties diff --git a/airflow/docs/ClearDagRun200Response.md b/airflow/docs/ClearDagRun200Response.md new file mode 100644 index 0000000..8a32af4 --- /dev/null +++ b/airflow/docs/ClearDagRun200Response.md @@ -0,0 +1,536 @@ +# ClearDagRun200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Conf** | Pointer to **map[string]interface{}** | JSON object describing additional configuration parameters. The value of this field can be set only when creating the object. If you try to modify the field of an existing object, the request fails with an BAD_REQUEST error. | [optional] +**DagId** | Pointer to **string** | | [optional] [readonly] +**DagRunId** | Pointer to **NullableString** | Run ID. The value of this field can be set only when creating the object. If you try to modify the field of an existing object, the request fails with an BAD_REQUEST error. If not provided, a value will be generated based on execution_date. If the specified dag_run_id is in use, the creation request fails with an ALREADY_EXISTS error. This together with DAG_ID are a unique key. | [optional] +**DataIntervalEnd** | Pointer to **NullableTime** | The end of the interval the DAG run covers. | [optional] +**DataIntervalStart** | Pointer to **NullableTime** | The beginning of the interval the DAG run covers. | [optional] +**EndDate** | Pointer to **NullableTime** | | [optional] [readonly] +**ExecutionDate** | Pointer to **NullableTime** | The execution date. This is the same as logical_date, kept for backwards compatibility. If both this field and logical_date are provided but with different values, the request will fail with an BAD_REQUEST error. *Changed in version 2.2.0*&#58; Field becomes nullable. *Deprecated since version 2.2.0*&#58; Use 'logical_date' instead. | [optional] +**ExternalTrigger** | Pointer to **bool** | | [optional] [readonly] +**LastSchedulingDecision** | Pointer to **NullableTime** | | [optional] [readonly] +**LogicalDate** | Pointer to **NullableTime** | The logical date (previously called execution date). This is the time or interval covered by this DAG run, according to the DAG definition. The value of this field can be set only when creating the object. If you try to modify the field of an existing object, the request fails with an BAD_REQUEST error. This together with DAG_ID are a unique key. *New in version 2.2.0* | [optional] +**Note** | Pointer to **NullableString** | Contains manually entered notes by the user about the DagRun. *New in version 2.5.0* | [optional] +**RunType** | Pointer to **string** | | [optional] [readonly] +**StartDate** | Pointer to **NullableTime** | The start time. The time when DAG run was actually created. *Changed in version 2.1.3*&#58; Field becomes nullable. | [optional] [readonly] +**State** | Pointer to [**DagState**](DagState.md) | | [optional] +**TaskInstances** | Pointer to [**[]TaskInstance**](TaskInstance.md) | | [optional] +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] + +## Methods + +### NewClearDagRun200Response + +`func NewClearDagRun200Response() *ClearDagRun200Response` + +NewClearDagRun200Response instantiates a new ClearDagRun200Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewClearDagRun200ResponseWithDefaults + +`func NewClearDagRun200ResponseWithDefaults() *ClearDagRun200Response` + +NewClearDagRun200ResponseWithDefaults instantiates a new ClearDagRun200Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetConf + +`func (o *ClearDagRun200Response) GetConf() map[string]interface{}` + +GetConf returns the Conf field if non-nil, zero value otherwise. + +### GetConfOk + +`func (o *ClearDagRun200Response) GetConfOk() (*map[string]interface{}, bool)` + +GetConfOk returns a tuple with the Conf field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConf + +`func (o *ClearDagRun200Response) SetConf(v map[string]interface{})` + +SetConf sets Conf field to given value. + +### HasConf + +`func (o *ClearDagRun200Response) HasConf() bool` + +HasConf returns a boolean if a field has been set. + +### GetDagId + +`func (o *ClearDagRun200Response) GetDagId() string` + +GetDagId returns the DagId field if non-nil, zero value otherwise. + +### GetDagIdOk + +`func (o *ClearDagRun200Response) GetDagIdOk() (*string, bool)` + +GetDagIdOk returns a tuple with the DagId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDagId + +`func (o *ClearDagRun200Response) SetDagId(v string)` + +SetDagId sets DagId field to given value. + +### HasDagId + +`func (o *ClearDagRun200Response) HasDagId() bool` + +HasDagId returns a boolean if a field has been set. + +### GetDagRunId + +`func (o *ClearDagRun200Response) GetDagRunId() string` + +GetDagRunId returns the DagRunId field if non-nil, zero value otherwise. + +### GetDagRunIdOk + +`func (o *ClearDagRun200Response) GetDagRunIdOk() (*string, bool)` + +GetDagRunIdOk returns a tuple with the DagRunId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDagRunId + +`func (o *ClearDagRun200Response) SetDagRunId(v string)` + +SetDagRunId sets DagRunId field to given value. + +### HasDagRunId + +`func (o *ClearDagRun200Response) HasDagRunId() bool` + +HasDagRunId returns a boolean if a field has been set. + +### SetDagRunIdNil + +`func (o *ClearDagRun200Response) SetDagRunIdNil(b bool)` + + SetDagRunIdNil sets the value for DagRunId to be an explicit nil + +### UnsetDagRunId +`func (o *ClearDagRun200Response) UnsetDagRunId()` + +UnsetDagRunId ensures that no value is present for DagRunId, not even an explicit nil +### GetDataIntervalEnd + +`func (o *ClearDagRun200Response) GetDataIntervalEnd() time.Time` + +GetDataIntervalEnd returns the DataIntervalEnd field if non-nil, zero value otherwise. + +### GetDataIntervalEndOk + +`func (o *ClearDagRun200Response) GetDataIntervalEndOk() (*time.Time, bool)` + +GetDataIntervalEndOk returns a tuple with the DataIntervalEnd field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDataIntervalEnd + +`func (o *ClearDagRun200Response) SetDataIntervalEnd(v time.Time)` + +SetDataIntervalEnd sets DataIntervalEnd field to given value. + +### HasDataIntervalEnd + +`func (o *ClearDagRun200Response) HasDataIntervalEnd() bool` + +HasDataIntervalEnd returns a boolean if a field has been set. + +### SetDataIntervalEndNil + +`func (o *ClearDagRun200Response) SetDataIntervalEndNil(b bool)` + + SetDataIntervalEndNil sets the value for DataIntervalEnd to be an explicit nil + +### UnsetDataIntervalEnd +`func (o *ClearDagRun200Response) UnsetDataIntervalEnd()` + +UnsetDataIntervalEnd ensures that no value is present for DataIntervalEnd, not even an explicit nil +### GetDataIntervalStart + +`func (o *ClearDagRun200Response) GetDataIntervalStart() time.Time` + +GetDataIntervalStart returns the DataIntervalStart field if non-nil, zero value otherwise. + +### GetDataIntervalStartOk + +`func (o *ClearDagRun200Response) GetDataIntervalStartOk() (*time.Time, bool)` + +GetDataIntervalStartOk returns a tuple with the DataIntervalStart field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDataIntervalStart + +`func (o *ClearDagRun200Response) SetDataIntervalStart(v time.Time)` + +SetDataIntervalStart sets DataIntervalStart field to given value. + +### HasDataIntervalStart + +`func (o *ClearDagRun200Response) HasDataIntervalStart() bool` + +HasDataIntervalStart returns a boolean if a field has been set. + +### SetDataIntervalStartNil + +`func (o *ClearDagRun200Response) SetDataIntervalStartNil(b bool)` + + SetDataIntervalStartNil sets the value for DataIntervalStart to be an explicit nil + +### UnsetDataIntervalStart +`func (o *ClearDagRun200Response) UnsetDataIntervalStart()` + +UnsetDataIntervalStart ensures that no value is present for DataIntervalStart, not even an explicit nil +### GetEndDate + +`func (o *ClearDagRun200Response) GetEndDate() time.Time` + +GetEndDate returns the EndDate field if non-nil, zero value otherwise. + +### GetEndDateOk + +`func (o *ClearDagRun200Response) GetEndDateOk() (*time.Time, bool)` + +GetEndDateOk returns a tuple with the EndDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEndDate + +`func (o *ClearDagRun200Response) SetEndDate(v time.Time)` + +SetEndDate sets EndDate field to given value. + +### HasEndDate + +`func (o *ClearDagRun200Response) HasEndDate() bool` + +HasEndDate returns a boolean if a field has been set. + +### SetEndDateNil + +`func (o *ClearDagRun200Response) SetEndDateNil(b bool)` + + SetEndDateNil sets the value for EndDate to be an explicit nil + +### UnsetEndDate +`func (o *ClearDagRun200Response) UnsetEndDate()` + +UnsetEndDate ensures that no value is present for EndDate, not even an explicit nil +### GetExecutionDate + +`func (o *ClearDagRun200Response) GetExecutionDate() time.Time` + +GetExecutionDate returns the ExecutionDate field if non-nil, zero value otherwise. + +### GetExecutionDateOk + +`func (o *ClearDagRun200Response) GetExecutionDateOk() (*time.Time, bool)` + +GetExecutionDateOk returns a tuple with the ExecutionDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExecutionDate + +`func (o *ClearDagRun200Response) SetExecutionDate(v time.Time)` + +SetExecutionDate sets ExecutionDate field to given value. + +### HasExecutionDate + +`func (o *ClearDagRun200Response) HasExecutionDate() bool` + +HasExecutionDate returns a boolean if a field has been set. + +### SetExecutionDateNil + +`func (o *ClearDagRun200Response) SetExecutionDateNil(b bool)` + + SetExecutionDateNil sets the value for ExecutionDate to be an explicit nil + +### UnsetExecutionDate +`func (o *ClearDagRun200Response) UnsetExecutionDate()` + +UnsetExecutionDate ensures that no value is present for ExecutionDate, not even an explicit nil +### GetExternalTrigger + +`func (o *ClearDagRun200Response) GetExternalTrigger() bool` + +GetExternalTrigger returns the ExternalTrigger field if non-nil, zero value otherwise. + +### GetExternalTriggerOk + +`func (o *ClearDagRun200Response) GetExternalTriggerOk() (*bool, bool)` + +GetExternalTriggerOk returns a tuple with the ExternalTrigger field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExternalTrigger + +`func (o *ClearDagRun200Response) SetExternalTrigger(v bool)` + +SetExternalTrigger sets ExternalTrigger field to given value. + +### HasExternalTrigger + +`func (o *ClearDagRun200Response) HasExternalTrigger() bool` + +HasExternalTrigger returns a boolean if a field has been set. + +### GetLastSchedulingDecision + +`func (o *ClearDagRun200Response) GetLastSchedulingDecision() time.Time` + +GetLastSchedulingDecision returns the LastSchedulingDecision field if non-nil, zero value otherwise. + +### GetLastSchedulingDecisionOk + +`func (o *ClearDagRun200Response) GetLastSchedulingDecisionOk() (*time.Time, bool)` + +GetLastSchedulingDecisionOk returns a tuple with the LastSchedulingDecision field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastSchedulingDecision + +`func (o *ClearDagRun200Response) SetLastSchedulingDecision(v time.Time)` + +SetLastSchedulingDecision sets LastSchedulingDecision field to given value. + +### HasLastSchedulingDecision + +`func (o *ClearDagRun200Response) HasLastSchedulingDecision() bool` + +HasLastSchedulingDecision returns a boolean if a field has been set. + +### SetLastSchedulingDecisionNil + +`func (o *ClearDagRun200Response) SetLastSchedulingDecisionNil(b bool)` + + SetLastSchedulingDecisionNil sets the value for LastSchedulingDecision to be an explicit nil + +### UnsetLastSchedulingDecision +`func (o *ClearDagRun200Response) UnsetLastSchedulingDecision()` + +UnsetLastSchedulingDecision ensures that no value is present for LastSchedulingDecision, not even an explicit nil +### GetLogicalDate + +`func (o *ClearDagRun200Response) GetLogicalDate() time.Time` + +GetLogicalDate returns the LogicalDate field if non-nil, zero value otherwise. + +### GetLogicalDateOk + +`func (o *ClearDagRun200Response) GetLogicalDateOk() (*time.Time, bool)` + +GetLogicalDateOk returns a tuple with the LogicalDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLogicalDate + +`func (o *ClearDagRun200Response) SetLogicalDate(v time.Time)` + +SetLogicalDate sets LogicalDate field to given value. + +### HasLogicalDate + +`func (o *ClearDagRun200Response) HasLogicalDate() bool` + +HasLogicalDate returns a boolean if a field has been set. + +### SetLogicalDateNil + +`func (o *ClearDagRun200Response) SetLogicalDateNil(b bool)` + + SetLogicalDateNil sets the value for LogicalDate to be an explicit nil + +### UnsetLogicalDate +`func (o *ClearDagRun200Response) UnsetLogicalDate()` + +UnsetLogicalDate ensures that no value is present for LogicalDate, not even an explicit nil +### GetNote + +`func (o *ClearDagRun200Response) GetNote() string` + +GetNote returns the Note field if non-nil, zero value otherwise. + +### GetNoteOk + +`func (o *ClearDagRun200Response) GetNoteOk() (*string, bool)` + +GetNoteOk returns a tuple with the Note field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNote + +`func (o *ClearDagRun200Response) SetNote(v string)` + +SetNote sets Note field to given value. + +### HasNote + +`func (o *ClearDagRun200Response) HasNote() bool` + +HasNote returns a boolean if a field has been set. + +### SetNoteNil + +`func (o *ClearDagRun200Response) SetNoteNil(b bool)` + + SetNoteNil sets the value for Note to be an explicit nil + +### UnsetNote +`func (o *ClearDagRun200Response) UnsetNote()` + +UnsetNote ensures that no value is present for Note, not even an explicit nil +### GetRunType + +`func (o *ClearDagRun200Response) GetRunType() string` + +GetRunType returns the RunType field if non-nil, zero value otherwise. + +### GetRunTypeOk + +`func (o *ClearDagRun200Response) GetRunTypeOk() (*string, bool)` + +GetRunTypeOk returns a tuple with the RunType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRunType + +`func (o *ClearDagRun200Response) SetRunType(v string)` + +SetRunType sets RunType field to given value. + +### HasRunType + +`func (o *ClearDagRun200Response) HasRunType() bool` + +HasRunType returns a boolean if a field has been set. + +### GetStartDate + +`func (o *ClearDagRun200Response) GetStartDate() time.Time` + +GetStartDate returns the StartDate field if non-nil, zero value otherwise. + +### GetStartDateOk + +`func (o *ClearDagRun200Response) GetStartDateOk() (*time.Time, bool)` + +GetStartDateOk returns a tuple with the StartDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartDate + +`func (o *ClearDagRun200Response) SetStartDate(v time.Time)` + +SetStartDate sets StartDate field to given value. + +### HasStartDate + +`func (o *ClearDagRun200Response) HasStartDate() bool` + +HasStartDate returns a boolean if a field has been set. + +### SetStartDateNil + +`func (o *ClearDagRun200Response) SetStartDateNil(b bool)` + + SetStartDateNil sets the value for StartDate to be an explicit nil + +### UnsetStartDate +`func (o *ClearDagRun200Response) UnsetStartDate()` + +UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil +### GetState + +`func (o *ClearDagRun200Response) GetState() DagState` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *ClearDagRun200Response) GetStateOk() (*DagState, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *ClearDagRun200Response) SetState(v DagState)` + +SetState sets State field to given value. + +### HasState + +`func (o *ClearDagRun200Response) HasState() bool` + +HasState returns a boolean if a field has been set. + +### GetTaskInstances + +`func (o *ClearDagRun200Response) GetTaskInstances() []TaskInstance` + +GetTaskInstances returns the TaskInstances field if non-nil, zero value otherwise. + +### GetTaskInstancesOk + +`func (o *ClearDagRun200Response) GetTaskInstancesOk() (*[]TaskInstance, bool)` + +GetTaskInstancesOk returns a tuple with the TaskInstances field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTaskInstances + +`func (o *ClearDagRun200Response) SetTaskInstances(v []TaskInstance)` + +SetTaskInstances sets TaskInstances field to given value. + +### HasTaskInstances + +`func (o *ClearDagRun200Response) HasTaskInstances() bool` + +HasTaskInstances returns a boolean if a field has been set. + +### GetTotalEntries + +`func (o *ClearDagRun200Response) GetTotalEntries() int32` + +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. + +### GetTotalEntriesOk + +`func (o *ClearDagRun200Response) GetTotalEntriesOk() (*int32, bool)` + +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalEntries + +`func (o *ClearDagRun200Response) SetTotalEntries(v int32)` + +SetTotalEntries sets TotalEntries field to given value. + +### HasTotalEntries + +`func (o *ClearDagRun200Response) HasTotalEntries() bool` + +HasTotalEntries returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/docs/ClearTaskInstances.md b/airflow/docs/ClearTaskInstances.md index 073a7aa..96e6cc4 100644 --- a/airflow/docs/ClearTaskInstances.md +++ b/airflow/docs/ClearTaskInstances.md @@ -1,42 +1,23 @@ - - # ClearTaskInstances ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**DagRunId** | Pointer to **NullableString** | The DagRun ID for this task instance | [optional] **DryRun** | Pointer to **bool** | If set, don't actually run this operation. The response will contain a list of task instances planned to be cleaned, but not modified in any way. | [optional] [default to true] -**TaskIds** | Pointer to **[]string** | A list of task ids to clear. *New in version 2.1.0* | [optional] -**StartDate** | Pointer to **string** | The minimum execution date to clear. | [optional] **EndDate** | Pointer to **string** | The maximum execution date to clear. | [optional] -**OnlyFailed** | Pointer to **bool** | Only clear failed tasks. | [optional] [default to true] -**OnlyRunning** | Pointer to **bool** | Only clear running tasks. | [optional] [default to false] -**IncludeSubdags** | Pointer to **bool** | Clear tasks in subdags and clear external tasks indicated by ExternalTaskMarker. | [optional] -**IncludeParentdag** | Pointer to **bool** | Clear tasks in the parent dag of the subdag. | [optional] -**ResetDagRuns** | Pointer to **bool** | Set state of DAG runs to RUNNING. | [optional] -**DagRunId** | Pointer to **NullableString** | The DagRun ID for this task instance | [optional] -**IncludeUpstream** | Pointer to **bool** | If set to true, upstream tasks are also affected. | [optional] [default to false] **IncludeDownstream** | Pointer to **bool** | If set to true, downstream tasks are also affected. | [optional] [default to false] **IncludeFuture** | Pointer to **bool** | If set to True, also tasks from future DAG Runs are affected. | [optional] [default to false] +**IncludeParentdag** | Pointer to **bool** | Clear tasks in the parent dag of the subdag. | [optional] **IncludePast** | Pointer to **bool** | If set to True, also tasks from past DAG Runs are affected. | [optional] [default to false] +**IncludeSubdags** | Pointer to **bool** | Clear tasks in subdags and clear external tasks indicated by ExternalTaskMarker. | [optional] +**IncludeUpstream** | Pointer to **bool** | If set to true, upstream tasks are also affected. | [optional] [default to false] +**OnlyFailed** | Pointer to **bool** | Only clear failed tasks. | [optional] [default to true] +**OnlyRunning** | Pointer to **bool** | Only clear running tasks. | [optional] [default to false] +**ResetDagRuns** | Pointer to **bool** | Set state of DAG runs to RUNNING. | [optional] +**StartDate** | Pointer to **string** | The minimum execution date to clear. | [optional] +**TaskIds** | Pointer to **[]string** | A list of task ids to clear. *New in version 2.1.0* | [optional] ## Methods @@ -57,80 +38,65 @@ NewClearTaskInstancesWithDefaults instantiates a new ClearTaskInstances object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetDryRun +### GetDagRunId -`func (o *ClearTaskInstances) GetDryRun() bool` +`func (o *ClearTaskInstances) GetDagRunId() string` -GetDryRun returns the DryRun field if non-nil, zero value otherwise. +GetDagRunId returns the DagRunId field if non-nil, zero value otherwise. -### GetDryRunOk +### GetDagRunIdOk -`func (o *ClearTaskInstances) GetDryRunOk() (*bool, bool)` +`func (o *ClearTaskInstances) GetDagRunIdOk() (*string, bool)` -GetDryRunOk returns a tuple with the DryRun field if it's non-nil, zero value otherwise +GetDagRunIdOk returns a tuple with the DagRunId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDryRun - -`func (o *ClearTaskInstances) SetDryRun(v bool)` - -SetDryRun sets DryRun field to given value. - -### HasDryRun - -`func (o *ClearTaskInstances) HasDryRun() bool` - -HasDryRun returns a boolean if a field has been set. - -### GetTaskIds - -`func (o *ClearTaskInstances) GetTaskIds() []string` - -GetTaskIds returns the TaskIds field if non-nil, zero value otherwise. +### SetDagRunId -### GetTaskIdsOk +`func (o *ClearTaskInstances) SetDagRunId(v string)` -`func (o *ClearTaskInstances) GetTaskIdsOk() (*[]string, bool)` +SetDagRunId sets DagRunId field to given value. -GetTaskIdsOk returns a tuple with the TaskIds field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. +### HasDagRunId -### SetTaskIds +`func (o *ClearTaskInstances) HasDagRunId() bool` -`func (o *ClearTaskInstances) SetTaskIds(v []string)` +HasDagRunId returns a boolean if a field has been set. -SetTaskIds sets TaskIds field to given value. +### SetDagRunIdNil -### HasTaskIds +`func (o *ClearTaskInstances) SetDagRunIdNil(b bool)` -`func (o *ClearTaskInstances) HasTaskIds() bool` + SetDagRunIdNil sets the value for DagRunId to be an explicit nil -HasTaskIds returns a boolean if a field has been set. +### UnsetDagRunId +`func (o *ClearTaskInstances) UnsetDagRunId()` -### GetStartDate +UnsetDagRunId ensures that no value is present for DagRunId, not even an explicit nil +### GetDryRun -`func (o *ClearTaskInstances) GetStartDate() string` +`func (o *ClearTaskInstances) GetDryRun() bool` -GetStartDate returns the StartDate field if non-nil, zero value otherwise. +GetDryRun returns the DryRun field if non-nil, zero value otherwise. -### GetStartDateOk +### GetDryRunOk -`func (o *ClearTaskInstances) GetStartDateOk() (*string, bool)` +`func (o *ClearTaskInstances) GetDryRunOk() (*bool, bool)` -GetStartDateOk returns a tuple with the StartDate field if it's non-nil, zero value otherwise +GetDryRunOk returns a tuple with the DryRun field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetStartDate +### SetDryRun -`func (o *ClearTaskInstances) SetStartDate(v string)` +`func (o *ClearTaskInstances) SetDryRun(v bool)` -SetStartDate sets StartDate field to given value. +SetDryRun sets DryRun field to given value. -### HasStartDate +### HasDryRun -`func (o *ClearTaskInstances) HasStartDate() bool` +`func (o *ClearTaskInstances) HasDryRun() bool` -HasStartDate returns a boolean if a field has been set. +HasDryRun returns a boolean if a field has been set. ### GetEndDate @@ -157,80 +123,55 @@ SetEndDate sets EndDate field to given value. HasEndDate returns a boolean if a field has been set. -### GetOnlyFailed - -`func (o *ClearTaskInstances) GetOnlyFailed() bool` - -GetOnlyFailed returns the OnlyFailed field if non-nil, zero value otherwise. - -### GetOnlyFailedOk - -`func (o *ClearTaskInstances) GetOnlyFailedOk() (*bool, bool)` - -GetOnlyFailedOk returns a tuple with the OnlyFailed field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOnlyFailed - -`func (o *ClearTaskInstances) SetOnlyFailed(v bool)` - -SetOnlyFailed sets OnlyFailed field to given value. - -### HasOnlyFailed - -`func (o *ClearTaskInstances) HasOnlyFailed() bool` - -HasOnlyFailed returns a boolean if a field has been set. - -### GetOnlyRunning +### GetIncludeDownstream -`func (o *ClearTaskInstances) GetOnlyRunning() bool` +`func (o *ClearTaskInstances) GetIncludeDownstream() bool` -GetOnlyRunning returns the OnlyRunning field if non-nil, zero value otherwise. +GetIncludeDownstream returns the IncludeDownstream field if non-nil, zero value otherwise. -### GetOnlyRunningOk +### GetIncludeDownstreamOk -`func (o *ClearTaskInstances) GetOnlyRunningOk() (*bool, bool)` +`func (o *ClearTaskInstances) GetIncludeDownstreamOk() (*bool, bool)` -GetOnlyRunningOk returns a tuple with the OnlyRunning field if it's non-nil, zero value otherwise +GetIncludeDownstreamOk returns a tuple with the IncludeDownstream field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetOnlyRunning +### SetIncludeDownstream -`func (o *ClearTaskInstances) SetOnlyRunning(v bool)` +`func (o *ClearTaskInstances) SetIncludeDownstream(v bool)` -SetOnlyRunning sets OnlyRunning field to given value. +SetIncludeDownstream sets IncludeDownstream field to given value. -### HasOnlyRunning +### HasIncludeDownstream -`func (o *ClearTaskInstances) HasOnlyRunning() bool` +`func (o *ClearTaskInstances) HasIncludeDownstream() bool` -HasOnlyRunning returns a boolean if a field has been set. +HasIncludeDownstream returns a boolean if a field has been set. -### GetIncludeSubdags +### GetIncludeFuture -`func (o *ClearTaskInstances) GetIncludeSubdags() bool` +`func (o *ClearTaskInstances) GetIncludeFuture() bool` -GetIncludeSubdags returns the IncludeSubdags field if non-nil, zero value otherwise. +GetIncludeFuture returns the IncludeFuture field if non-nil, zero value otherwise. -### GetIncludeSubdagsOk +### GetIncludeFutureOk -`func (o *ClearTaskInstances) GetIncludeSubdagsOk() (*bool, bool)` +`func (o *ClearTaskInstances) GetIncludeFutureOk() (*bool, bool)` -GetIncludeSubdagsOk returns a tuple with the IncludeSubdags field if it's non-nil, zero value otherwise +GetIncludeFutureOk returns a tuple with the IncludeFuture field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetIncludeSubdags +### SetIncludeFuture -`func (o *ClearTaskInstances) SetIncludeSubdags(v bool)` +`func (o *ClearTaskInstances) SetIncludeFuture(v bool)` -SetIncludeSubdags sets IncludeSubdags field to given value. +SetIncludeFuture sets IncludeFuture field to given value. -### HasIncludeSubdags +### HasIncludeFuture -`func (o *ClearTaskInstances) HasIncludeSubdags() bool` +`func (o *ClearTaskInstances) HasIncludeFuture() bool` -HasIncludeSubdags returns a boolean if a field has been set. +HasIncludeFuture returns a boolean if a field has been set. ### GetIncludeParentdag @@ -257,66 +198,56 @@ SetIncludeParentdag sets IncludeParentdag field to given value. HasIncludeParentdag returns a boolean if a field has been set. -### GetResetDagRuns +### GetIncludePast -`func (o *ClearTaskInstances) GetResetDagRuns() bool` +`func (o *ClearTaskInstances) GetIncludePast() bool` -GetResetDagRuns returns the ResetDagRuns field if non-nil, zero value otherwise. +GetIncludePast returns the IncludePast field if non-nil, zero value otherwise. -### GetResetDagRunsOk +### GetIncludePastOk -`func (o *ClearTaskInstances) GetResetDagRunsOk() (*bool, bool)` +`func (o *ClearTaskInstances) GetIncludePastOk() (*bool, bool)` -GetResetDagRunsOk returns a tuple with the ResetDagRuns field if it's non-nil, zero value otherwise +GetIncludePastOk returns a tuple with the IncludePast field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetResetDagRuns +### SetIncludePast -`func (o *ClearTaskInstances) SetResetDagRuns(v bool)` +`func (o *ClearTaskInstances) SetIncludePast(v bool)` -SetResetDagRuns sets ResetDagRuns field to given value. +SetIncludePast sets IncludePast field to given value. -### HasResetDagRuns +### HasIncludePast -`func (o *ClearTaskInstances) HasResetDagRuns() bool` +`func (o *ClearTaskInstances) HasIncludePast() bool` -HasResetDagRuns returns a boolean if a field has been set. +HasIncludePast returns a boolean if a field has been set. -### GetDagRunId +### GetIncludeSubdags -`func (o *ClearTaskInstances) GetDagRunId() string` +`func (o *ClearTaskInstances) GetIncludeSubdags() bool` -GetDagRunId returns the DagRunId field if non-nil, zero value otherwise. +GetIncludeSubdags returns the IncludeSubdags field if non-nil, zero value otherwise. -### GetDagRunIdOk +### GetIncludeSubdagsOk -`func (o *ClearTaskInstances) GetDagRunIdOk() (*string, bool)` +`func (o *ClearTaskInstances) GetIncludeSubdagsOk() (*bool, bool)` -GetDagRunIdOk returns a tuple with the DagRunId field if it's non-nil, zero value otherwise +GetIncludeSubdagsOk returns a tuple with the IncludeSubdags field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDagRunId - -`func (o *ClearTaskInstances) SetDagRunId(v string)` - -SetDagRunId sets DagRunId field to given value. - -### HasDagRunId - -`func (o *ClearTaskInstances) HasDagRunId() bool` +### SetIncludeSubdags -HasDagRunId returns a boolean if a field has been set. +`func (o *ClearTaskInstances) SetIncludeSubdags(v bool)` -### SetDagRunIdNil +SetIncludeSubdags sets IncludeSubdags field to given value. -`func (o *ClearTaskInstances) SetDagRunIdNil(b bool)` +### HasIncludeSubdags - SetDagRunIdNil sets the value for DagRunId to be an explicit nil +`func (o *ClearTaskInstances) HasIncludeSubdags() bool` -### UnsetDagRunId -`func (o *ClearTaskInstances) UnsetDagRunId()` +HasIncludeSubdags returns a boolean if a field has been set. -UnsetDagRunId ensures that no value is present for DagRunId, not even an explicit nil ### GetIncludeUpstream `func (o *ClearTaskInstances) GetIncludeUpstream() bool` @@ -342,80 +273,130 @@ SetIncludeUpstream sets IncludeUpstream field to given value. HasIncludeUpstream returns a boolean if a field has been set. -### GetIncludeDownstream +### GetOnlyFailed -`func (o *ClearTaskInstances) GetIncludeDownstream() bool` +`func (o *ClearTaskInstances) GetOnlyFailed() bool` -GetIncludeDownstream returns the IncludeDownstream field if non-nil, zero value otherwise. +GetOnlyFailed returns the OnlyFailed field if non-nil, zero value otherwise. -### GetIncludeDownstreamOk +### GetOnlyFailedOk -`func (o *ClearTaskInstances) GetIncludeDownstreamOk() (*bool, bool)` +`func (o *ClearTaskInstances) GetOnlyFailedOk() (*bool, bool)` -GetIncludeDownstreamOk returns a tuple with the IncludeDownstream field if it's non-nil, zero value otherwise +GetOnlyFailedOk returns a tuple with the OnlyFailed field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetIncludeDownstream +### SetOnlyFailed -`func (o *ClearTaskInstances) SetIncludeDownstream(v bool)` +`func (o *ClearTaskInstances) SetOnlyFailed(v bool)` -SetIncludeDownstream sets IncludeDownstream field to given value. +SetOnlyFailed sets OnlyFailed field to given value. -### HasIncludeDownstream +### HasOnlyFailed -`func (o *ClearTaskInstances) HasIncludeDownstream() bool` +`func (o *ClearTaskInstances) HasOnlyFailed() bool` -HasIncludeDownstream returns a boolean if a field has been set. +HasOnlyFailed returns a boolean if a field has been set. -### GetIncludeFuture +### GetOnlyRunning -`func (o *ClearTaskInstances) GetIncludeFuture() bool` +`func (o *ClearTaskInstances) GetOnlyRunning() bool` -GetIncludeFuture returns the IncludeFuture field if non-nil, zero value otherwise. +GetOnlyRunning returns the OnlyRunning field if non-nil, zero value otherwise. -### GetIncludeFutureOk +### GetOnlyRunningOk -`func (o *ClearTaskInstances) GetIncludeFutureOk() (*bool, bool)` +`func (o *ClearTaskInstances) GetOnlyRunningOk() (*bool, bool)` -GetIncludeFutureOk returns a tuple with the IncludeFuture field if it's non-nil, zero value otherwise +GetOnlyRunningOk returns a tuple with the OnlyRunning field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetIncludeFuture +### SetOnlyRunning -`func (o *ClearTaskInstances) SetIncludeFuture(v bool)` +`func (o *ClearTaskInstances) SetOnlyRunning(v bool)` -SetIncludeFuture sets IncludeFuture field to given value. +SetOnlyRunning sets OnlyRunning field to given value. -### HasIncludeFuture +### HasOnlyRunning -`func (o *ClearTaskInstances) HasIncludeFuture() bool` +`func (o *ClearTaskInstances) HasOnlyRunning() bool` -HasIncludeFuture returns a boolean if a field has been set. +HasOnlyRunning returns a boolean if a field has been set. -### GetIncludePast +### GetResetDagRuns -`func (o *ClearTaskInstances) GetIncludePast() bool` +`func (o *ClearTaskInstances) GetResetDagRuns() bool` -GetIncludePast returns the IncludePast field if non-nil, zero value otherwise. +GetResetDagRuns returns the ResetDagRuns field if non-nil, zero value otherwise. -### GetIncludePastOk +### GetResetDagRunsOk -`func (o *ClearTaskInstances) GetIncludePastOk() (*bool, bool)` +`func (o *ClearTaskInstances) GetResetDagRunsOk() (*bool, bool)` -GetIncludePastOk returns a tuple with the IncludePast field if it's non-nil, zero value otherwise +GetResetDagRunsOk returns a tuple with the ResetDagRuns field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetIncludePast +### SetResetDagRuns -`func (o *ClearTaskInstances) SetIncludePast(v bool)` +`func (o *ClearTaskInstances) SetResetDagRuns(v bool)` -SetIncludePast sets IncludePast field to given value. +SetResetDagRuns sets ResetDagRuns field to given value. -### HasIncludePast +### HasResetDagRuns -`func (o *ClearTaskInstances) HasIncludePast() bool` +`func (o *ClearTaskInstances) HasResetDagRuns() bool` -HasIncludePast returns a boolean if a field has been set. +HasResetDagRuns returns a boolean if a field has been set. + +### GetStartDate + +`func (o *ClearTaskInstances) GetStartDate() string` + +GetStartDate returns the StartDate field if non-nil, zero value otherwise. + +### GetStartDateOk + +`func (o *ClearTaskInstances) GetStartDateOk() (*string, bool)` + +GetStartDateOk returns a tuple with the StartDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartDate + +`func (o *ClearTaskInstances) SetStartDate(v string)` + +SetStartDate sets StartDate field to given value. + +### HasStartDate + +`func (o *ClearTaskInstances) HasStartDate() bool` + +HasStartDate returns a boolean if a field has been set. + +### GetTaskIds + +`func (o *ClearTaskInstances) GetTaskIds() []string` + +GetTaskIds returns the TaskIds field if non-nil, zero value otherwise. + +### GetTaskIdsOk + +`func (o *ClearTaskInstances) GetTaskIdsOk() (*[]string, bool)` + +GetTaskIdsOk returns a tuple with the TaskIds field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTaskIds + +`func (o *ClearTaskInstances) SetTaskIds(v []string)` + +SetTaskIds sets TaskIds field to given value. + +### HasTaskIds + +`func (o *ClearTaskInstances) HasTaskIds() bool` + +HasTaskIds returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/CollectionInfo.md b/airflow/docs/CollectionInfo.md index a5dcbca..20088ca 100644 --- a/airflow/docs/CollectionInfo.md +++ b/airflow/docs/CollectionInfo.md @@ -1,29 +1,10 @@ - - # CollectionInfo ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TotalEntries** | Pointer to **int32** | Count of objects in the current result set. | [optional] +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] ## Methods diff --git a/airflow/docs/Config.md b/airflow/docs/Config.md index 156c460..c82b82f 100644 --- a/airflow/docs/Config.md +++ b/airflow/docs/Config.md @@ -1,22 +1,3 @@ - - # Config ## Properties diff --git a/airflow/docs/ConfigApi.md b/airflow/docs/ConfigApi.md index 4d5af02..b066f4a 100644 --- a/airflow/docs/ConfigApi.md +++ b/airflow/docs/ConfigApi.md @@ -1,35 +1,17 @@ - - -# \ConfigApi - -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**GetConfig**](ConfigApi.md#GetConfig) | **Get** /config | Get current configuration +[**GetConfig**](ConfigAPI.md#GetConfig) | **Get** /config | Get current configuration +[**GetValue**](ConfigAPI.md#GetValue) | **Get** /config/section/{section}/option/{option} | Get a option from configuration ## GetConfig -> Config GetConfig(ctx).Execute() +> Config GetConfig(ctx).Section(section).Execute() Get current configuration @@ -39,42 +21,118 @@ Get current configuration package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.ConfigApi.GetConfig(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ConfigApi.GetConfig``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetConfig`: Config - fmt.Fprintf(os.Stdout, "Response from `ConfigApi.GetConfig`: %v\n", resp) + section := "section_example" // string | If given, only return config of this section. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ConfigAPI.GetConfig(context.Background()).Section(section).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ConfigAPI.GetConfig``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetConfig`: Config + fmt.Fprintf(os.Stdout, "Response from `ConfigAPI.GetConfig`: %v\n", resp) } ``` ### Path Parameters -This endpoint does not need any parameter. + ### Other Parameters Other parameters are passed through a pointer to a apiGetConfigRequest struct via the builder pattern +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **section** | **string** | If given, only return config of this section. | + +### Return type + +[**Config**](Config.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetValue + +> Config GetValue(ctx, section, option).Execute() + +Get a option from configuration + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./airflow" +) + +func main() { + section := "section_example" // string | + option := "option_example" // string | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ConfigAPI.GetValue(context.Background(), section, option).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ConfigAPI.GetValue``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetValue`: Config + fmt.Fprintf(os.Stdout, "Response from `ConfigAPI.GetValue`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**section** | **string** | | +**option** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetValueRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + ### Return type [**Config**](Config.md) ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers diff --git a/airflow/docs/ConfigOption.md b/airflow/docs/ConfigOption.md index 557186d..64753b9 100644 --- a/airflow/docs/ConfigOption.md +++ b/airflow/docs/ConfigOption.md @@ -1,22 +1,3 @@ - - # ConfigOption ## Properties diff --git a/airflow/docs/ConfigSection.md b/airflow/docs/ConfigSection.md index 8edb920..bdec152 100644 --- a/airflow/docs/ConfigSection.md +++ b/airflow/docs/ConfigSection.md @@ -1,22 +1,3 @@ - - # ConfigSection ## Properties diff --git a/airflow/docs/Connection.md b/airflow/docs/Connection.md index 3ac0de2..7b643ae 100644 --- a/airflow/docs/Connection.md +++ b/airflow/docs/Connection.md @@ -1,37 +1,18 @@ - - # Connection ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ConnectionId** | Pointer to **string** | The connection ID. | [optional] **ConnType** | Pointer to **string** | The connection type. | [optional] +**ConnectionId** | Pointer to **string** | The connection ID. | [optional] **Description** | Pointer to **NullableString** | The description of the connection. | [optional] **Host** | Pointer to **NullableString** | Host of the connection. | [optional] **Login** | Pointer to **NullableString** | Login of the connection. | [optional] -**Schema** | Pointer to **NullableString** | Schema of the connection. | [optional] **Port** | Pointer to **NullableInt32** | Port of the connection. | [optional] -**Password** | Pointer to **string** | Password of the connection. | [optional] +**Schema** | Pointer to **NullableString** | Schema of the connection. | [optional] **Extra** | Pointer to **NullableString** | Other values that cannot be put into another field, e.g. RSA keys. | [optional] +**Password** | Pointer to **string** | Password of the connection. | [optional] ## Methods @@ -52,55 +33,55 @@ NewConnectionWithDefaults instantiates a new Connection object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetConnectionId +### GetConnType -`func (o *Connection) GetConnectionId() string` +`func (o *Connection) GetConnType() string` -GetConnectionId returns the ConnectionId field if non-nil, zero value otherwise. +GetConnType returns the ConnType field if non-nil, zero value otherwise. -### GetConnectionIdOk +### GetConnTypeOk -`func (o *Connection) GetConnectionIdOk() (*string, bool)` +`func (o *Connection) GetConnTypeOk() (*string, bool)` -GetConnectionIdOk returns a tuple with the ConnectionId field if it's non-nil, zero value otherwise +GetConnTypeOk returns a tuple with the ConnType field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetConnectionId +### SetConnType -`func (o *Connection) SetConnectionId(v string)` +`func (o *Connection) SetConnType(v string)` -SetConnectionId sets ConnectionId field to given value. +SetConnType sets ConnType field to given value. -### HasConnectionId +### HasConnType -`func (o *Connection) HasConnectionId() bool` +`func (o *Connection) HasConnType() bool` -HasConnectionId returns a boolean if a field has been set. +HasConnType returns a boolean if a field has been set. -### GetConnType +### GetConnectionId -`func (o *Connection) GetConnType() string` +`func (o *Connection) GetConnectionId() string` -GetConnType returns the ConnType field if non-nil, zero value otherwise. +GetConnectionId returns the ConnectionId field if non-nil, zero value otherwise. -### GetConnTypeOk +### GetConnectionIdOk -`func (o *Connection) GetConnTypeOk() (*string, bool)` +`func (o *Connection) GetConnectionIdOk() (*string, bool)` -GetConnTypeOk returns a tuple with the ConnType field if it's non-nil, zero value otherwise +GetConnectionIdOk returns a tuple with the ConnectionId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetConnType +### SetConnectionId -`func (o *Connection) SetConnType(v string)` +`func (o *Connection) SetConnectionId(v string)` -SetConnType sets ConnType field to given value. +SetConnectionId sets ConnectionId field to given value. -### HasConnType +### HasConnectionId -`func (o *Connection) HasConnType() bool` +`func (o *Connection) HasConnectionId() bool` -HasConnType returns a boolean if a field has been set. +HasConnectionId returns a boolean if a field has been set. ### GetDescription @@ -207,41 +188,6 @@ HasLogin returns a boolean if a field has been set. `func (o *Connection) UnsetLogin()` UnsetLogin ensures that no value is present for Login, not even an explicit nil -### GetSchema - -`func (o *Connection) GetSchema() string` - -GetSchema returns the Schema field if non-nil, zero value otherwise. - -### GetSchemaOk - -`func (o *Connection) GetSchemaOk() (*string, bool)` - -GetSchemaOk returns a tuple with the Schema field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSchema - -`func (o *Connection) SetSchema(v string)` - -SetSchema sets Schema field to given value. - -### HasSchema - -`func (o *Connection) HasSchema() bool` - -HasSchema returns a boolean if a field has been set. - -### SetSchemaNil - -`func (o *Connection) SetSchemaNil(b bool)` - - SetSchemaNil sets the value for Schema to be an explicit nil - -### UnsetSchema -`func (o *Connection) UnsetSchema()` - -UnsetSchema ensures that no value is present for Schema, not even an explicit nil ### GetPort `func (o *Connection) GetPort() int32` @@ -277,31 +223,41 @@ HasPort returns a boolean if a field has been set. `func (o *Connection) UnsetPort()` UnsetPort ensures that no value is present for Port, not even an explicit nil -### GetPassword +### GetSchema -`func (o *Connection) GetPassword() string` +`func (o *Connection) GetSchema() string` -GetPassword returns the Password field if non-nil, zero value otherwise. +GetSchema returns the Schema field if non-nil, zero value otherwise. -### GetPasswordOk +### GetSchemaOk -`func (o *Connection) GetPasswordOk() (*string, bool)` +`func (o *Connection) GetSchemaOk() (*string, bool)` -GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +GetSchemaOk returns a tuple with the Schema field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetPassword +### SetSchema -`func (o *Connection) SetPassword(v string)` +`func (o *Connection) SetSchema(v string)` -SetPassword sets Password field to given value. +SetSchema sets Schema field to given value. -### HasPassword +### HasSchema -`func (o *Connection) HasPassword() bool` +`func (o *Connection) HasSchema() bool` -HasPassword returns a boolean if a field has been set. +HasSchema returns a boolean if a field has been set. + +### SetSchemaNil + +`func (o *Connection) SetSchemaNil(b bool)` + + SetSchemaNil sets the value for Schema to be an explicit nil +### UnsetSchema +`func (o *Connection) UnsetSchema()` + +UnsetSchema ensures that no value is present for Schema, not even an explicit nil ### GetExtra `func (o *Connection) GetExtra() string` @@ -337,6 +293,31 @@ HasExtra returns a boolean if a field has been set. `func (o *Connection) UnsetExtra()` UnsetExtra ensures that no value is present for Extra, not even an explicit nil +### GetPassword + +`func (o *Connection) GetPassword() string` + +GetPassword returns the Password field if non-nil, zero value otherwise. + +### GetPasswordOk + +`func (o *Connection) GetPasswordOk() (*string, bool)` + +GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPassword + +`func (o *Connection) SetPassword(v string)` + +SetPassword sets Password field to given value. + +### HasPassword + +`func (o *Connection) HasPassword() bool` + +HasPassword returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/ConnectionApi.md b/airflow/docs/ConnectionApi.md index edc5524..56c62ae 100644 --- a/airflow/docs/ConnectionApi.md +++ b/airflow/docs/ConnectionApi.md @@ -1,34 +1,15 @@ - - -# \ConnectionApi - -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**DeleteConnection**](ConnectionApi.md#DeleteConnection) | **Delete** /connections/{connection_id} | Delete a connection -[**GetConnection**](ConnectionApi.md#GetConnection) | **Get** /connections/{connection_id} | Get a connection -[**GetConnections**](ConnectionApi.md#GetConnections) | **Get** /connections | List connections -[**PatchConnection**](ConnectionApi.md#PatchConnection) | **Patch** /connections/{connection_id} | Update a connection -[**PostConnection**](ConnectionApi.md#PostConnection) | **Post** /connections | Create a connection -[**TestConnection**](ConnectionApi.md#TestConnection) | **Post** /connections/test | Test a connection +[**DeleteConnection**](ConnectionAPI.md#DeleteConnection) | **Delete** /connections/{connection_id} | Delete a connection +[**GetConnection**](ConnectionAPI.md#GetConnection) | **Get** /connections/{connection_id} | Get a connection +[**GetConnections**](ConnectionAPI.md#GetConnections) | **Get** /connections | List connections +[**PatchConnection**](ConnectionAPI.md#PatchConnection) | **Patch** /connections/{connection_id} | Update a connection +[**PostConnection**](ConnectionAPI.md#PostConnection) | **Post** /connections | Create a connection +[**TestConnection**](ConnectionAPI.md#TestConnection) | **Post** /connections/test | Test a connection @@ -44,22 +25,22 @@ Delete a connection package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - connectionId := "connectionId_example" // string | The connection ID. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.ConnectionApi.DeleteConnection(context.Background(), connectionId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ConnectionApi.DeleteConnection``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + connectionId := "connectionId_example" // string | The connection ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.ConnectionAPI.DeleteConnection(context.Background(), connectionId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ConnectionAPI.DeleteConnection``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -86,7 +67,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -110,24 +91,24 @@ Get a connection package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - connectionId := "connectionId_example" // string | The connection ID. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.ConnectionApi.GetConnection(context.Background(), connectionId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ConnectionApi.GetConnection``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetConnection`: Connection - fmt.Fprintf(os.Stdout, "Response from `ConnectionApi.GetConnection`: %v\n", resp) + connectionId := "connectionId_example" // string | The connection ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ConnectionAPI.GetConnection(context.Background(), connectionId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ConnectionAPI.GetConnection``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetConnection`: Connection + fmt.Fprintf(os.Stdout, "Response from `ConnectionAPI.GetConnection`: %v\n", resp) } ``` @@ -154,7 +135,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -178,26 +159,26 @@ List connections package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) - offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) - orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.ConnectionApi.GetConnections(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ConnectionApi.GetConnections``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetConnections`: ConnectionCollection - fmt.Fprintf(os.Stdout, "Response from `ConnectionApi.GetConnections`: %v\n", resp) + limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) + offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) + orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ConnectionAPI.GetConnections(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ConnectionAPI.GetConnections``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetConnections`: ConnectionCollection + fmt.Fprintf(os.Stdout, "Response from `ConnectionAPI.GetConnections`: %v\n", resp) } ``` @@ -222,7 +203,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -246,26 +227,26 @@ Update a connection package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - connectionId := "connectionId_example" // string | The connection ID. - connection := *openapiclient.NewConnection() // Connection | - updateMask := []string{"Inner_example"} // []string | The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.ConnectionApi.PatchConnection(context.Background(), connectionId).Connection(connection).UpdateMask(updateMask).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ConnectionApi.PatchConnection``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PatchConnection`: Connection - fmt.Fprintf(os.Stdout, "Response from `ConnectionApi.PatchConnection`: %v\n", resp) + connectionId := "connectionId_example" // string | The connection ID. + connection := *openapiclient.NewConnection() // Connection | + updateMask := []string{"Inner_example"} // []string | The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ConnectionAPI.PatchConnection(context.Background(), connectionId).Connection(connection).UpdateMask(updateMask).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ConnectionAPI.PatchConnection``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PatchConnection`: Connection + fmt.Fprintf(os.Stdout, "Response from `ConnectionAPI.PatchConnection`: %v\n", resp) } ``` @@ -294,7 +275,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -318,24 +299,24 @@ Create a connection package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - connection := *openapiclient.NewConnection() // Connection | - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.ConnectionApi.PostConnection(context.Background()).Connection(connection).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ConnectionApi.PostConnection``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PostConnection`: Connection - fmt.Fprintf(os.Stdout, "Response from `ConnectionApi.PostConnection`: %v\n", resp) + connection := *openapiclient.NewConnection() // Connection | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ConnectionAPI.PostConnection(context.Background()).Connection(connection).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ConnectionAPI.PostConnection``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PostConnection`: Connection + fmt.Fprintf(os.Stdout, "Response from `ConnectionAPI.PostConnection`: %v\n", resp) } ``` @@ -358,7 +339,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -384,24 +365,24 @@ Test a connection package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - connection := *openapiclient.NewConnection() // Connection | - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.ConnectionApi.TestConnection(context.Background()).Connection(connection).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ConnectionApi.TestConnection``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestConnection`: ConnectionTest - fmt.Fprintf(os.Stdout, "Response from `ConnectionApi.TestConnection`: %v\n", resp) + connection := *openapiclient.NewConnection() // Connection | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ConnectionAPI.TestConnection(context.Background()).Connection(connection).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ConnectionAPI.TestConnection``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestConnection`: ConnectionTest + fmt.Fprintf(os.Stdout, "Response from `ConnectionAPI.TestConnection`: %v\n", resp) } ``` @@ -424,7 +405,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers diff --git a/airflow/docs/ConnectionCollection.md b/airflow/docs/ConnectionCollection.md index 8779da4..c715b47 100644 --- a/airflow/docs/ConnectionCollection.md +++ b/airflow/docs/ConnectionCollection.md @@ -1,30 +1,11 @@ - - # ConnectionCollection ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] **Connections** | Pointer to [**[]ConnectionCollectionItem**](ConnectionCollectionItem.md) | | [optional] -**TotalEntries** | Pointer to **int32** | Count of objects in the current result set. | [optional] ## Methods @@ -45,55 +26,55 @@ NewConnectionCollectionWithDefaults instantiates a new ConnectionCollection obje This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetConnections +### GetTotalEntries -`func (o *ConnectionCollection) GetConnections() []ConnectionCollectionItem` +`func (o *ConnectionCollection) GetTotalEntries() int32` -GetConnections returns the Connections field if non-nil, zero value otherwise. +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. -### GetConnectionsOk +### GetTotalEntriesOk -`func (o *ConnectionCollection) GetConnectionsOk() (*[]ConnectionCollectionItem, bool)` +`func (o *ConnectionCollection) GetTotalEntriesOk() (*int32, bool)` -GetConnectionsOk returns a tuple with the Connections field if it's non-nil, zero value otherwise +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetConnections +### SetTotalEntries -`func (o *ConnectionCollection) SetConnections(v []ConnectionCollectionItem)` +`func (o *ConnectionCollection) SetTotalEntries(v int32)` -SetConnections sets Connections field to given value. +SetTotalEntries sets TotalEntries field to given value. -### HasConnections +### HasTotalEntries -`func (o *ConnectionCollection) HasConnections() bool` +`func (o *ConnectionCollection) HasTotalEntries() bool` -HasConnections returns a boolean if a field has been set. +HasTotalEntries returns a boolean if a field has been set. -### GetTotalEntries +### GetConnections -`func (o *ConnectionCollection) GetTotalEntries() int32` +`func (o *ConnectionCollection) GetConnections() []ConnectionCollectionItem` -GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. +GetConnections returns the Connections field if non-nil, zero value otherwise. -### GetTotalEntriesOk +### GetConnectionsOk -`func (o *ConnectionCollection) GetTotalEntriesOk() (*int32, bool)` +`func (o *ConnectionCollection) GetConnectionsOk() (*[]ConnectionCollectionItem, bool)` -GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +GetConnectionsOk returns a tuple with the Connections field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTotalEntries +### SetConnections -`func (o *ConnectionCollection) SetTotalEntries(v int32)` +`func (o *ConnectionCollection) SetConnections(v []ConnectionCollectionItem)` -SetTotalEntries sets TotalEntries field to given value. +SetConnections sets Connections field to given value. -### HasTotalEntries +### HasConnections -`func (o *ConnectionCollection) HasTotalEntries() bool` +`func (o *ConnectionCollection) HasConnections() bool` -HasTotalEntries returns a boolean if a field has been set. +HasConnections returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/ConnectionCollectionItem.md b/airflow/docs/ConnectionCollectionItem.md index ec03e36..92c5df8 100644 --- a/airflow/docs/ConnectionCollectionItem.md +++ b/airflow/docs/ConnectionCollectionItem.md @@ -1,35 +1,16 @@ - - # ConnectionCollectionItem ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ConnectionId** | Pointer to **string** | The connection ID. | [optional] **ConnType** | Pointer to **string** | The connection type. | [optional] +**ConnectionId** | Pointer to **string** | The connection ID. | [optional] **Description** | Pointer to **NullableString** | The description of the connection. | [optional] **Host** | Pointer to **NullableString** | Host of the connection. | [optional] **Login** | Pointer to **NullableString** | Login of the connection. | [optional] -**Schema** | Pointer to **NullableString** | Schema of the connection. | [optional] **Port** | Pointer to **NullableInt32** | Port of the connection. | [optional] +**Schema** | Pointer to **NullableString** | Schema of the connection. | [optional] ## Methods @@ -50,55 +31,55 @@ NewConnectionCollectionItemWithDefaults instantiates a new ConnectionCollectionI This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetConnectionId +### GetConnType -`func (o *ConnectionCollectionItem) GetConnectionId() string` +`func (o *ConnectionCollectionItem) GetConnType() string` -GetConnectionId returns the ConnectionId field if non-nil, zero value otherwise. +GetConnType returns the ConnType field if non-nil, zero value otherwise. -### GetConnectionIdOk +### GetConnTypeOk -`func (o *ConnectionCollectionItem) GetConnectionIdOk() (*string, bool)` +`func (o *ConnectionCollectionItem) GetConnTypeOk() (*string, bool)` -GetConnectionIdOk returns a tuple with the ConnectionId field if it's non-nil, zero value otherwise +GetConnTypeOk returns a tuple with the ConnType field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetConnectionId +### SetConnType -`func (o *ConnectionCollectionItem) SetConnectionId(v string)` +`func (o *ConnectionCollectionItem) SetConnType(v string)` -SetConnectionId sets ConnectionId field to given value. +SetConnType sets ConnType field to given value. -### HasConnectionId +### HasConnType -`func (o *ConnectionCollectionItem) HasConnectionId() bool` +`func (o *ConnectionCollectionItem) HasConnType() bool` -HasConnectionId returns a boolean if a field has been set. +HasConnType returns a boolean if a field has been set. -### GetConnType +### GetConnectionId -`func (o *ConnectionCollectionItem) GetConnType() string` +`func (o *ConnectionCollectionItem) GetConnectionId() string` -GetConnType returns the ConnType field if non-nil, zero value otherwise. +GetConnectionId returns the ConnectionId field if non-nil, zero value otherwise. -### GetConnTypeOk +### GetConnectionIdOk -`func (o *ConnectionCollectionItem) GetConnTypeOk() (*string, bool)` +`func (o *ConnectionCollectionItem) GetConnectionIdOk() (*string, bool)` -GetConnTypeOk returns a tuple with the ConnType field if it's non-nil, zero value otherwise +GetConnectionIdOk returns a tuple with the ConnectionId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetConnType +### SetConnectionId -`func (o *ConnectionCollectionItem) SetConnType(v string)` +`func (o *ConnectionCollectionItem) SetConnectionId(v string)` -SetConnType sets ConnType field to given value. +SetConnectionId sets ConnectionId field to given value. -### HasConnType +### HasConnectionId -`func (o *ConnectionCollectionItem) HasConnType() bool` +`func (o *ConnectionCollectionItem) HasConnectionId() bool` -HasConnType returns a boolean if a field has been set. +HasConnectionId returns a boolean if a field has been set. ### GetDescription @@ -205,41 +186,6 @@ HasLogin returns a boolean if a field has been set. `func (o *ConnectionCollectionItem) UnsetLogin()` UnsetLogin ensures that no value is present for Login, not even an explicit nil -### GetSchema - -`func (o *ConnectionCollectionItem) GetSchema() string` - -GetSchema returns the Schema field if non-nil, zero value otherwise. - -### GetSchemaOk - -`func (o *ConnectionCollectionItem) GetSchemaOk() (*string, bool)` - -GetSchemaOk returns a tuple with the Schema field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSchema - -`func (o *ConnectionCollectionItem) SetSchema(v string)` - -SetSchema sets Schema field to given value. - -### HasSchema - -`func (o *ConnectionCollectionItem) HasSchema() bool` - -HasSchema returns a boolean if a field has been set. - -### SetSchemaNil - -`func (o *ConnectionCollectionItem) SetSchemaNil(b bool)` - - SetSchemaNil sets the value for Schema to be an explicit nil - -### UnsetSchema -`func (o *ConnectionCollectionItem) UnsetSchema()` - -UnsetSchema ensures that no value is present for Schema, not even an explicit nil ### GetPort `func (o *ConnectionCollectionItem) GetPort() int32` @@ -275,6 +221,41 @@ HasPort returns a boolean if a field has been set. `func (o *ConnectionCollectionItem) UnsetPort()` UnsetPort ensures that no value is present for Port, not even an explicit nil +### GetSchema + +`func (o *ConnectionCollectionItem) GetSchema() string` + +GetSchema returns the Schema field if non-nil, zero value otherwise. + +### GetSchemaOk + +`func (o *ConnectionCollectionItem) GetSchemaOk() (*string, bool)` + +GetSchemaOk returns a tuple with the Schema field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSchema + +`func (o *ConnectionCollectionItem) SetSchema(v string)` + +SetSchema sets Schema field to given value. + +### HasSchema + +`func (o *ConnectionCollectionItem) HasSchema() bool` + +HasSchema returns a boolean if a field has been set. + +### SetSchemaNil + +`func (o *ConnectionCollectionItem) SetSchemaNil(b bool)` + + SetSchemaNil sets the value for Schema to be an explicit nil + +### UnsetSchema +`func (o *ConnectionCollectionItem) UnsetSchema()` + +UnsetSchema ensures that no value is present for Schema, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/ConnectionTest.md b/airflow/docs/ConnectionTest.md index da001ac..d1bfe5d 100644 --- a/airflow/docs/ConnectionTest.md +++ b/airflow/docs/ConnectionTest.md @@ -1,30 +1,11 @@ - - # ConnectionTest ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Status** | Pointer to **bool** | The status of the request. | [optional] **Message** | Pointer to **string** | The success or failure message of the request. | [optional] +**Status** | Pointer to **bool** | The status of the request. | [optional] ## Methods @@ -45,55 +26,55 @@ NewConnectionTestWithDefaults instantiates a new ConnectionTest object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetStatus +### GetMessage -`func (o *ConnectionTest) GetStatus() bool` +`func (o *ConnectionTest) GetMessage() string` -GetStatus returns the Status field if non-nil, zero value otherwise. +GetMessage returns the Message field if non-nil, zero value otherwise. -### GetStatusOk +### GetMessageOk -`func (o *ConnectionTest) GetStatusOk() (*bool, bool)` +`func (o *ConnectionTest) GetMessageOk() (*string, bool)` -GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetStatus +### SetMessage -`func (o *ConnectionTest) SetStatus(v bool)` +`func (o *ConnectionTest) SetMessage(v string)` -SetStatus sets Status field to given value. +SetMessage sets Message field to given value. -### HasStatus +### HasMessage -`func (o *ConnectionTest) HasStatus() bool` +`func (o *ConnectionTest) HasMessage() bool` -HasStatus returns a boolean if a field has been set. +HasMessage returns a boolean if a field has been set. -### GetMessage +### GetStatus -`func (o *ConnectionTest) GetMessage() string` +`func (o *ConnectionTest) GetStatus() bool` -GetMessage returns the Message field if non-nil, zero value otherwise. +GetStatus returns the Status field if non-nil, zero value otherwise. -### GetMessageOk +### GetStatusOk -`func (o *ConnectionTest) GetMessageOk() (*string, bool)` +`func (o *ConnectionTest) GetStatusOk() (*bool, bool)` -GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetMessage +### SetStatus -`func (o *ConnectionTest) SetMessage(v string)` +`func (o *ConnectionTest) SetStatus(v bool)` -SetMessage sets Message field to given value. +SetStatus sets Status field to given value. -### HasMessage +### HasStatus -`func (o *ConnectionTest) HasMessage() bool` +`func (o *ConnectionTest) HasStatus() bool` -HasMessage returns a boolean if a field has been set. +HasStatus returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/CreateDatasetEvent.md b/airflow/docs/CreateDatasetEvent.md new file mode 100644 index 0000000..146e748 --- /dev/null +++ b/airflow/docs/CreateDatasetEvent.md @@ -0,0 +1,87 @@ +# CreateDatasetEvent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DatasetUri** | **string** | The URI of the dataset | +**Extra** | Pointer to **map[string]interface{}** | The dataset event extra | [optional] + +## Methods + +### NewCreateDatasetEvent + +`func NewCreateDatasetEvent(datasetUri string, ) *CreateDatasetEvent` + +NewCreateDatasetEvent instantiates a new CreateDatasetEvent object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateDatasetEventWithDefaults + +`func NewCreateDatasetEventWithDefaults() *CreateDatasetEvent` + +NewCreateDatasetEventWithDefaults instantiates a new CreateDatasetEvent object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDatasetUri + +`func (o *CreateDatasetEvent) GetDatasetUri() string` + +GetDatasetUri returns the DatasetUri field if non-nil, zero value otherwise. + +### GetDatasetUriOk + +`func (o *CreateDatasetEvent) GetDatasetUriOk() (*string, bool)` + +GetDatasetUriOk returns a tuple with the DatasetUri field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDatasetUri + +`func (o *CreateDatasetEvent) SetDatasetUri(v string)` + +SetDatasetUri sets DatasetUri field to given value. + + +### GetExtra + +`func (o *CreateDatasetEvent) GetExtra() map[string]interface{}` + +GetExtra returns the Extra field if non-nil, zero value otherwise. + +### GetExtraOk + +`func (o *CreateDatasetEvent) GetExtraOk() (*map[string]interface{}, bool)` + +GetExtraOk returns a tuple with the Extra field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExtra + +`func (o *CreateDatasetEvent) SetExtra(v map[string]interface{})` + +SetExtra sets Extra field to given value. + +### HasExtra + +`func (o *CreateDatasetEvent) HasExtra() bool` + +HasExtra returns a boolean if a field has been set. + +### SetExtraNil + +`func (o *CreateDatasetEvent) SetExtraNil(b bool)` + + SetExtraNil sets the value for Extra to be an explicit nil + +### UnsetExtra +`func (o *CreateDatasetEvent) UnsetExtra()` + +UnsetExtra ensures that no value is present for Extra, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/docs/CronExpression.md b/airflow/docs/CronExpression.md index bc3ebc7..39bd82e 100644 --- a/airflow/docs/CronExpression.md +++ b/airflow/docs/CronExpression.md @@ -1,22 +1,3 @@ - - # CronExpression ## Properties diff --git a/airflow/docs/DAG.md b/airflow/docs/DAG.md index 818b053..981d060 100644 --- a/airflow/docs/DAG.md +++ b/airflow/docs/DAG.md @@ -1,54 +1,37 @@ - - # DAG ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**DagDisplayName** | Pointer to **string** | Human centric display text for the DAG. *New in version 2.9.0* | [optional] [readonly] **DagId** | Pointer to **string** | The ID of the DAG. | [optional] [readonly] -**RootDagId** | Pointer to **NullableString** | If the DAG is SubDAG then it is the top level DAG identifier. Otherwise, null. | [optional] [readonly] -**IsPaused** | Pointer to **NullableBool** | Whether the DAG is paused. | [optional] +**DefaultView** | Pointer to **NullableString** | Default view of the DAG inside the webserver *New in version 2.3.0* | [optional] [readonly] +**Description** | Pointer to **NullableString** | User-provided DAG description, which can consist of several sentences or paragraphs that describe DAG contents. | [optional] [readonly] +**FileToken** | Pointer to **string** | The key containing the encrypted path to the file. Encryption and decryption take place only on the server. This prevents the client from reading an non-DAG file. This also ensures API extensibility, because the format of encrypted data may change. | [optional] [readonly] +**Fileloc** | Pointer to **string** | The absolute path to the file. | [optional] [readonly] +**HasImportErrors** | Pointer to **NullableBool** | Whether the DAG has import errors *New in version 2.3.0* | [optional] [readonly] +**HasTaskConcurrencyLimits** | Pointer to **NullableBool** | Whether the DAG has task concurrency limits *New in version 2.3.0* | [optional] [readonly] **IsActive** | Pointer to **NullableBool** | Whether the DAG is currently seen by the scheduler(s). *New in version 2.1.1* *Changed in version 2.2.0*&#58; Field is read-only. | [optional] [readonly] +**IsPaused** | Pointer to **NullableBool** | Whether the DAG is paused. | [optional] **IsSubdag** | Pointer to **bool** | Whether the DAG is SubDAG. | [optional] [readonly] +**LastExpired** | Pointer to **NullableTime** | Time when the DAG last received a refresh signal (e.g. the DAG's \"refresh\" button was clicked in the web UI) *New in version 2.3.0* | [optional] [readonly] **LastParsedTime** | Pointer to **NullableTime** | The last time the DAG was parsed. *New in version 2.3.0* | [optional] [readonly] **LastPickled** | Pointer to **NullableTime** | The last time the DAG was pickled. *New in version 2.3.0* | [optional] [readonly] -**LastExpired** | Pointer to **NullableTime** | Time when the DAG last received a refresh signal (e.g. the DAG's \"refresh\" button was clicked in the web UI) *New in version 2.3.0* | [optional] [readonly] -**SchedulerLock** | Pointer to **NullableBool** | Whether (one of) the scheduler is scheduling this DAG at the moment *New in version 2.3.0* | [optional] [readonly] -**PickleId** | Pointer to **NullableString** | Foreign key to the latest pickle_id *New in version 2.3.0* | [optional] [readonly] -**DefaultView** | Pointer to **NullableString** | Default view of the DAG inside the webserver *New in version 2.3.0* | [optional] [readonly] -**Fileloc** | Pointer to **string** | The absolute path to the file. | [optional] [readonly] -**FileToken** | Pointer to **string** | The key containing the encrypted path to the file. Encryption and decryption take place only on the server. This prevents the client from reading an non-DAG file. This also ensures API extensibility, because the format of encrypted data may change. | [optional] [readonly] -**Owners** | Pointer to **[]string** | | [optional] [readonly] -**Description** | Pointer to **NullableString** | User-provided DAG description, which can consist of several sentences or paragraphs that describe DAG contents. | [optional] [readonly] -**ScheduleInterval** | Pointer to [**NullableScheduleInterval**](ScheduleInterval.md) | | [optional] -**TimetableDescription** | Pointer to **NullableString** | Timetable/Schedule Interval description. *New in version 2.3.0* | [optional] [readonly] -**Tags** | Pointer to [**[]Tag**](Tag.md) | List of tags. | [optional] [readonly] -**MaxActiveTasks** | Pointer to **NullableInt32** | Maximum number of active tasks that can be run on the DAG *New in version 2.3.0* | [optional] [readonly] **MaxActiveRuns** | Pointer to **NullableInt32** | Maximum number of active DAG runs for the DAG *New in version 2.3.0* | [optional] [readonly] -**HasTaskConcurrencyLimits** | Pointer to **NullableBool** | Whether the DAG has task concurrency limits *New in version 2.3.0* | [optional] [readonly] -**HasImportErrors** | Pointer to **NullableBool** | Whether the DAG has import errors *New in version 2.3.0* | [optional] [readonly] +**MaxActiveTasks** | Pointer to **NullableInt32** | Maximum number of active tasks that can be run on the DAG *New in version 2.3.0* | [optional] [readonly] +**MaxConsecutiveFailedDagRuns** | Pointer to **NullableInt32** | (experimental) The maximum number of consecutive DAG failures before DAG is automatically paused. *New in version 2.9.0* | [optional] [readonly] **NextDagrun** | Pointer to **NullableTime** | The logical date of the next dag run. *New in version 2.3.0* | [optional] [readonly] -**NextDagrunDataIntervalStart** | Pointer to **NullableTime** | The start of the interval of the next dag run. *New in version 2.3.0* | [optional] [readonly] -**NextDagrunDataIntervalEnd** | Pointer to **NullableTime** | The end of the interval of the next dag run. *New in version 2.3.0* | [optional] [readonly] **NextDagrunCreateAfter** | Pointer to **NullableTime** | Earliest time at which this ``next_dagrun`` can be created. *New in version 2.3.0* | [optional] [readonly] +**NextDagrunDataIntervalEnd** | Pointer to **NullableTime** | The end of the interval of the next dag run. *New in version 2.3.0* | [optional] [readonly] +**NextDagrunDataIntervalStart** | Pointer to **NullableTime** | The start of the interval of the next dag run. *New in version 2.3.0* | [optional] [readonly] +**Owners** | Pointer to **[]string** | | [optional] [readonly] +**PickleId** | Pointer to **NullableString** | Foreign key to the latest pickle_id *New in version 2.3.0* | [optional] [readonly] +**RootDagId** | Pointer to **NullableString** | If the DAG is SubDAG then it is the top level DAG identifier. Otherwise, null. | [optional] [readonly] +**ScheduleInterval** | Pointer to [**NullableScheduleInterval**](ScheduleInterval.md) | | [optional] +**SchedulerLock** | Pointer to **NullableBool** | Whether (one of) the scheduler is scheduling this DAG at the moment *New in version 2.3.0* | [optional] [readonly] +**Tags** | Pointer to [**[]Tag**](Tag.md) | List of tags. | [optional] [readonly] +**TimetableDescription** | Pointer to **NullableString** | Timetable/Schedule Interval description. *New in version 2.3.0* | [optional] [readonly] ## Methods @@ -69,6 +52,31 @@ NewDAGWithDefaults instantiates a new DAG object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set +### GetDagDisplayName + +`func (o *DAG) GetDagDisplayName() string` + +GetDagDisplayName returns the DagDisplayName field if non-nil, zero value otherwise. + +### GetDagDisplayNameOk + +`func (o *DAG) GetDagDisplayNameOk() (*string, bool)` + +GetDagDisplayNameOk returns a tuple with the DagDisplayName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDagDisplayName + +`func (o *DAG) SetDagDisplayName(v string)` + +SetDagDisplayName sets DagDisplayName field to given value. + +### HasDagDisplayName + +`func (o *DAG) HasDagDisplayName() bool` + +HasDagDisplayName returns a boolean if a field has been set. + ### GetDagId `func (o *DAG) GetDagId() string` @@ -94,841 +102,876 @@ SetDagId sets DagId field to given value. HasDagId returns a boolean if a field has been set. -### GetRootDagId +### GetDefaultView -`func (o *DAG) GetRootDagId() string` +`func (o *DAG) GetDefaultView() string` -GetRootDagId returns the RootDagId field if non-nil, zero value otherwise. +GetDefaultView returns the DefaultView field if non-nil, zero value otherwise. -### GetRootDagIdOk +### GetDefaultViewOk -`func (o *DAG) GetRootDagIdOk() (*string, bool)` +`func (o *DAG) GetDefaultViewOk() (*string, bool)` -GetRootDagIdOk returns a tuple with the RootDagId field if it's non-nil, zero value otherwise +GetDefaultViewOk returns a tuple with the DefaultView field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetRootDagId +### SetDefaultView -`func (o *DAG) SetRootDagId(v string)` +`func (o *DAG) SetDefaultView(v string)` -SetRootDagId sets RootDagId field to given value. +SetDefaultView sets DefaultView field to given value. -### HasRootDagId +### HasDefaultView -`func (o *DAG) HasRootDagId() bool` +`func (o *DAG) HasDefaultView() bool` -HasRootDagId returns a boolean if a field has been set. +HasDefaultView returns a boolean if a field has been set. -### SetRootDagIdNil +### SetDefaultViewNil -`func (o *DAG) SetRootDagIdNil(b bool)` +`func (o *DAG) SetDefaultViewNil(b bool)` - SetRootDagIdNil sets the value for RootDagId to be an explicit nil + SetDefaultViewNil sets the value for DefaultView to be an explicit nil -### UnsetRootDagId -`func (o *DAG) UnsetRootDagId()` +### UnsetDefaultView +`func (o *DAG) UnsetDefaultView()` -UnsetRootDagId ensures that no value is present for RootDagId, not even an explicit nil -### GetIsPaused +UnsetDefaultView ensures that no value is present for DefaultView, not even an explicit nil +### GetDescription -`func (o *DAG) GetIsPaused() bool` +`func (o *DAG) GetDescription() string` -GetIsPaused returns the IsPaused field if non-nil, zero value otherwise. +GetDescription returns the Description field if non-nil, zero value otherwise. -### GetIsPausedOk +### GetDescriptionOk -`func (o *DAG) GetIsPausedOk() (*bool, bool)` +`func (o *DAG) GetDescriptionOk() (*string, bool)` -GetIsPausedOk returns a tuple with the IsPaused field if it's non-nil, zero value otherwise +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetIsPaused +### SetDescription -`func (o *DAG) SetIsPaused(v bool)` +`func (o *DAG) SetDescription(v string)` -SetIsPaused sets IsPaused field to given value. +SetDescription sets Description field to given value. -### HasIsPaused +### HasDescription -`func (o *DAG) HasIsPaused() bool` +`func (o *DAG) HasDescription() bool` -HasIsPaused returns a boolean if a field has been set. +HasDescription returns a boolean if a field has been set. -### SetIsPausedNil +### SetDescriptionNil -`func (o *DAG) SetIsPausedNil(b bool)` +`func (o *DAG) SetDescriptionNil(b bool)` - SetIsPausedNil sets the value for IsPaused to be an explicit nil + SetDescriptionNil sets the value for Description to be an explicit nil -### UnsetIsPaused -`func (o *DAG) UnsetIsPaused()` +### UnsetDescription +`func (o *DAG) UnsetDescription()` -UnsetIsPaused ensures that no value is present for IsPaused, not even an explicit nil -### GetIsActive +UnsetDescription ensures that no value is present for Description, not even an explicit nil +### GetFileToken -`func (o *DAG) GetIsActive() bool` +`func (o *DAG) GetFileToken() string` -GetIsActive returns the IsActive field if non-nil, zero value otherwise. +GetFileToken returns the FileToken field if non-nil, zero value otherwise. -### GetIsActiveOk +### GetFileTokenOk -`func (o *DAG) GetIsActiveOk() (*bool, bool)` +`func (o *DAG) GetFileTokenOk() (*string, bool)` -GetIsActiveOk returns a tuple with the IsActive field if it's non-nil, zero value otherwise +GetFileTokenOk returns a tuple with the FileToken field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetIsActive - -`func (o *DAG) SetIsActive(v bool)` - -SetIsActive sets IsActive field to given value. - -### HasIsActive - -`func (o *DAG) HasIsActive() bool` +### SetFileToken -HasIsActive returns a boolean if a field has been set. +`func (o *DAG) SetFileToken(v string)` -### SetIsActiveNil +SetFileToken sets FileToken field to given value. -`func (o *DAG) SetIsActiveNil(b bool)` +### HasFileToken - SetIsActiveNil sets the value for IsActive to be an explicit nil +`func (o *DAG) HasFileToken() bool` -### UnsetIsActive -`func (o *DAG) UnsetIsActive()` +HasFileToken returns a boolean if a field has been set. -UnsetIsActive ensures that no value is present for IsActive, not even an explicit nil -### GetIsSubdag +### GetFileloc -`func (o *DAG) GetIsSubdag() bool` +`func (o *DAG) GetFileloc() string` -GetIsSubdag returns the IsSubdag field if non-nil, zero value otherwise. +GetFileloc returns the Fileloc field if non-nil, zero value otherwise. -### GetIsSubdagOk +### GetFilelocOk -`func (o *DAG) GetIsSubdagOk() (*bool, bool)` +`func (o *DAG) GetFilelocOk() (*string, bool)` -GetIsSubdagOk returns a tuple with the IsSubdag field if it's non-nil, zero value otherwise +GetFilelocOk returns a tuple with the Fileloc field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetIsSubdag +### SetFileloc -`func (o *DAG) SetIsSubdag(v bool)` +`func (o *DAG) SetFileloc(v string)` -SetIsSubdag sets IsSubdag field to given value. +SetFileloc sets Fileloc field to given value. -### HasIsSubdag +### HasFileloc -`func (o *DAG) HasIsSubdag() bool` +`func (o *DAG) HasFileloc() bool` -HasIsSubdag returns a boolean if a field has been set. +HasFileloc returns a boolean if a field has been set. -### GetLastParsedTime +### GetHasImportErrors -`func (o *DAG) GetLastParsedTime() time.Time` +`func (o *DAG) GetHasImportErrors() bool` -GetLastParsedTime returns the LastParsedTime field if non-nil, zero value otherwise. +GetHasImportErrors returns the HasImportErrors field if non-nil, zero value otherwise. -### GetLastParsedTimeOk +### GetHasImportErrorsOk -`func (o *DAG) GetLastParsedTimeOk() (*time.Time, bool)` +`func (o *DAG) GetHasImportErrorsOk() (*bool, bool)` -GetLastParsedTimeOk returns a tuple with the LastParsedTime field if it's non-nil, zero value otherwise +GetHasImportErrorsOk returns a tuple with the HasImportErrors field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetLastParsedTime +### SetHasImportErrors -`func (o *DAG) SetLastParsedTime(v time.Time)` +`func (o *DAG) SetHasImportErrors(v bool)` -SetLastParsedTime sets LastParsedTime field to given value. +SetHasImportErrors sets HasImportErrors field to given value. -### HasLastParsedTime +### HasHasImportErrors -`func (o *DAG) HasLastParsedTime() bool` +`func (o *DAG) HasHasImportErrors() bool` -HasLastParsedTime returns a boolean if a field has been set. +HasHasImportErrors returns a boolean if a field has been set. -### SetLastParsedTimeNil +### SetHasImportErrorsNil -`func (o *DAG) SetLastParsedTimeNil(b bool)` +`func (o *DAG) SetHasImportErrorsNil(b bool)` - SetLastParsedTimeNil sets the value for LastParsedTime to be an explicit nil + SetHasImportErrorsNil sets the value for HasImportErrors to be an explicit nil -### UnsetLastParsedTime -`func (o *DAG) UnsetLastParsedTime()` +### UnsetHasImportErrors +`func (o *DAG) UnsetHasImportErrors()` -UnsetLastParsedTime ensures that no value is present for LastParsedTime, not even an explicit nil -### GetLastPickled +UnsetHasImportErrors ensures that no value is present for HasImportErrors, not even an explicit nil +### GetHasTaskConcurrencyLimits -`func (o *DAG) GetLastPickled() time.Time` +`func (o *DAG) GetHasTaskConcurrencyLimits() bool` -GetLastPickled returns the LastPickled field if non-nil, zero value otherwise. +GetHasTaskConcurrencyLimits returns the HasTaskConcurrencyLimits field if non-nil, zero value otherwise. -### GetLastPickledOk +### GetHasTaskConcurrencyLimitsOk -`func (o *DAG) GetLastPickledOk() (*time.Time, bool)` +`func (o *DAG) GetHasTaskConcurrencyLimitsOk() (*bool, bool)` -GetLastPickledOk returns a tuple with the LastPickled field if it's non-nil, zero value otherwise +GetHasTaskConcurrencyLimitsOk returns a tuple with the HasTaskConcurrencyLimits field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetLastPickled +### SetHasTaskConcurrencyLimits -`func (o *DAG) SetLastPickled(v time.Time)` +`func (o *DAG) SetHasTaskConcurrencyLimits(v bool)` -SetLastPickled sets LastPickled field to given value. +SetHasTaskConcurrencyLimits sets HasTaskConcurrencyLimits field to given value. -### HasLastPickled +### HasHasTaskConcurrencyLimits -`func (o *DAG) HasLastPickled() bool` +`func (o *DAG) HasHasTaskConcurrencyLimits() bool` -HasLastPickled returns a boolean if a field has been set. +HasHasTaskConcurrencyLimits returns a boolean if a field has been set. -### SetLastPickledNil +### SetHasTaskConcurrencyLimitsNil -`func (o *DAG) SetLastPickledNil(b bool)` +`func (o *DAG) SetHasTaskConcurrencyLimitsNil(b bool)` - SetLastPickledNil sets the value for LastPickled to be an explicit nil + SetHasTaskConcurrencyLimitsNil sets the value for HasTaskConcurrencyLimits to be an explicit nil -### UnsetLastPickled -`func (o *DAG) UnsetLastPickled()` +### UnsetHasTaskConcurrencyLimits +`func (o *DAG) UnsetHasTaskConcurrencyLimits()` -UnsetLastPickled ensures that no value is present for LastPickled, not even an explicit nil -### GetLastExpired +UnsetHasTaskConcurrencyLimits ensures that no value is present for HasTaskConcurrencyLimits, not even an explicit nil +### GetIsActive -`func (o *DAG) GetLastExpired() time.Time` +`func (o *DAG) GetIsActive() bool` -GetLastExpired returns the LastExpired field if non-nil, zero value otherwise. +GetIsActive returns the IsActive field if non-nil, zero value otherwise. -### GetLastExpiredOk +### GetIsActiveOk -`func (o *DAG) GetLastExpiredOk() (*time.Time, bool)` +`func (o *DAG) GetIsActiveOk() (*bool, bool)` -GetLastExpiredOk returns a tuple with the LastExpired field if it's non-nil, zero value otherwise +GetIsActiveOk returns a tuple with the IsActive field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetLastExpired +### SetIsActive -`func (o *DAG) SetLastExpired(v time.Time)` +`func (o *DAG) SetIsActive(v bool)` -SetLastExpired sets LastExpired field to given value. +SetIsActive sets IsActive field to given value. -### HasLastExpired +### HasIsActive -`func (o *DAG) HasLastExpired() bool` +`func (o *DAG) HasIsActive() bool` -HasLastExpired returns a boolean if a field has been set. +HasIsActive returns a boolean if a field has been set. -### SetLastExpiredNil +### SetIsActiveNil -`func (o *DAG) SetLastExpiredNil(b bool)` +`func (o *DAG) SetIsActiveNil(b bool)` - SetLastExpiredNil sets the value for LastExpired to be an explicit nil + SetIsActiveNil sets the value for IsActive to be an explicit nil -### UnsetLastExpired -`func (o *DAG) UnsetLastExpired()` +### UnsetIsActive +`func (o *DAG) UnsetIsActive()` -UnsetLastExpired ensures that no value is present for LastExpired, not even an explicit nil -### GetSchedulerLock +UnsetIsActive ensures that no value is present for IsActive, not even an explicit nil +### GetIsPaused -`func (o *DAG) GetSchedulerLock() bool` +`func (o *DAG) GetIsPaused() bool` -GetSchedulerLock returns the SchedulerLock field if non-nil, zero value otherwise. +GetIsPaused returns the IsPaused field if non-nil, zero value otherwise. -### GetSchedulerLockOk +### GetIsPausedOk -`func (o *DAG) GetSchedulerLockOk() (*bool, bool)` +`func (o *DAG) GetIsPausedOk() (*bool, bool)` -GetSchedulerLockOk returns a tuple with the SchedulerLock field if it's non-nil, zero value otherwise +GetIsPausedOk returns a tuple with the IsPaused field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetSchedulerLock +### SetIsPaused -`func (o *DAG) SetSchedulerLock(v bool)` +`func (o *DAG) SetIsPaused(v bool)` -SetSchedulerLock sets SchedulerLock field to given value. +SetIsPaused sets IsPaused field to given value. -### HasSchedulerLock +### HasIsPaused -`func (o *DAG) HasSchedulerLock() bool` +`func (o *DAG) HasIsPaused() bool` -HasSchedulerLock returns a boolean if a field has been set. +HasIsPaused returns a boolean if a field has been set. -### SetSchedulerLockNil +### SetIsPausedNil -`func (o *DAG) SetSchedulerLockNil(b bool)` +`func (o *DAG) SetIsPausedNil(b bool)` - SetSchedulerLockNil sets the value for SchedulerLock to be an explicit nil + SetIsPausedNil sets the value for IsPaused to be an explicit nil -### UnsetSchedulerLock -`func (o *DAG) UnsetSchedulerLock()` +### UnsetIsPaused +`func (o *DAG) UnsetIsPaused()` -UnsetSchedulerLock ensures that no value is present for SchedulerLock, not even an explicit nil -### GetPickleId +UnsetIsPaused ensures that no value is present for IsPaused, not even an explicit nil +### GetIsSubdag -`func (o *DAG) GetPickleId() string` +`func (o *DAG) GetIsSubdag() bool` -GetPickleId returns the PickleId field if non-nil, zero value otherwise. +GetIsSubdag returns the IsSubdag field if non-nil, zero value otherwise. -### GetPickleIdOk +### GetIsSubdagOk -`func (o *DAG) GetPickleIdOk() (*string, bool)` +`func (o *DAG) GetIsSubdagOk() (*bool, bool)` -GetPickleIdOk returns a tuple with the PickleId field if it's non-nil, zero value otherwise +GetIsSubdagOk returns a tuple with the IsSubdag field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetPickleId +### SetIsSubdag -`func (o *DAG) SetPickleId(v string)` +`func (o *DAG) SetIsSubdag(v bool)` -SetPickleId sets PickleId field to given value. +SetIsSubdag sets IsSubdag field to given value. -### HasPickleId +### HasIsSubdag -`func (o *DAG) HasPickleId() bool` +`func (o *DAG) HasIsSubdag() bool` -HasPickleId returns a boolean if a field has been set. +HasIsSubdag returns a boolean if a field has been set. -### SetPickleIdNil +### GetLastExpired -`func (o *DAG) SetPickleIdNil(b bool)` +`func (o *DAG) GetLastExpired() time.Time` - SetPickleIdNil sets the value for PickleId to be an explicit nil +GetLastExpired returns the LastExpired field if non-nil, zero value otherwise. -### UnsetPickleId -`func (o *DAG) UnsetPickleId()` +### GetLastExpiredOk -UnsetPickleId ensures that no value is present for PickleId, not even an explicit nil -### GetDefaultView +`func (o *DAG) GetLastExpiredOk() (*time.Time, bool)` -`func (o *DAG) GetDefaultView() string` +GetLastExpiredOk returns a tuple with the LastExpired field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. -GetDefaultView returns the DefaultView field if non-nil, zero value otherwise. +### SetLastExpired -### GetDefaultViewOk +`func (o *DAG) SetLastExpired(v time.Time)` -`func (o *DAG) GetDefaultViewOk() (*string, bool)` +SetLastExpired sets LastExpired field to given value. -GetDefaultViewOk returns a tuple with the DefaultView field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. +### HasLastExpired -### SetDefaultView +`func (o *DAG) HasLastExpired() bool` -`func (o *DAG) SetDefaultView(v string)` +HasLastExpired returns a boolean if a field has been set. -SetDefaultView sets DefaultView field to given value. +### SetLastExpiredNil -### HasDefaultView +`func (o *DAG) SetLastExpiredNil(b bool)` -`func (o *DAG) HasDefaultView() bool` + SetLastExpiredNil sets the value for LastExpired to be an explicit nil -HasDefaultView returns a boolean if a field has been set. +### UnsetLastExpired +`func (o *DAG) UnsetLastExpired()` -### SetDefaultViewNil +UnsetLastExpired ensures that no value is present for LastExpired, not even an explicit nil +### GetLastParsedTime -`func (o *DAG) SetDefaultViewNil(b bool)` +`func (o *DAG) GetLastParsedTime() time.Time` - SetDefaultViewNil sets the value for DefaultView to be an explicit nil +GetLastParsedTime returns the LastParsedTime field if non-nil, zero value otherwise. -### UnsetDefaultView -`func (o *DAG) UnsetDefaultView()` +### GetLastParsedTimeOk -UnsetDefaultView ensures that no value is present for DefaultView, not even an explicit nil -### GetFileloc +`func (o *DAG) GetLastParsedTimeOk() (*time.Time, bool)` -`func (o *DAG) GetFileloc() string` +GetLastParsedTimeOk returns a tuple with the LastParsedTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. -GetFileloc returns the Fileloc field if non-nil, zero value otherwise. +### SetLastParsedTime -### GetFilelocOk +`func (o *DAG) SetLastParsedTime(v time.Time)` -`func (o *DAG) GetFilelocOk() (*string, bool)` +SetLastParsedTime sets LastParsedTime field to given value. -GetFilelocOk returns a tuple with the Fileloc field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. +### HasLastParsedTime -### SetFileloc +`func (o *DAG) HasLastParsedTime() bool` -`func (o *DAG) SetFileloc(v string)` +HasLastParsedTime returns a boolean if a field has been set. -SetFileloc sets Fileloc field to given value. +### SetLastParsedTimeNil -### HasFileloc +`func (o *DAG) SetLastParsedTimeNil(b bool)` -`func (o *DAG) HasFileloc() bool` + SetLastParsedTimeNil sets the value for LastParsedTime to be an explicit nil -HasFileloc returns a boolean if a field has been set. +### UnsetLastParsedTime +`func (o *DAG) UnsetLastParsedTime()` -### GetFileToken +UnsetLastParsedTime ensures that no value is present for LastParsedTime, not even an explicit nil +### GetLastPickled -`func (o *DAG) GetFileToken() string` +`func (o *DAG) GetLastPickled() time.Time` -GetFileToken returns the FileToken field if non-nil, zero value otherwise. +GetLastPickled returns the LastPickled field if non-nil, zero value otherwise. -### GetFileTokenOk +### GetLastPickledOk -`func (o *DAG) GetFileTokenOk() (*string, bool)` +`func (o *DAG) GetLastPickledOk() (*time.Time, bool)` -GetFileTokenOk returns a tuple with the FileToken field if it's non-nil, zero value otherwise +GetLastPickledOk returns a tuple with the LastPickled field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetFileToken +### SetLastPickled -`func (o *DAG) SetFileToken(v string)` +`func (o *DAG) SetLastPickled(v time.Time)` -SetFileToken sets FileToken field to given value. +SetLastPickled sets LastPickled field to given value. -### HasFileToken +### HasLastPickled -`func (o *DAG) HasFileToken() bool` +`func (o *DAG) HasLastPickled() bool` -HasFileToken returns a boolean if a field has been set. +HasLastPickled returns a boolean if a field has been set. -### GetOwners +### SetLastPickledNil -`func (o *DAG) GetOwners() []string` +`func (o *DAG) SetLastPickledNil(b bool)` -GetOwners returns the Owners field if non-nil, zero value otherwise. + SetLastPickledNil sets the value for LastPickled to be an explicit nil -### GetOwnersOk +### UnsetLastPickled +`func (o *DAG) UnsetLastPickled()` -`func (o *DAG) GetOwnersOk() (*[]string, bool)` +UnsetLastPickled ensures that no value is present for LastPickled, not even an explicit nil +### GetMaxActiveRuns -GetOwnersOk returns a tuple with the Owners field if it's non-nil, zero value otherwise +`func (o *DAG) GetMaxActiveRuns() int32` + +GetMaxActiveRuns returns the MaxActiveRuns field if non-nil, zero value otherwise. + +### GetMaxActiveRunsOk + +`func (o *DAG) GetMaxActiveRunsOk() (*int32, bool)` + +GetMaxActiveRunsOk returns a tuple with the MaxActiveRuns field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetOwners +### SetMaxActiveRuns -`func (o *DAG) SetOwners(v []string)` +`func (o *DAG) SetMaxActiveRuns(v int32)` -SetOwners sets Owners field to given value. +SetMaxActiveRuns sets MaxActiveRuns field to given value. -### HasOwners +### HasMaxActiveRuns -`func (o *DAG) HasOwners() bool` +`func (o *DAG) HasMaxActiveRuns() bool` -HasOwners returns a boolean if a field has been set. +HasMaxActiveRuns returns a boolean if a field has been set. -### GetDescription +### SetMaxActiveRunsNil -`func (o *DAG) GetDescription() string` +`func (o *DAG) SetMaxActiveRunsNil(b bool)` -GetDescription returns the Description field if non-nil, zero value otherwise. + SetMaxActiveRunsNil sets the value for MaxActiveRuns to be an explicit nil -### GetDescriptionOk +### UnsetMaxActiveRuns +`func (o *DAG) UnsetMaxActiveRuns()` -`func (o *DAG) GetDescriptionOk() (*string, bool)` +UnsetMaxActiveRuns ensures that no value is present for MaxActiveRuns, not even an explicit nil +### GetMaxActiveTasks -GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +`func (o *DAG) GetMaxActiveTasks() int32` + +GetMaxActiveTasks returns the MaxActiveTasks field if non-nil, zero value otherwise. + +### GetMaxActiveTasksOk + +`func (o *DAG) GetMaxActiveTasksOk() (*int32, bool)` + +GetMaxActiveTasksOk returns a tuple with the MaxActiveTasks field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDescription +### SetMaxActiveTasks -`func (o *DAG) SetDescription(v string)` +`func (o *DAG) SetMaxActiveTasks(v int32)` -SetDescription sets Description field to given value. +SetMaxActiveTasks sets MaxActiveTasks field to given value. -### HasDescription +### HasMaxActiveTasks -`func (o *DAG) HasDescription() bool` +`func (o *DAG) HasMaxActiveTasks() bool` -HasDescription returns a boolean if a field has been set. +HasMaxActiveTasks returns a boolean if a field has been set. -### SetDescriptionNil +### SetMaxActiveTasksNil -`func (o *DAG) SetDescriptionNil(b bool)` +`func (o *DAG) SetMaxActiveTasksNil(b bool)` - SetDescriptionNil sets the value for Description to be an explicit nil + SetMaxActiveTasksNil sets the value for MaxActiveTasks to be an explicit nil -### UnsetDescription -`func (o *DAG) UnsetDescription()` +### UnsetMaxActiveTasks +`func (o *DAG) UnsetMaxActiveTasks()` -UnsetDescription ensures that no value is present for Description, not even an explicit nil -### GetScheduleInterval +UnsetMaxActiveTasks ensures that no value is present for MaxActiveTasks, not even an explicit nil +### GetMaxConsecutiveFailedDagRuns -`func (o *DAG) GetScheduleInterval() ScheduleInterval` +`func (o *DAG) GetMaxConsecutiveFailedDagRuns() int32` -GetScheduleInterval returns the ScheduleInterval field if non-nil, zero value otherwise. +GetMaxConsecutiveFailedDagRuns returns the MaxConsecutiveFailedDagRuns field if non-nil, zero value otherwise. -### GetScheduleIntervalOk +### GetMaxConsecutiveFailedDagRunsOk -`func (o *DAG) GetScheduleIntervalOk() (*ScheduleInterval, bool)` +`func (o *DAG) GetMaxConsecutiveFailedDagRunsOk() (*int32, bool)` -GetScheduleIntervalOk returns a tuple with the ScheduleInterval field if it's non-nil, zero value otherwise +GetMaxConsecutiveFailedDagRunsOk returns a tuple with the MaxConsecutiveFailedDagRuns field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetScheduleInterval +### SetMaxConsecutiveFailedDagRuns -`func (o *DAG) SetScheduleInterval(v ScheduleInterval)` +`func (o *DAG) SetMaxConsecutiveFailedDagRuns(v int32)` -SetScheduleInterval sets ScheduleInterval field to given value. +SetMaxConsecutiveFailedDagRuns sets MaxConsecutiveFailedDagRuns field to given value. -### HasScheduleInterval +### HasMaxConsecutiveFailedDagRuns -`func (o *DAG) HasScheduleInterval() bool` +`func (o *DAG) HasMaxConsecutiveFailedDagRuns() bool` -HasScheduleInterval returns a boolean if a field has been set. +HasMaxConsecutiveFailedDagRuns returns a boolean if a field has been set. -### SetScheduleIntervalNil +### SetMaxConsecutiveFailedDagRunsNil -`func (o *DAG) SetScheduleIntervalNil(b bool)` +`func (o *DAG) SetMaxConsecutiveFailedDagRunsNil(b bool)` - SetScheduleIntervalNil sets the value for ScheduleInterval to be an explicit nil + SetMaxConsecutiveFailedDagRunsNil sets the value for MaxConsecutiveFailedDagRuns to be an explicit nil -### UnsetScheduleInterval -`func (o *DAG) UnsetScheduleInterval()` +### UnsetMaxConsecutiveFailedDagRuns +`func (o *DAG) UnsetMaxConsecutiveFailedDagRuns()` -UnsetScheduleInterval ensures that no value is present for ScheduleInterval, not even an explicit nil -### GetTimetableDescription +UnsetMaxConsecutiveFailedDagRuns ensures that no value is present for MaxConsecutiveFailedDagRuns, not even an explicit nil +### GetNextDagrun -`func (o *DAG) GetTimetableDescription() string` +`func (o *DAG) GetNextDagrun() time.Time` -GetTimetableDescription returns the TimetableDescription field if non-nil, zero value otherwise. +GetNextDagrun returns the NextDagrun field if non-nil, zero value otherwise. -### GetTimetableDescriptionOk +### GetNextDagrunOk -`func (o *DAG) GetTimetableDescriptionOk() (*string, bool)` +`func (o *DAG) GetNextDagrunOk() (*time.Time, bool)` -GetTimetableDescriptionOk returns a tuple with the TimetableDescription field if it's non-nil, zero value otherwise +GetNextDagrunOk returns a tuple with the NextDagrun field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTimetableDescription +### SetNextDagrun -`func (o *DAG) SetTimetableDescription(v string)` +`func (o *DAG) SetNextDagrun(v time.Time)` -SetTimetableDescription sets TimetableDescription field to given value. +SetNextDagrun sets NextDagrun field to given value. -### HasTimetableDescription +### HasNextDagrun -`func (o *DAG) HasTimetableDescription() bool` +`func (o *DAG) HasNextDagrun() bool` -HasTimetableDescription returns a boolean if a field has been set. +HasNextDagrun returns a boolean if a field has been set. -### SetTimetableDescriptionNil +### SetNextDagrunNil -`func (o *DAG) SetTimetableDescriptionNil(b bool)` +`func (o *DAG) SetNextDagrunNil(b bool)` - SetTimetableDescriptionNil sets the value for TimetableDescription to be an explicit nil + SetNextDagrunNil sets the value for NextDagrun to be an explicit nil -### UnsetTimetableDescription -`func (o *DAG) UnsetTimetableDescription()` +### UnsetNextDagrun +`func (o *DAG) UnsetNextDagrun()` -UnsetTimetableDescription ensures that no value is present for TimetableDescription, not even an explicit nil -### GetTags +UnsetNextDagrun ensures that no value is present for NextDagrun, not even an explicit nil +### GetNextDagrunCreateAfter -`func (o *DAG) GetTags() []Tag` +`func (o *DAG) GetNextDagrunCreateAfter() time.Time` -GetTags returns the Tags field if non-nil, zero value otherwise. +GetNextDagrunCreateAfter returns the NextDagrunCreateAfter field if non-nil, zero value otherwise. -### GetTagsOk +### GetNextDagrunCreateAfterOk -`func (o *DAG) GetTagsOk() (*[]Tag, bool)` +`func (o *DAG) GetNextDagrunCreateAfterOk() (*time.Time, bool)` -GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +GetNextDagrunCreateAfterOk returns a tuple with the NextDagrunCreateAfter field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTags +### SetNextDagrunCreateAfter -`func (o *DAG) SetTags(v []Tag)` +`func (o *DAG) SetNextDagrunCreateAfter(v time.Time)` -SetTags sets Tags field to given value. +SetNextDagrunCreateAfter sets NextDagrunCreateAfter field to given value. -### HasTags +### HasNextDagrunCreateAfter -`func (o *DAG) HasTags() bool` +`func (o *DAG) HasNextDagrunCreateAfter() bool` -HasTags returns a boolean if a field has been set. +HasNextDagrunCreateAfter returns a boolean if a field has been set. -### SetTagsNil +### SetNextDagrunCreateAfterNil -`func (o *DAG) SetTagsNil(b bool)` +`func (o *DAG) SetNextDagrunCreateAfterNil(b bool)` - SetTagsNil sets the value for Tags to be an explicit nil + SetNextDagrunCreateAfterNil sets the value for NextDagrunCreateAfter to be an explicit nil -### UnsetTags -`func (o *DAG) UnsetTags()` +### UnsetNextDagrunCreateAfter +`func (o *DAG) UnsetNextDagrunCreateAfter()` -UnsetTags ensures that no value is present for Tags, not even an explicit nil -### GetMaxActiveTasks +UnsetNextDagrunCreateAfter ensures that no value is present for NextDagrunCreateAfter, not even an explicit nil +### GetNextDagrunDataIntervalEnd -`func (o *DAG) GetMaxActiveTasks() int32` +`func (o *DAG) GetNextDagrunDataIntervalEnd() time.Time` -GetMaxActiveTasks returns the MaxActiveTasks field if non-nil, zero value otherwise. +GetNextDagrunDataIntervalEnd returns the NextDagrunDataIntervalEnd field if non-nil, zero value otherwise. -### GetMaxActiveTasksOk +### GetNextDagrunDataIntervalEndOk -`func (o *DAG) GetMaxActiveTasksOk() (*int32, bool)` +`func (o *DAG) GetNextDagrunDataIntervalEndOk() (*time.Time, bool)` -GetMaxActiveTasksOk returns a tuple with the MaxActiveTasks field if it's non-nil, zero value otherwise +GetNextDagrunDataIntervalEndOk returns a tuple with the NextDagrunDataIntervalEnd field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetMaxActiveTasks +### SetNextDagrunDataIntervalEnd -`func (o *DAG) SetMaxActiveTasks(v int32)` +`func (o *DAG) SetNextDagrunDataIntervalEnd(v time.Time)` -SetMaxActiveTasks sets MaxActiveTasks field to given value. +SetNextDagrunDataIntervalEnd sets NextDagrunDataIntervalEnd field to given value. -### HasMaxActiveTasks +### HasNextDagrunDataIntervalEnd -`func (o *DAG) HasMaxActiveTasks() bool` +`func (o *DAG) HasNextDagrunDataIntervalEnd() bool` -HasMaxActiveTasks returns a boolean if a field has been set. +HasNextDagrunDataIntervalEnd returns a boolean if a field has been set. -### SetMaxActiveTasksNil +### SetNextDagrunDataIntervalEndNil -`func (o *DAG) SetMaxActiveTasksNil(b bool)` +`func (o *DAG) SetNextDagrunDataIntervalEndNil(b bool)` - SetMaxActiveTasksNil sets the value for MaxActiveTasks to be an explicit nil + SetNextDagrunDataIntervalEndNil sets the value for NextDagrunDataIntervalEnd to be an explicit nil -### UnsetMaxActiveTasks -`func (o *DAG) UnsetMaxActiveTasks()` +### UnsetNextDagrunDataIntervalEnd +`func (o *DAG) UnsetNextDagrunDataIntervalEnd()` + +UnsetNextDagrunDataIntervalEnd ensures that no value is present for NextDagrunDataIntervalEnd, not even an explicit nil +### GetNextDagrunDataIntervalStart + +`func (o *DAG) GetNextDagrunDataIntervalStart() time.Time` + +GetNextDagrunDataIntervalStart returns the NextDagrunDataIntervalStart field if non-nil, zero value otherwise. + +### GetNextDagrunDataIntervalStartOk + +`func (o *DAG) GetNextDagrunDataIntervalStartOk() (*time.Time, bool)` + +GetNextDagrunDataIntervalStartOk returns a tuple with the NextDagrunDataIntervalStart field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNextDagrunDataIntervalStart + +`func (o *DAG) SetNextDagrunDataIntervalStart(v time.Time)` + +SetNextDagrunDataIntervalStart sets NextDagrunDataIntervalStart field to given value. + +### HasNextDagrunDataIntervalStart + +`func (o *DAG) HasNextDagrunDataIntervalStart() bool` + +HasNextDagrunDataIntervalStart returns a boolean if a field has been set. -UnsetMaxActiveTasks ensures that no value is present for MaxActiveTasks, not even an explicit nil -### GetMaxActiveRuns +### SetNextDagrunDataIntervalStartNil -`func (o *DAG) GetMaxActiveRuns() int32` +`func (o *DAG) SetNextDagrunDataIntervalStartNil(b bool)` -GetMaxActiveRuns returns the MaxActiveRuns field if non-nil, zero value otherwise. + SetNextDagrunDataIntervalStartNil sets the value for NextDagrunDataIntervalStart to be an explicit nil -### GetMaxActiveRunsOk +### UnsetNextDagrunDataIntervalStart +`func (o *DAG) UnsetNextDagrunDataIntervalStart()` -`func (o *DAG) GetMaxActiveRunsOk() (*int32, bool)` +UnsetNextDagrunDataIntervalStart ensures that no value is present for NextDagrunDataIntervalStart, not even an explicit nil +### GetOwners -GetMaxActiveRunsOk returns a tuple with the MaxActiveRuns field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. +`func (o *DAG) GetOwners() []string` -### SetMaxActiveRuns +GetOwners returns the Owners field if non-nil, zero value otherwise. -`func (o *DAG) SetMaxActiveRuns(v int32)` +### GetOwnersOk -SetMaxActiveRuns sets MaxActiveRuns field to given value. +`func (o *DAG) GetOwnersOk() (*[]string, bool)` -### HasMaxActiveRuns +GetOwnersOk returns a tuple with the Owners field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. -`func (o *DAG) HasMaxActiveRuns() bool` +### SetOwners -HasMaxActiveRuns returns a boolean if a field has been set. +`func (o *DAG) SetOwners(v []string)` -### SetMaxActiveRunsNil +SetOwners sets Owners field to given value. -`func (o *DAG) SetMaxActiveRunsNil(b bool)` +### HasOwners - SetMaxActiveRunsNil sets the value for MaxActiveRuns to be an explicit nil +`func (o *DAG) HasOwners() bool` -### UnsetMaxActiveRuns -`func (o *DAG) UnsetMaxActiveRuns()` +HasOwners returns a boolean if a field has been set. -UnsetMaxActiveRuns ensures that no value is present for MaxActiveRuns, not even an explicit nil -### GetHasTaskConcurrencyLimits +### GetPickleId -`func (o *DAG) GetHasTaskConcurrencyLimits() bool` +`func (o *DAG) GetPickleId() string` -GetHasTaskConcurrencyLimits returns the HasTaskConcurrencyLimits field if non-nil, zero value otherwise. +GetPickleId returns the PickleId field if non-nil, zero value otherwise. -### GetHasTaskConcurrencyLimitsOk +### GetPickleIdOk -`func (o *DAG) GetHasTaskConcurrencyLimitsOk() (*bool, bool)` +`func (o *DAG) GetPickleIdOk() (*string, bool)` -GetHasTaskConcurrencyLimitsOk returns a tuple with the HasTaskConcurrencyLimits field if it's non-nil, zero value otherwise +GetPickleIdOk returns a tuple with the PickleId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetHasTaskConcurrencyLimits +### SetPickleId -`func (o *DAG) SetHasTaskConcurrencyLimits(v bool)` +`func (o *DAG) SetPickleId(v string)` -SetHasTaskConcurrencyLimits sets HasTaskConcurrencyLimits field to given value. +SetPickleId sets PickleId field to given value. -### HasHasTaskConcurrencyLimits +### HasPickleId -`func (o *DAG) HasHasTaskConcurrencyLimits() bool` +`func (o *DAG) HasPickleId() bool` -HasHasTaskConcurrencyLimits returns a boolean if a field has been set. +HasPickleId returns a boolean if a field has been set. -### SetHasTaskConcurrencyLimitsNil +### SetPickleIdNil -`func (o *DAG) SetHasTaskConcurrencyLimitsNil(b bool)` +`func (o *DAG) SetPickleIdNil(b bool)` - SetHasTaskConcurrencyLimitsNil sets the value for HasTaskConcurrencyLimits to be an explicit nil + SetPickleIdNil sets the value for PickleId to be an explicit nil -### UnsetHasTaskConcurrencyLimits -`func (o *DAG) UnsetHasTaskConcurrencyLimits()` +### UnsetPickleId +`func (o *DAG) UnsetPickleId()` -UnsetHasTaskConcurrencyLimits ensures that no value is present for HasTaskConcurrencyLimits, not even an explicit nil -### GetHasImportErrors +UnsetPickleId ensures that no value is present for PickleId, not even an explicit nil +### GetRootDagId -`func (o *DAG) GetHasImportErrors() bool` +`func (o *DAG) GetRootDagId() string` -GetHasImportErrors returns the HasImportErrors field if non-nil, zero value otherwise. +GetRootDagId returns the RootDagId field if non-nil, zero value otherwise. -### GetHasImportErrorsOk +### GetRootDagIdOk -`func (o *DAG) GetHasImportErrorsOk() (*bool, bool)` +`func (o *DAG) GetRootDagIdOk() (*string, bool)` -GetHasImportErrorsOk returns a tuple with the HasImportErrors field if it's non-nil, zero value otherwise +GetRootDagIdOk returns a tuple with the RootDagId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetHasImportErrors +### SetRootDagId -`func (o *DAG) SetHasImportErrors(v bool)` +`func (o *DAG) SetRootDagId(v string)` -SetHasImportErrors sets HasImportErrors field to given value. +SetRootDagId sets RootDagId field to given value. -### HasHasImportErrors +### HasRootDagId -`func (o *DAG) HasHasImportErrors() bool` +`func (o *DAG) HasRootDagId() bool` -HasHasImportErrors returns a boolean if a field has been set. +HasRootDagId returns a boolean if a field has been set. -### SetHasImportErrorsNil +### SetRootDagIdNil -`func (o *DAG) SetHasImportErrorsNil(b bool)` +`func (o *DAG) SetRootDagIdNil(b bool)` - SetHasImportErrorsNil sets the value for HasImportErrors to be an explicit nil + SetRootDagIdNil sets the value for RootDagId to be an explicit nil -### UnsetHasImportErrors -`func (o *DAG) UnsetHasImportErrors()` +### UnsetRootDagId +`func (o *DAG) UnsetRootDagId()` -UnsetHasImportErrors ensures that no value is present for HasImportErrors, not even an explicit nil -### GetNextDagrun +UnsetRootDagId ensures that no value is present for RootDagId, not even an explicit nil +### GetScheduleInterval -`func (o *DAG) GetNextDagrun() time.Time` +`func (o *DAG) GetScheduleInterval() ScheduleInterval` -GetNextDagrun returns the NextDagrun field if non-nil, zero value otherwise. +GetScheduleInterval returns the ScheduleInterval field if non-nil, zero value otherwise. -### GetNextDagrunOk +### GetScheduleIntervalOk -`func (o *DAG) GetNextDagrunOk() (*time.Time, bool)` +`func (o *DAG) GetScheduleIntervalOk() (*ScheduleInterval, bool)` -GetNextDagrunOk returns a tuple with the NextDagrun field if it's non-nil, zero value otherwise +GetScheduleIntervalOk returns a tuple with the ScheduleInterval field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetNextDagrun +### SetScheduleInterval -`func (o *DAG) SetNextDagrun(v time.Time)` +`func (o *DAG) SetScheduleInterval(v ScheduleInterval)` -SetNextDagrun sets NextDagrun field to given value. +SetScheduleInterval sets ScheduleInterval field to given value. -### HasNextDagrun +### HasScheduleInterval -`func (o *DAG) HasNextDagrun() bool` +`func (o *DAG) HasScheduleInterval() bool` -HasNextDagrun returns a boolean if a field has been set. +HasScheduleInterval returns a boolean if a field has been set. -### SetNextDagrunNil +### SetScheduleIntervalNil -`func (o *DAG) SetNextDagrunNil(b bool)` +`func (o *DAG) SetScheduleIntervalNil(b bool)` - SetNextDagrunNil sets the value for NextDagrun to be an explicit nil + SetScheduleIntervalNil sets the value for ScheduleInterval to be an explicit nil -### UnsetNextDagrun -`func (o *DAG) UnsetNextDagrun()` +### UnsetScheduleInterval +`func (o *DAG) UnsetScheduleInterval()` -UnsetNextDagrun ensures that no value is present for NextDagrun, not even an explicit nil -### GetNextDagrunDataIntervalStart +UnsetScheduleInterval ensures that no value is present for ScheduleInterval, not even an explicit nil +### GetSchedulerLock -`func (o *DAG) GetNextDagrunDataIntervalStart() time.Time` +`func (o *DAG) GetSchedulerLock() bool` -GetNextDagrunDataIntervalStart returns the NextDagrunDataIntervalStart field if non-nil, zero value otherwise. +GetSchedulerLock returns the SchedulerLock field if non-nil, zero value otherwise. -### GetNextDagrunDataIntervalStartOk +### GetSchedulerLockOk -`func (o *DAG) GetNextDagrunDataIntervalStartOk() (*time.Time, bool)` +`func (o *DAG) GetSchedulerLockOk() (*bool, bool)` -GetNextDagrunDataIntervalStartOk returns a tuple with the NextDagrunDataIntervalStart field if it's non-nil, zero value otherwise +GetSchedulerLockOk returns a tuple with the SchedulerLock field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetNextDagrunDataIntervalStart +### SetSchedulerLock -`func (o *DAG) SetNextDagrunDataIntervalStart(v time.Time)` +`func (o *DAG) SetSchedulerLock(v bool)` -SetNextDagrunDataIntervalStart sets NextDagrunDataIntervalStart field to given value. +SetSchedulerLock sets SchedulerLock field to given value. -### HasNextDagrunDataIntervalStart +### HasSchedulerLock -`func (o *DAG) HasNextDagrunDataIntervalStart() bool` +`func (o *DAG) HasSchedulerLock() bool` -HasNextDagrunDataIntervalStart returns a boolean if a field has been set. +HasSchedulerLock returns a boolean if a field has been set. -### SetNextDagrunDataIntervalStartNil +### SetSchedulerLockNil -`func (o *DAG) SetNextDagrunDataIntervalStartNil(b bool)` +`func (o *DAG) SetSchedulerLockNil(b bool)` - SetNextDagrunDataIntervalStartNil sets the value for NextDagrunDataIntervalStart to be an explicit nil + SetSchedulerLockNil sets the value for SchedulerLock to be an explicit nil -### UnsetNextDagrunDataIntervalStart -`func (o *DAG) UnsetNextDagrunDataIntervalStart()` +### UnsetSchedulerLock +`func (o *DAG) UnsetSchedulerLock()` -UnsetNextDagrunDataIntervalStart ensures that no value is present for NextDagrunDataIntervalStart, not even an explicit nil -### GetNextDagrunDataIntervalEnd +UnsetSchedulerLock ensures that no value is present for SchedulerLock, not even an explicit nil +### GetTags -`func (o *DAG) GetNextDagrunDataIntervalEnd() time.Time` +`func (o *DAG) GetTags() []Tag` -GetNextDagrunDataIntervalEnd returns the NextDagrunDataIntervalEnd field if non-nil, zero value otherwise. +GetTags returns the Tags field if non-nil, zero value otherwise. -### GetNextDagrunDataIntervalEndOk +### GetTagsOk -`func (o *DAG) GetNextDagrunDataIntervalEndOk() (*time.Time, bool)` +`func (o *DAG) GetTagsOk() (*[]Tag, bool)` -GetNextDagrunDataIntervalEndOk returns a tuple with the NextDagrunDataIntervalEnd field if it's non-nil, zero value otherwise +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetNextDagrunDataIntervalEnd +### SetTags -`func (o *DAG) SetNextDagrunDataIntervalEnd(v time.Time)` +`func (o *DAG) SetTags(v []Tag)` -SetNextDagrunDataIntervalEnd sets NextDagrunDataIntervalEnd field to given value. +SetTags sets Tags field to given value. -### HasNextDagrunDataIntervalEnd +### HasTags -`func (o *DAG) HasNextDagrunDataIntervalEnd() bool` +`func (o *DAG) HasTags() bool` -HasNextDagrunDataIntervalEnd returns a boolean if a field has been set. +HasTags returns a boolean if a field has been set. -### SetNextDagrunDataIntervalEndNil +### SetTagsNil -`func (o *DAG) SetNextDagrunDataIntervalEndNil(b bool)` +`func (o *DAG) SetTagsNil(b bool)` - SetNextDagrunDataIntervalEndNil sets the value for NextDagrunDataIntervalEnd to be an explicit nil + SetTagsNil sets the value for Tags to be an explicit nil -### UnsetNextDagrunDataIntervalEnd -`func (o *DAG) UnsetNextDagrunDataIntervalEnd()` +### UnsetTags +`func (o *DAG) UnsetTags()` -UnsetNextDagrunDataIntervalEnd ensures that no value is present for NextDagrunDataIntervalEnd, not even an explicit nil -### GetNextDagrunCreateAfter +UnsetTags ensures that no value is present for Tags, not even an explicit nil +### GetTimetableDescription -`func (o *DAG) GetNextDagrunCreateAfter() time.Time` +`func (o *DAG) GetTimetableDescription() string` -GetNextDagrunCreateAfter returns the NextDagrunCreateAfter field if non-nil, zero value otherwise. +GetTimetableDescription returns the TimetableDescription field if non-nil, zero value otherwise. -### GetNextDagrunCreateAfterOk +### GetTimetableDescriptionOk -`func (o *DAG) GetNextDagrunCreateAfterOk() (*time.Time, bool)` +`func (o *DAG) GetTimetableDescriptionOk() (*string, bool)` -GetNextDagrunCreateAfterOk returns a tuple with the NextDagrunCreateAfter field if it's non-nil, zero value otherwise +GetTimetableDescriptionOk returns a tuple with the TimetableDescription field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetNextDagrunCreateAfter +### SetTimetableDescription -`func (o *DAG) SetNextDagrunCreateAfter(v time.Time)` +`func (o *DAG) SetTimetableDescription(v string)` -SetNextDagrunCreateAfter sets NextDagrunCreateAfter field to given value. +SetTimetableDescription sets TimetableDescription field to given value. -### HasNextDagrunCreateAfter +### HasTimetableDescription -`func (o *DAG) HasNextDagrunCreateAfter() bool` +`func (o *DAG) HasTimetableDescription() bool` -HasNextDagrunCreateAfter returns a boolean if a field has been set. +HasTimetableDescription returns a boolean if a field has been set. -### SetNextDagrunCreateAfterNil +### SetTimetableDescriptionNil -`func (o *DAG) SetNextDagrunCreateAfterNil(b bool)` +`func (o *DAG) SetTimetableDescriptionNil(b bool)` - SetNextDagrunCreateAfterNil sets the value for NextDagrunCreateAfter to be an explicit nil + SetTimetableDescriptionNil sets the value for TimetableDescription to be an explicit nil -### UnsetNextDagrunCreateAfter -`func (o *DAG) UnsetNextDagrunCreateAfter()` +### UnsetTimetableDescription +`func (o *DAG) UnsetTimetableDescription()` -UnsetNextDagrunCreateAfter ensures that no value is present for NextDagrunCreateAfter, not even an explicit nil +UnsetTimetableDescription ensures that no value is present for TimetableDescription, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/DAGApi.md b/airflow/docs/DAGApi.md index 4de7eb7..9c45900 100644 --- a/airflow/docs/DAGApi.md +++ b/airflow/docs/DAGApi.md @@ -1,41 +1,21 @@ - - -# \DAGApi - -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**DeleteDag**](DAGApi.md#DeleteDag) | **Delete** /dags/{dag_id} | Delete a DAG -[**GetDag**](DAGApi.md#GetDag) | **Get** /dags/{dag_id} | Get basic information about a DAG -[**GetDagDetails**](DAGApi.md#GetDagDetails) | **Get** /dags/{dag_id}/details | Get a simplified representation of DAG -[**GetDagSource**](DAGApi.md#GetDagSource) | **Get** /dagSources/{file_token} | Get a source code -[**GetDags**](DAGApi.md#GetDags) | **Get** /dags | List DAGs -[**GetTask**](DAGApi.md#GetTask) | **Get** /dags/{dag_id}/tasks/{task_id} | Get simplified representation of a task -[**GetTasks**](DAGApi.md#GetTasks) | **Get** /dags/{dag_id}/tasks | Get tasks for DAG -[**PatchDag**](DAGApi.md#PatchDag) | **Patch** /dags/{dag_id} | Update a DAG -[**PatchDags**](DAGApi.md#PatchDags) | **Patch** /dags | Update DAGs -[**PostClearTaskInstances**](DAGApi.md#PostClearTaskInstances) | **Post** /dags/{dag_id}/clearTaskInstances | Clear a set of task instances -[**PostSetTaskInstancesState**](DAGApi.md#PostSetTaskInstancesState) | **Post** /dags/{dag_id}/updateTaskInstancesState | Set a state of task instances -[**SetMappedTaskInstanceNote**](DAGApi.md#SetMappedTaskInstanceNote) | **Patch** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}/setNote | Update the TaskInstance note. -[**SetTaskInstanceNote**](DAGApi.md#SetTaskInstanceNote) | **Patch** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/setNote | Update the TaskInstance note. +[**DeleteDag**](DAGAPI.md#DeleteDag) | **Delete** /dags/{dag_id} | Delete a DAG +[**GetDag**](DAGAPI.md#GetDag) | **Get** /dags/{dag_id} | Get basic information about a DAG +[**GetDagDetails**](DAGAPI.md#GetDagDetails) | **Get** /dags/{dag_id}/details | Get a simplified representation of DAG +[**GetDagSource**](DAGAPI.md#GetDagSource) | **Get** /dagSources/{file_token} | Get a source code +[**GetDags**](DAGAPI.md#GetDags) | **Get** /dags | List DAGs +[**GetTask**](DAGAPI.md#GetTask) | **Get** /dags/{dag_id}/tasks/{task_id} | Get simplified representation of a task +[**GetTasks**](DAGAPI.md#GetTasks) | **Get** /dags/{dag_id}/tasks | Get tasks for DAG +[**PatchDag**](DAGAPI.md#PatchDag) | **Patch** /dags/{dag_id} | Update a DAG +[**PatchDags**](DAGAPI.md#PatchDags) | **Patch** /dags | Update DAGs +[**PostClearTaskInstances**](DAGAPI.md#PostClearTaskInstances) | **Post** /dags/{dag_id}/clearTaskInstances | Clear a set of task instances +[**PostSetTaskInstancesState**](DAGAPI.md#PostSetTaskInstancesState) | **Post** /dags/{dag_id}/updateTaskInstancesState | Set a state of task instances +[**ReparseDagFile**](DAGAPI.md#ReparseDagFile) | **Put** /parseDagFile/{file_token} | Request re-parsing of a DAG file @@ -53,22 +33,22 @@ Delete a DAG package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DAGApi.DeleteDag(context.Background(), dagId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DAGApi.DeleteDag``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + dagId := "dagId_example" // string | The DAG ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.DAGAPI.DeleteDag(context.Background(), dagId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DAGAPI.DeleteDag``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -95,7 +75,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -109,7 +89,7 @@ Name | Type | Description | Notes ## GetDag -> DAG GetDag(ctx, dagId).Execute() +> DAG GetDag(ctx, dagId).Fields(fields).Execute() Get basic information about a DAG @@ -121,24 +101,25 @@ Get basic information about a DAG package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DAGApi.GetDag(context.Background(), dagId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DAGApi.GetDag``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetDag`: DAG - fmt.Fprintf(os.Stdout, "Response from `DAGApi.GetDag`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + fields := []string{"Inner_example"} // []string | List of field for return. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DAGAPI.GetDag(context.Background(), dagId).Fields(fields).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DAGAPI.GetDag``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetDag`: DAG + fmt.Fprintf(os.Stdout, "Response from `DAGAPI.GetDag`: %v\n", resp) } ``` @@ -158,6 +139,7 @@ Other parameters are passed through a pointer to a apiGetDagRequest struct via t Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **fields** | **[]string** | List of field for return. | ### Return type @@ -165,7 +147,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -179,7 +161,7 @@ Name | Type | Description | Notes ## GetDagDetails -> DAGDetail GetDagDetails(ctx, dagId).Execute() +> DAGDetail GetDagDetails(ctx, dagId).Fields(fields).Execute() Get a simplified representation of DAG @@ -191,24 +173,25 @@ Get a simplified representation of DAG package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DAGApi.GetDagDetails(context.Background(), dagId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DAGApi.GetDagDetails``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetDagDetails`: DAGDetail - fmt.Fprintf(os.Stdout, "Response from `DAGApi.GetDagDetails`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + fields := []string{"Inner_example"} // []string | List of field for return. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DAGAPI.GetDagDetails(context.Background(), dagId).Fields(fields).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DAGAPI.GetDagDetails``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetDagDetails`: DAGDetail + fmt.Fprintf(os.Stdout, "Response from `DAGAPI.GetDagDetails`: %v\n", resp) } ``` @@ -228,6 +211,7 @@ Other parameters are passed through a pointer to a apiGetDagDetailsRequest struc Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **fields** | **[]string** | List of field for return. | ### Return type @@ -235,7 +219,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -249,7 +233,7 @@ Name | Type | Description | Notes ## GetDagSource -> InlineResponse2001 GetDagSource(ctx, fileToken).Execute() +> GetDagSource200Response GetDagSource(ctx, fileToken).Execute() Get a source code @@ -261,24 +245,24 @@ Get a source code package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - fileToken := "fileToken_example" // string | The key containing the encrypted path to the file. Encryption and decryption take place only on the server. This prevents the client from reading an non-DAG file. This also ensures API extensibility, because the format of encrypted data may change. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DAGApi.GetDagSource(context.Background(), fileToken).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DAGApi.GetDagSource``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetDagSource`: InlineResponse2001 - fmt.Fprintf(os.Stdout, "Response from `DAGApi.GetDagSource`: %v\n", resp) + fileToken := "fileToken_example" // string | The key containing the encrypted path to the file. Encryption and decryption take place only on the server. This prevents the client from reading an non-DAG file. This also ensures API extensibility, because the format of encrypted data may change. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DAGAPI.GetDagSource(context.Background(), fileToken).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DAGAPI.GetDagSource``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetDagSource`: GetDagSource200Response + fmt.Fprintf(os.Stdout, "Response from `DAGAPI.GetDagSource`: %v\n", resp) } ``` @@ -301,16 +285,16 @@ Name | Type | Description | Notes ### Return type -[**InlineResponse2001**](InlineResponse2001.md) +[**GetDagSource200Response**](GetDagSource200Response.md) ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json, plain/text +- **Accept**: application/json, text/plain [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) @@ -319,7 +303,7 @@ Name | Type | Description | Notes ## GetDags -> DAGCollection GetDags(ctx).Limit(limit).Offset(offset).OrderBy(orderBy).Tags(tags).OnlyActive(onlyActive).DagIdPattern(dagIdPattern).Execute() +> DAGCollection GetDags(ctx).Limit(limit).Offset(offset).OrderBy(orderBy).Tags(tags).OnlyActive(onlyActive).Paused(paused).Fields(fields).DagIdPattern(dagIdPattern).Execute() List DAGs @@ -331,29 +315,31 @@ List DAGs package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) - offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) - orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) - tags := []string{"Inner_example"} // []string | List of tags to filter results. *New in version 2.2.0* (optional) - onlyActive := true // bool | Only filter active DAGs. *New in version 2.1.1* (optional) (default to true) - dagIdPattern := "dagIdPattern_example" // string | If set, only return DAGs with dag_ids matching this pattern. (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DAGApi.GetDags(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).Tags(tags).OnlyActive(onlyActive).DagIdPattern(dagIdPattern).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DAGApi.GetDags``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetDags`: DAGCollection - fmt.Fprintf(os.Stdout, "Response from `DAGApi.GetDags`: %v\n", resp) + limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) + offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) + orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) + tags := []string{"Inner_example"} // []string | List of tags to filter results. *New in version 2.2.0* (optional) + onlyActive := true // bool | Only filter active DAGs. *New in version 2.1.1* (optional) (default to true) + paused := true // bool | Only filter paused/unpaused DAGs. If absent or null, it returns paused and unpaused DAGs. *New in version 2.6.0* (optional) + fields := []string{"Inner_example"} // []string | List of field for return. (optional) + dagIdPattern := "dagIdPattern_example" // string | If set, only return DAGs with dag_ids matching this pattern. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DAGAPI.GetDags(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).Tags(tags).OnlyActive(onlyActive).Paused(paused).Fields(fields).DagIdPattern(dagIdPattern).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DAGAPI.GetDags``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetDags`: DAGCollection + fmt.Fprintf(os.Stdout, "Response from `DAGAPI.GetDags`: %v\n", resp) } ``` @@ -373,6 +359,8 @@ Name | Type | Description | Notes **orderBy** | **string** | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* | **tags** | **[]string** | List of tags to filter results. *New in version 2.2.0* | **onlyActive** | **bool** | Only filter active DAGs. *New in version 2.1.1* | [default to true] + **paused** | **bool** | Only filter paused/unpaused DAGs. If absent or null, it returns paused and unpaused DAGs. *New in version 2.6.0* | + **fields** | **[]string** | List of field for return. | **dagIdPattern** | **string** | If set, only return DAGs with dag_ids matching this pattern. | ### Return type @@ -381,7 +369,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -405,25 +393,25 @@ Get simplified representation of a task package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - taskId := "taskId_example" // string | The task ID. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DAGApi.GetTask(context.Background(), dagId, taskId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DAGApi.GetTask``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetTask`: Task - fmt.Fprintf(os.Stdout, "Response from `DAGApi.GetTask`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + taskId := "taskId_example" // string | The task ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DAGAPI.GetTask(context.Background(), dagId, taskId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DAGAPI.GetTask``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetTask`: Task + fmt.Fprintf(os.Stdout, "Response from `DAGAPI.GetTask`: %v\n", resp) } ``` @@ -452,7 +440,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -476,25 +464,25 @@ Get tasks for DAG package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DAGApi.GetTasks(context.Background(), dagId).OrderBy(orderBy).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DAGApi.GetTasks``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetTasks`: TaskCollection - fmt.Fprintf(os.Stdout, "Response from `DAGApi.GetTasks`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DAGAPI.GetTasks(context.Background(), dagId).OrderBy(orderBy).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DAGAPI.GetTasks``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetTasks`: TaskCollection + fmt.Fprintf(os.Stdout, "Response from `DAGAPI.GetTasks`: %v\n", resp) } ``` @@ -522,7 +510,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -546,26 +534,26 @@ Update a DAG package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - dAG := *openapiclient.NewDAG() // DAG | - updateMask := []string{"Inner_example"} // []string | The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DAGApi.PatchDag(context.Background(), dagId).DAG(dAG).UpdateMask(updateMask).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DAGApi.PatchDag``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PatchDag`: DAG - fmt.Fprintf(os.Stdout, "Response from `DAGApi.PatchDag`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + dAG := *openapiclient.NewDAG() // DAG | + updateMask := []string{"Inner_example"} // []string | The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DAGAPI.PatchDag(context.Background(), dagId).DAG(dAG).UpdateMask(updateMask).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DAGAPI.PatchDag``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PatchDag`: DAG + fmt.Fprintf(os.Stdout, "Response from `DAGAPI.PatchDag`: %v\n", resp) } ``` @@ -594,7 +582,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -620,30 +608,30 @@ Update DAGs package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagIdPattern := "dagIdPattern_example" // string | If set, only update DAGs with dag_ids matching this pattern. - dAG := *openapiclient.NewDAG() // DAG | - limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) - offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) - tags := []string{"Inner_example"} // []string | List of tags to filter results. *New in version 2.2.0* (optional) - updateMask := []string{"Inner_example"} // []string | The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. (optional) - onlyActive := true // bool | Only filter active DAGs. *New in version 2.1.1* (optional) (default to true) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DAGApi.PatchDags(context.Background()).DagIdPattern(dagIdPattern).DAG(dAG).Limit(limit).Offset(offset).Tags(tags).UpdateMask(updateMask).OnlyActive(onlyActive).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DAGApi.PatchDags``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PatchDags`: DAGCollection - fmt.Fprintf(os.Stdout, "Response from `DAGApi.PatchDags`: %v\n", resp) + dagIdPattern := "dagIdPattern_example" // string | If set, only update DAGs with dag_ids matching this pattern. + dAG := *openapiclient.NewDAG() // DAG | + limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) + offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) + tags := []string{"Inner_example"} // []string | List of tags to filter results. *New in version 2.2.0* (optional) + updateMask := []string{"Inner_example"} // []string | The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. (optional) + onlyActive := true // bool | Only filter active DAGs. *New in version 2.1.1* (optional) (default to true) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DAGAPI.PatchDags(context.Background()).DagIdPattern(dagIdPattern).DAG(dAG).Limit(limit).Offset(offset).Tags(tags).UpdateMask(updateMask).OnlyActive(onlyActive).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DAGAPI.PatchDags``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PatchDags`: DAGCollection + fmt.Fprintf(os.Stdout, "Response from `DAGAPI.PatchDags`: %v\n", resp) } ``` @@ -672,7 +660,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -698,25 +686,25 @@ Clear a set of task instances package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - clearTaskInstances := *openapiclient.NewClearTaskInstances() // ClearTaskInstances | Parameters of action - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DAGApi.PostClearTaskInstances(context.Background(), dagId).ClearTaskInstances(clearTaskInstances).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DAGApi.PostClearTaskInstances``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PostClearTaskInstances`: TaskInstanceReferenceCollection - fmt.Fprintf(os.Stdout, "Response from `DAGApi.PostClearTaskInstances`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + clearTaskInstances := *openapiclient.NewClearTaskInstances() // ClearTaskInstances | Parameters of action + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DAGAPI.PostClearTaskInstances(context.Background(), dagId).ClearTaskInstances(clearTaskInstances).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DAGAPI.PostClearTaskInstances``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PostClearTaskInstances`: TaskInstanceReferenceCollection + fmt.Fprintf(os.Stdout, "Response from `DAGAPI.PostClearTaskInstances`: %v\n", resp) } ``` @@ -744,7 +732,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -770,25 +758,25 @@ Set a state of task instances package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - updateTaskInstancesState := *openapiclient.NewUpdateTaskInstancesState() // UpdateTaskInstancesState | Parameters of action - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DAGApi.PostSetTaskInstancesState(context.Background(), dagId).UpdateTaskInstancesState(updateTaskInstancesState).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DAGApi.PostSetTaskInstancesState``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PostSetTaskInstancesState`: TaskInstanceReferenceCollection - fmt.Fprintf(os.Stdout, "Response from `DAGApi.PostSetTaskInstancesState`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + updateTaskInstancesState := *openapiclient.NewUpdateTaskInstancesState() // UpdateTaskInstancesState | Parameters of action + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DAGAPI.PostSetTaskInstancesState(context.Background(), dagId).UpdateTaskInstancesState(updateTaskInstancesState).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DAGAPI.PostSetTaskInstancesState``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PostSetTaskInstancesState`: TaskInstanceReferenceCollection + fmt.Fprintf(os.Stdout, "Response from `DAGAPI.PostSetTaskInstancesState`: %v\n", resp) } ``` @@ -816,88 +804,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## SetMappedTaskInstanceNote - -> TaskInstance SetMappedTaskInstanceNote(ctx, dagId, dagRunId, taskId, mapIndex).SetTaskInstanceNote(setTaskInstanceNote).Execute() - -Update the TaskInstance note. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - dagId := "dagId_example" // string | The DAG ID. - dagRunId := "dagRunId_example" // string | The DAG run ID. - taskId := "taskId_example" // string | The task ID. - mapIndex := int32(56) // int32 | The map index. - setTaskInstanceNote := *openapiclient.NewSetTaskInstanceNote("Note_example") // SetTaskInstanceNote | Parameters of set Task Instance note. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DAGApi.SetMappedTaskInstanceNote(context.Background(), dagId, dagRunId, taskId, mapIndex).SetTaskInstanceNote(setTaskInstanceNote).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DAGApi.SetMappedTaskInstanceNote``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `SetMappedTaskInstanceNote`: TaskInstance - fmt.Fprintf(os.Stdout, "Response from `DAGApi.SetMappedTaskInstanceNote`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**dagId** | **string** | The DAG ID. | -**dagRunId** | **string** | The DAG run ID. | -**taskId** | **string** | The task ID. | -**mapIndex** | **int32** | The map index. | - -### Other Parameters - -Other parameters are passed through a pointer to a apiSetMappedTaskInstanceNoteRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - - - **setTaskInstanceNote** | [**SetTaskInstanceNote**](SetTaskInstanceNote.md) | Parameters of set Task Instance note. | - -### Return type - -[**TaskInstance**](TaskInstance.md) - -### Authorization - -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -909,11 +816,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## SetTaskInstanceNote +## ReparseDagFile -> TaskInstance SetTaskInstanceNote(ctx, dagId, dagRunId, taskId).SetTaskInstanceNote(setTaskInstanceNote).Execute() +> ReparseDagFile(ctx, fileToken).Execute() -Update the TaskInstance note. +Request re-parsing of a DAG file @@ -923,27 +830,22 @@ Update the TaskInstance note. package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - dagRunId := "dagRunId_example" // string | The DAG run ID. - taskId := "taskId_example" // string | The task ID. - setTaskInstanceNote := *openapiclient.NewSetTaskInstanceNote("Note_example") // SetTaskInstanceNote | Parameters of set Task Instance note. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DAGApi.SetTaskInstanceNote(context.Background(), dagId, dagRunId, taskId).SetTaskInstanceNote(setTaskInstanceNote).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DAGApi.SetTaskInstanceNote``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `SetTaskInstanceNote`: TaskInstance - fmt.Fprintf(os.Stdout, "Response from `DAGApi.SetTaskInstanceNote`: %v\n", resp) + fileToken := "fileToken_example" // string | The key containing the encrypted path to the file. Encryption and decryption take place only on the server. This prevents the client from reading an non-DAG file. This also ensures API extensibility, because the format of encrypted data may change. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.DAGAPI.ReparseDagFile(context.Background(), fileToken).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DAGAPI.ReparseDagFile``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -953,33 +855,28 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**dagId** | **string** | The DAG ID. | -**dagRunId** | **string** | The DAG run ID. | -**taskId** | **string** | The task ID. | +**fileToken** | **string** | The key containing the encrypted path to the file. Encryption and decryption take place only on the server. This prevents the client from reading an non-DAG file. This also ensures API extensibility, because the format of encrypted data may change. | ### Other Parameters -Other parameters are passed through a pointer to a apiSetTaskInstanceNoteRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiReparseDagFileRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - **setTaskInstanceNote** | [**SetTaskInstanceNote**](SetTaskInstanceNote.md) | Parameters of set Task Instance note. | - ### Return type -[**TaskInstance**](TaskInstance.md) + (empty response body) ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) diff --git a/airflow/docs/DAGCollection.md b/airflow/docs/DAGCollection.md index 5ba0a13..ce5110c 100644 --- a/airflow/docs/DAGCollection.md +++ b/airflow/docs/DAGCollection.md @@ -1,30 +1,11 @@ - - # DAGCollection ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] **Dags** | Pointer to [**[]DAG**](DAG.md) | | [optional] -**TotalEntries** | Pointer to **int32** | Count of objects in the current result set. | [optional] ## Methods @@ -45,55 +26,55 @@ NewDAGCollectionWithDefaults instantiates a new DAGCollection object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetDags +### GetTotalEntries -`func (o *DAGCollection) GetDags() []DAG` +`func (o *DAGCollection) GetTotalEntries() int32` -GetDags returns the Dags field if non-nil, zero value otherwise. +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. -### GetDagsOk +### GetTotalEntriesOk -`func (o *DAGCollection) GetDagsOk() (*[]DAG, bool)` +`func (o *DAGCollection) GetTotalEntriesOk() (*int32, bool)` -GetDagsOk returns a tuple with the Dags field if it's non-nil, zero value otherwise +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDags +### SetTotalEntries -`func (o *DAGCollection) SetDags(v []DAG)` +`func (o *DAGCollection) SetTotalEntries(v int32)` -SetDags sets Dags field to given value. +SetTotalEntries sets TotalEntries field to given value. -### HasDags +### HasTotalEntries -`func (o *DAGCollection) HasDags() bool` +`func (o *DAGCollection) HasTotalEntries() bool` -HasDags returns a boolean if a field has been set. +HasTotalEntries returns a boolean if a field has been set. -### GetTotalEntries +### GetDags -`func (o *DAGCollection) GetTotalEntries() int32` +`func (o *DAGCollection) GetDags() []DAG` -GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. +GetDags returns the Dags field if non-nil, zero value otherwise. -### GetTotalEntriesOk +### GetDagsOk -`func (o *DAGCollection) GetTotalEntriesOk() (*int32, bool)` +`func (o *DAGCollection) GetDagsOk() (*[]DAG, bool)` -GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +GetDagsOk returns a tuple with the Dags field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTotalEntries +### SetDags -`func (o *DAGCollection) SetTotalEntries(v int32)` +`func (o *DAGCollection) SetDags(v []DAG)` -SetTotalEntries sets TotalEntries field to given value. +SetDags sets Dags field to given value. -### HasTotalEntries +### HasDags -`func (o *DAGCollection) HasTotalEntries() bool` +`func (o *DAGCollection) HasDags() bool` -HasTotalEntries returns a boolean if a field has been set. +HasDags returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/DAGDetail.md b/airflow/docs/DAGDetail.md index 7e4c9ed..00c073d 100644 --- a/airflow/docs/DAGDetail.md +++ b/airflow/docs/DAGDetail.md @@ -1,67 +1,51 @@ - - # DAGDetail ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**DagDisplayName** | Pointer to **string** | Human centric display text for the DAG. *New in version 2.9.0* | [optional] [readonly] **DagId** | Pointer to **string** | The ID of the DAG. | [optional] [readonly] -**RootDagId** | Pointer to **NullableString** | If the DAG is SubDAG then it is the top level DAG identifier. Otherwise, null. | [optional] [readonly] -**IsPaused** | Pointer to **NullableBool** | Whether the DAG is paused. | [optional] +**DefaultView** | Pointer to **NullableString** | | [optional] [readonly] +**Description** | Pointer to **NullableString** | User-provided DAG description, which can consist of several sentences or paragraphs that describe DAG contents. | [optional] [readonly] +**FileToken** | Pointer to **string** | The key containing the encrypted path to the file. Encryption and decryption take place only on the server. This prevents the client from reading an non-DAG file. This also ensures API extensibility, because the format of encrypted data may change. | [optional] [readonly] +**Fileloc** | Pointer to **string** | The absolute path to the file. | [optional] [readonly] +**HasImportErrors** | Pointer to **NullableBool** | Whether the DAG has import errors *New in version 2.3.0* | [optional] [readonly] +**HasTaskConcurrencyLimits** | Pointer to **NullableBool** | Whether the DAG has task concurrency limits *New in version 2.3.0* | [optional] [readonly] **IsActive** | Pointer to **NullableBool** | Whether the DAG is currently seen by the scheduler(s). *New in version 2.1.1* *Changed in version 2.2.0*&#58; Field is read-only. | [optional] [readonly] +**IsPaused** | Pointer to **NullableBool** | Whether the DAG is paused. | [optional] **IsSubdag** | Pointer to **bool** | Whether the DAG is SubDAG. | [optional] [readonly] +**LastExpired** | Pointer to **NullableTime** | Time when the DAG last received a refresh signal (e.g. the DAG's \"refresh\" button was clicked in the web UI) *New in version 2.3.0* | [optional] [readonly] **LastParsedTime** | Pointer to **NullableTime** | The last time the DAG was parsed. *New in version 2.3.0* | [optional] [readonly] **LastPickled** | Pointer to **NullableTime** | The last time the DAG was pickled. *New in version 2.3.0* | [optional] [readonly] -**LastExpired** | Pointer to **NullableTime** | Time when the DAG last received a refresh signal (e.g. the DAG's \"refresh\" button was clicked in the web UI) *New in version 2.3.0* | [optional] [readonly] -**SchedulerLock** | Pointer to **NullableBool** | Whether (one of) the scheduler is scheduling this DAG at the moment *New in version 2.3.0* | [optional] [readonly] -**PickleId** | Pointer to **NullableString** | Foreign key to the latest pickle_id *New in version 2.3.0* | [optional] [readonly] -**DefaultView** | Pointer to **string** | | [optional] [readonly] -**Fileloc** | Pointer to **string** | The absolute path to the file. | [optional] [readonly] -**FileToken** | Pointer to **string** | The key containing the encrypted path to the file. Encryption and decryption take place only on the server. This prevents the client from reading an non-DAG file. This also ensures API extensibility, because the format of encrypted data may change. | [optional] [readonly] -**Owners** | Pointer to **[]string** | | [optional] [readonly] -**Description** | Pointer to **NullableString** | User-provided DAG description, which can consist of several sentences or paragraphs that describe DAG contents. | [optional] [readonly] -**ScheduleInterval** | Pointer to [**NullableScheduleInterval**](ScheduleInterval.md) | | [optional] -**TimetableDescription** | Pointer to **NullableString** | Timetable/Schedule Interval description. *New in version 2.3.0* | [optional] [readonly] -**Tags** | Pointer to [**[]Tag**](Tag.md) | List of tags. | [optional] [readonly] -**MaxActiveTasks** | Pointer to **NullableInt32** | Maximum number of active tasks that can be run on the DAG *New in version 2.3.0* | [optional] [readonly] **MaxActiveRuns** | Pointer to **NullableInt32** | Maximum number of active DAG runs for the DAG *New in version 2.3.0* | [optional] [readonly] -**HasTaskConcurrencyLimits** | Pointer to **NullableBool** | Whether the DAG has task concurrency limits *New in version 2.3.0* | [optional] [readonly] -**HasImportErrors** | Pointer to **NullableBool** | Whether the DAG has import errors *New in version 2.3.0* | [optional] [readonly] +**MaxActiveTasks** | Pointer to **NullableInt32** | Maximum number of active tasks that can be run on the DAG *New in version 2.3.0* | [optional] [readonly] +**MaxConsecutiveFailedDagRuns** | Pointer to **NullableInt32** | (experimental) The maximum number of consecutive DAG failures before DAG is automatically paused. *New in version 2.9.0* | [optional] [readonly] **NextDagrun** | Pointer to **NullableTime** | The logical date of the next dag run. *New in version 2.3.0* | [optional] [readonly] -**NextDagrunDataIntervalStart** | Pointer to **NullableTime** | The start of the interval of the next dag run. *New in version 2.3.0* | [optional] [readonly] -**NextDagrunDataIntervalEnd** | Pointer to **NullableTime** | The end of the interval of the next dag run. *New in version 2.3.0* | [optional] [readonly] **NextDagrunCreateAfter** | Pointer to **NullableTime** | Earliest time at which this ``next_dagrun`` can be created. *New in version 2.3.0* | [optional] [readonly] -**Timezone** | Pointer to **string** | | [optional] -**Catchup** | Pointer to **bool** | | [optional] [readonly] -**Orientation** | Pointer to **string** | | [optional] [readonly] -**Concurrency** | Pointer to **float32** | | [optional] [readonly] -**StartDate** | Pointer to **NullableTime** | The DAG's start date. *Changed in version 2.0.1*&#58; Field becomes nullable. | [optional] [readonly] -**DagRunTimeout** | Pointer to [**TimeDelta**](TimeDelta.md) | | [optional] +**NextDagrunDataIntervalEnd** | Pointer to **NullableTime** | The end of the interval of the next dag run. *New in version 2.3.0* | [optional] [readonly] +**NextDagrunDataIntervalStart** | Pointer to **NullableTime** | The start of the interval of the next dag run. *New in version 2.3.0* | [optional] [readonly] +**Owners** | Pointer to **[]string** | | [optional] [readonly] +**PickleId** | Pointer to **NullableString** | Foreign key to the latest pickle_id *New in version 2.3.0* | [optional] [readonly] +**RootDagId** | Pointer to **NullableString** | If the DAG is SubDAG then it is the top level DAG identifier. Otherwise, null. | [optional] [readonly] +**ScheduleInterval** | Pointer to [**NullableScheduleInterval**](ScheduleInterval.md) | | [optional] +**SchedulerLock** | Pointer to **NullableBool** | Whether (one of) the scheduler is scheduling this DAG at the moment *New in version 2.3.0* | [optional] [readonly] +**Tags** | Pointer to [**[]Tag**](Tag.md) | List of tags. | [optional] [readonly] +**TimetableDescription** | Pointer to **NullableString** | Timetable/Schedule Interval description. *New in version 2.3.0* | [optional] [readonly] +**Catchup** | Pointer to **NullableBool** | | [optional] [readonly] +**Concurrency** | Pointer to **NullableFloat32** | | [optional] [readonly] +**DagRunTimeout** | Pointer to [**NullableTimeDelta**](TimeDelta.md) | | [optional] +**DatasetExpression** | Pointer to **map[string]interface{}** | Nested dataset any/all conditions | [optional] **DocMd** | Pointer to **NullableString** | | [optional] [readonly] -**Params** | Pointer to **map[string]interface{}** | User-specified DAG params. *New in version 2.0.1* | [optional] [readonly] **EndDate** | Pointer to **NullableTime** | The DAG's end date. *New in version 2.3.0*. | [optional] [readonly] **IsPausedUponCreation** | Pointer to **NullableBool** | Whether the DAG is paused upon creation. *New in version 2.3.0* | [optional] [readonly] **LastParsed** | Pointer to **NullableTime** | The last time the DAG was parsed. *New in version 2.3.0* | [optional] [readonly] -**TemplateSearchPath** | Pointer to **[]string** | The template search path. *New in version 2.3.0* | [optional] +**Orientation** | Pointer to **NullableString** | | [optional] [readonly] +**Params** | Pointer to **map[string]interface{}** | User-specified DAG params. *New in version 2.0.1* | [optional] [readonly] **RenderTemplateAsNativeObj** | Pointer to **NullableBool** | Whether to render templates as native Python objects. *New in version 2.3.0* | [optional] [readonly] +**StartDate** | Pointer to **NullableTime** | The DAG's start date. *Changed in version 2.0.1*&#58; Field becomes nullable. | [optional] [readonly] +**TemplateSearchPath** | Pointer to **[]string** | The template search path. *New in version 2.3.0* | [optional] +**Timezone** | Pointer to **string** | | [optional] ## Methods @@ -82,6 +66,31 @@ NewDAGDetailWithDefaults instantiates a new DAGDetail object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set +### GetDagDisplayName + +`func (o *DAGDetail) GetDagDisplayName() string` + +GetDagDisplayName returns the DagDisplayName field if non-nil, zero value otherwise. + +### GetDagDisplayNameOk + +`func (o *DAGDetail) GetDagDisplayNameOk() (*string, bool)` + +GetDagDisplayNameOk returns a tuple with the DagDisplayName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDagDisplayName + +`func (o *DAGDetail) SetDagDisplayName(v string)` + +SetDagDisplayName sets DagDisplayName field to given value. + +### HasDagDisplayName + +`func (o *DAGDetail) HasDagDisplayName() bool` + +HasDagDisplayName returns a boolean if a field has been set. + ### GetDagId `func (o *DAGDetail) GetDagId() string` @@ -107,856 +116,876 @@ SetDagId sets DagId field to given value. HasDagId returns a boolean if a field has been set. -### GetRootDagId +### GetDefaultView -`func (o *DAGDetail) GetRootDagId() string` +`func (o *DAGDetail) GetDefaultView() string` -GetRootDagId returns the RootDagId field if non-nil, zero value otherwise. +GetDefaultView returns the DefaultView field if non-nil, zero value otherwise. -### GetRootDagIdOk +### GetDefaultViewOk -`func (o *DAGDetail) GetRootDagIdOk() (*string, bool)` +`func (o *DAGDetail) GetDefaultViewOk() (*string, bool)` -GetRootDagIdOk returns a tuple with the RootDagId field if it's non-nil, zero value otherwise +GetDefaultViewOk returns a tuple with the DefaultView field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetRootDagId +### SetDefaultView -`func (o *DAGDetail) SetRootDagId(v string)` +`func (o *DAGDetail) SetDefaultView(v string)` -SetRootDagId sets RootDagId field to given value. +SetDefaultView sets DefaultView field to given value. -### HasRootDagId +### HasDefaultView -`func (o *DAGDetail) HasRootDagId() bool` +`func (o *DAGDetail) HasDefaultView() bool` -HasRootDagId returns a boolean if a field has been set. +HasDefaultView returns a boolean if a field has been set. -### SetRootDagIdNil +### SetDefaultViewNil -`func (o *DAGDetail) SetRootDagIdNil(b bool)` +`func (o *DAGDetail) SetDefaultViewNil(b bool)` - SetRootDagIdNil sets the value for RootDagId to be an explicit nil + SetDefaultViewNil sets the value for DefaultView to be an explicit nil -### UnsetRootDagId -`func (o *DAGDetail) UnsetRootDagId()` +### UnsetDefaultView +`func (o *DAGDetail) UnsetDefaultView()` -UnsetRootDagId ensures that no value is present for RootDagId, not even an explicit nil -### GetIsPaused +UnsetDefaultView ensures that no value is present for DefaultView, not even an explicit nil +### GetDescription -`func (o *DAGDetail) GetIsPaused() bool` +`func (o *DAGDetail) GetDescription() string` -GetIsPaused returns the IsPaused field if non-nil, zero value otherwise. +GetDescription returns the Description field if non-nil, zero value otherwise. -### GetIsPausedOk +### GetDescriptionOk -`func (o *DAGDetail) GetIsPausedOk() (*bool, bool)` +`func (o *DAGDetail) GetDescriptionOk() (*string, bool)` -GetIsPausedOk returns a tuple with the IsPaused field if it's non-nil, zero value otherwise +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetIsPaused +### SetDescription -`func (o *DAGDetail) SetIsPaused(v bool)` +`func (o *DAGDetail) SetDescription(v string)` -SetIsPaused sets IsPaused field to given value. +SetDescription sets Description field to given value. -### HasIsPaused +### HasDescription -`func (o *DAGDetail) HasIsPaused() bool` +`func (o *DAGDetail) HasDescription() bool` -HasIsPaused returns a boolean if a field has been set. +HasDescription returns a boolean if a field has been set. -### SetIsPausedNil +### SetDescriptionNil -`func (o *DAGDetail) SetIsPausedNil(b bool)` +`func (o *DAGDetail) SetDescriptionNil(b bool)` - SetIsPausedNil sets the value for IsPaused to be an explicit nil + SetDescriptionNil sets the value for Description to be an explicit nil -### UnsetIsPaused -`func (o *DAGDetail) UnsetIsPaused()` +### UnsetDescription +`func (o *DAGDetail) UnsetDescription()` -UnsetIsPaused ensures that no value is present for IsPaused, not even an explicit nil -### GetIsActive +UnsetDescription ensures that no value is present for Description, not even an explicit nil +### GetFileToken -`func (o *DAGDetail) GetIsActive() bool` +`func (o *DAGDetail) GetFileToken() string` -GetIsActive returns the IsActive field if non-nil, zero value otherwise. +GetFileToken returns the FileToken field if non-nil, zero value otherwise. -### GetIsActiveOk +### GetFileTokenOk -`func (o *DAGDetail) GetIsActiveOk() (*bool, bool)` +`func (o *DAGDetail) GetFileTokenOk() (*string, bool)` -GetIsActiveOk returns a tuple with the IsActive field if it's non-nil, zero value otherwise +GetFileTokenOk returns a tuple with the FileToken field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetIsActive - -`func (o *DAGDetail) SetIsActive(v bool)` - -SetIsActive sets IsActive field to given value. - -### HasIsActive - -`func (o *DAGDetail) HasIsActive() bool` +### SetFileToken -HasIsActive returns a boolean if a field has been set. +`func (o *DAGDetail) SetFileToken(v string)` -### SetIsActiveNil +SetFileToken sets FileToken field to given value. -`func (o *DAGDetail) SetIsActiveNil(b bool)` +### HasFileToken - SetIsActiveNil sets the value for IsActive to be an explicit nil +`func (o *DAGDetail) HasFileToken() bool` -### UnsetIsActive -`func (o *DAGDetail) UnsetIsActive()` +HasFileToken returns a boolean if a field has been set. -UnsetIsActive ensures that no value is present for IsActive, not even an explicit nil -### GetIsSubdag +### GetFileloc -`func (o *DAGDetail) GetIsSubdag() bool` +`func (o *DAGDetail) GetFileloc() string` -GetIsSubdag returns the IsSubdag field if non-nil, zero value otherwise. +GetFileloc returns the Fileloc field if non-nil, zero value otherwise. -### GetIsSubdagOk +### GetFilelocOk -`func (o *DAGDetail) GetIsSubdagOk() (*bool, bool)` +`func (o *DAGDetail) GetFilelocOk() (*string, bool)` -GetIsSubdagOk returns a tuple with the IsSubdag field if it's non-nil, zero value otherwise +GetFilelocOk returns a tuple with the Fileloc field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetIsSubdag +### SetFileloc -`func (o *DAGDetail) SetIsSubdag(v bool)` +`func (o *DAGDetail) SetFileloc(v string)` -SetIsSubdag sets IsSubdag field to given value. +SetFileloc sets Fileloc field to given value. -### HasIsSubdag +### HasFileloc -`func (o *DAGDetail) HasIsSubdag() bool` +`func (o *DAGDetail) HasFileloc() bool` -HasIsSubdag returns a boolean if a field has been set. +HasFileloc returns a boolean if a field has been set. -### GetLastParsedTime +### GetHasImportErrors -`func (o *DAGDetail) GetLastParsedTime() time.Time` +`func (o *DAGDetail) GetHasImportErrors() bool` -GetLastParsedTime returns the LastParsedTime field if non-nil, zero value otherwise. +GetHasImportErrors returns the HasImportErrors field if non-nil, zero value otherwise. -### GetLastParsedTimeOk +### GetHasImportErrorsOk -`func (o *DAGDetail) GetLastParsedTimeOk() (*time.Time, bool)` +`func (o *DAGDetail) GetHasImportErrorsOk() (*bool, bool)` -GetLastParsedTimeOk returns a tuple with the LastParsedTime field if it's non-nil, zero value otherwise +GetHasImportErrorsOk returns a tuple with the HasImportErrors field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetLastParsedTime +### SetHasImportErrors -`func (o *DAGDetail) SetLastParsedTime(v time.Time)` +`func (o *DAGDetail) SetHasImportErrors(v bool)` -SetLastParsedTime sets LastParsedTime field to given value. +SetHasImportErrors sets HasImportErrors field to given value. -### HasLastParsedTime +### HasHasImportErrors -`func (o *DAGDetail) HasLastParsedTime() bool` +`func (o *DAGDetail) HasHasImportErrors() bool` -HasLastParsedTime returns a boolean if a field has been set. +HasHasImportErrors returns a boolean if a field has been set. -### SetLastParsedTimeNil +### SetHasImportErrorsNil -`func (o *DAGDetail) SetLastParsedTimeNil(b bool)` +`func (o *DAGDetail) SetHasImportErrorsNil(b bool)` - SetLastParsedTimeNil sets the value for LastParsedTime to be an explicit nil + SetHasImportErrorsNil sets the value for HasImportErrors to be an explicit nil -### UnsetLastParsedTime -`func (o *DAGDetail) UnsetLastParsedTime()` +### UnsetHasImportErrors +`func (o *DAGDetail) UnsetHasImportErrors()` -UnsetLastParsedTime ensures that no value is present for LastParsedTime, not even an explicit nil -### GetLastPickled +UnsetHasImportErrors ensures that no value is present for HasImportErrors, not even an explicit nil +### GetHasTaskConcurrencyLimits -`func (o *DAGDetail) GetLastPickled() time.Time` +`func (o *DAGDetail) GetHasTaskConcurrencyLimits() bool` -GetLastPickled returns the LastPickled field if non-nil, zero value otherwise. +GetHasTaskConcurrencyLimits returns the HasTaskConcurrencyLimits field if non-nil, zero value otherwise. -### GetLastPickledOk +### GetHasTaskConcurrencyLimitsOk -`func (o *DAGDetail) GetLastPickledOk() (*time.Time, bool)` +`func (o *DAGDetail) GetHasTaskConcurrencyLimitsOk() (*bool, bool)` -GetLastPickledOk returns a tuple with the LastPickled field if it's non-nil, zero value otherwise +GetHasTaskConcurrencyLimitsOk returns a tuple with the HasTaskConcurrencyLimits field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetLastPickled +### SetHasTaskConcurrencyLimits -`func (o *DAGDetail) SetLastPickled(v time.Time)` +`func (o *DAGDetail) SetHasTaskConcurrencyLimits(v bool)` -SetLastPickled sets LastPickled field to given value. +SetHasTaskConcurrencyLimits sets HasTaskConcurrencyLimits field to given value. -### HasLastPickled +### HasHasTaskConcurrencyLimits -`func (o *DAGDetail) HasLastPickled() bool` +`func (o *DAGDetail) HasHasTaskConcurrencyLimits() bool` -HasLastPickled returns a boolean if a field has been set. +HasHasTaskConcurrencyLimits returns a boolean if a field has been set. -### SetLastPickledNil +### SetHasTaskConcurrencyLimitsNil -`func (o *DAGDetail) SetLastPickledNil(b bool)` +`func (o *DAGDetail) SetHasTaskConcurrencyLimitsNil(b bool)` - SetLastPickledNil sets the value for LastPickled to be an explicit nil + SetHasTaskConcurrencyLimitsNil sets the value for HasTaskConcurrencyLimits to be an explicit nil -### UnsetLastPickled -`func (o *DAGDetail) UnsetLastPickled()` +### UnsetHasTaskConcurrencyLimits +`func (o *DAGDetail) UnsetHasTaskConcurrencyLimits()` -UnsetLastPickled ensures that no value is present for LastPickled, not even an explicit nil -### GetLastExpired +UnsetHasTaskConcurrencyLimits ensures that no value is present for HasTaskConcurrencyLimits, not even an explicit nil +### GetIsActive -`func (o *DAGDetail) GetLastExpired() time.Time` +`func (o *DAGDetail) GetIsActive() bool` -GetLastExpired returns the LastExpired field if non-nil, zero value otherwise. +GetIsActive returns the IsActive field if non-nil, zero value otherwise. -### GetLastExpiredOk +### GetIsActiveOk -`func (o *DAGDetail) GetLastExpiredOk() (*time.Time, bool)` +`func (o *DAGDetail) GetIsActiveOk() (*bool, bool)` -GetLastExpiredOk returns a tuple with the LastExpired field if it's non-nil, zero value otherwise +GetIsActiveOk returns a tuple with the IsActive field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetLastExpired +### SetIsActive -`func (o *DAGDetail) SetLastExpired(v time.Time)` +`func (o *DAGDetail) SetIsActive(v bool)` -SetLastExpired sets LastExpired field to given value. +SetIsActive sets IsActive field to given value. -### HasLastExpired +### HasIsActive -`func (o *DAGDetail) HasLastExpired() bool` +`func (o *DAGDetail) HasIsActive() bool` -HasLastExpired returns a boolean if a field has been set. +HasIsActive returns a boolean if a field has been set. -### SetLastExpiredNil +### SetIsActiveNil -`func (o *DAGDetail) SetLastExpiredNil(b bool)` +`func (o *DAGDetail) SetIsActiveNil(b bool)` - SetLastExpiredNil sets the value for LastExpired to be an explicit nil + SetIsActiveNil sets the value for IsActive to be an explicit nil -### UnsetLastExpired -`func (o *DAGDetail) UnsetLastExpired()` +### UnsetIsActive +`func (o *DAGDetail) UnsetIsActive()` -UnsetLastExpired ensures that no value is present for LastExpired, not even an explicit nil -### GetSchedulerLock +UnsetIsActive ensures that no value is present for IsActive, not even an explicit nil +### GetIsPaused -`func (o *DAGDetail) GetSchedulerLock() bool` +`func (o *DAGDetail) GetIsPaused() bool` -GetSchedulerLock returns the SchedulerLock field if non-nil, zero value otherwise. +GetIsPaused returns the IsPaused field if non-nil, zero value otherwise. -### GetSchedulerLockOk +### GetIsPausedOk -`func (o *DAGDetail) GetSchedulerLockOk() (*bool, bool)` +`func (o *DAGDetail) GetIsPausedOk() (*bool, bool)` -GetSchedulerLockOk returns a tuple with the SchedulerLock field if it's non-nil, zero value otherwise +GetIsPausedOk returns a tuple with the IsPaused field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetSchedulerLock +### SetIsPaused -`func (o *DAGDetail) SetSchedulerLock(v bool)` +`func (o *DAGDetail) SetIsPaused(v bool)` -SetSchedulerLock sets SchedulerLock field to given value. +SetIsPaused sets IsPaused field to given value. -### HasSchedulerLock +### HasIsPaused -`func (o *DAGDetail) HasSchedulerLock() bool` +`func (o *DAGDetail) HasIsPaused() bool` -HasSchedulerLock returns a boolean if a field has been set. +HasIsPaused returns a boolean if a field has been set. -### SetSchedulerLockNil +### SetIsPausedNil -`func (o *DAGDetail) SetSchedulerLockNil(b bool)` +`func (o *DAGDetail) SetIsPausedNil(b bool)` - SetSchedulerLockNil sets the value for SchedulerLock to be an explicit nil + SetIsPausedNil sets the value for IsPaused to be an explicit nil -### UnsetSchedulerLock -`func (o *DAGDetail) UnsetSchedulerLock()` +### UnsetIsPaused +`func (o *DAGDetail) UnsetIsPaused()` -UnsetSchedulerLock ensures that no value is present for SchedulerLock, not even an explicit nil -### GetPickleId +UnsetIsPaused ensures that no value is present for IsPaused, not even an explicit nil +### GetIsSubdag -`func (o *DAGDetail) GetPickleId() string` +`func (o *DAGDetail) GetIsSubdag() bool` -GetPickleId returns the PickleId field if non-nil, zero value otherwise. +GetIsSubdag returns the IsSubdag field if non-nil, zero value otherwise. -### GetPickleIdOk +### GetIsSubdagOk -`func (o *DAGDetail) GetPickleIdOk() (*string, bool)` +`func (o *DAGDetail) GetIsSubdagOk() (*bool, bool)` -GetPickleIdOk returns a tuple with the PickleId field if it's non-nil, zero value otherwise +GetIsSubdagOk returns a tuple with the IsSubdag field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetPickleId +### SetIsSubdag -`func (o *DAGDetail) SetPickleId(v string)` +`func (o *DAGDetail) SetIsSubdag(v bool)` -SetPickleId sets PickleId field to given value. +SetIsSubdag sets IsSubdag field to given value. -### HasPickleId +### HasIsSubdag -`func (o *DAGDetail) HasPickleId() bool` +`func (o *DAGDetail) HasIsSubdag() bool` -HasPickleId returns a boolean if a field has been set. +HasIsSubdag returns a boolean if a field has been set. -### SetPickleIdNil +### GetLastExpired -`func (o *DAGDetail) SetPickleIdNil(b bool)` +`func (o *DAGDetail) GetLastExpired() time.Time` - SetPickleIdNil sets the value for PickleId to be an explicit nil +GetLastExpired returns the LastExpired field if non-nil, zero value otherwise. -### UnsetPickleId -`func (o *DAGDetail) UnsetPickleId()` +### GetLastExpiredOk -UnsetPickleId ensures that no value is present for PickleId, not even an explicit nil -### GetDefaultView +`func (o *DAGDetail) GetLastExpiredOk() (*time.Time, bool)` -`func (o *DAGDetail) GetDefaultView() string` +GetLastExpiredOk returns a tuple with the LastExpired field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. -GetDefaultView returns the DefaultView field if non-nil, zero value otherwise. +### SetLastExpired -### GetDefaultViewOk +`func (o *DAGDetail) SetLastExpired(v time.Time)` -`func (o *DAGDetail) GetDefaultViewOk() (*string, bool)` +SetLastExpired sets LastExpired field to given value. -GetDefaultViewOk returns a tuple with the DefaultView field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. +### HasLastExpired -### SetDefaultView +`func (o *DAGDetail) HasLastExpired() bool` -`func (o *DAGDetail) SetDefaultView(v string)` +HasLastExpired returns a boolean if a field has been set. -SetDefaultView sets DefaultView field to given value. +### SetLastExpiredNil -### HasDefaultView +`func (o *DAGDetail) SetLastExpiredNil(b bool)` -`func (o *DAGDetail) HasDefaultView() bool` + SetLastExpiredNil sets the value for LastExpired to be an explicit nil -HasDefaultView returns a boolean if a field has been set. +### UnsetLastExpired +`func (o *DAGDetail) UnsetLastExpired()` -### GetFileloc +UnsetLastExpired ensures that no value is present for LastExpired, not even an explicit nil +### GetLastParsedTime -`func (o *DAGDetail) GetFileloc() string` +`func (o *DAGDetail) GetLastParsedTime() time.Time` -GetFileloc returns the Fileloc field if non-nil, zero value otherwise. +GetLastParsedTime returns the LastParsedTime field if non-nil, zero value otherwise. -### GetFilelocOk +### GetLastParsedTimeOk -`func (o *DAGDetail) GetFilelocOk() (*string, bool)` +`func (o *DAGDetail) GetLastParsedTimeOk() (*time.Time, bool)` -GetFilelocOk returns a tuple with the Fileloc field if it's non-nil, zero value otherwise +GetLastParsedTimeOk returns a tuple with the LastParsedTime field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetFileloc +### SetLastParsedTime -`func (o *DAGDetail) SetFileloc(v string)` +`func (o *DAGDetail) SetLastParsedTime(v time.Time)` -SetFileloc sets Fileloc field to given value. +SetLastParsedTime sets LastParsedTime field to given value. -### HasFileloc +### HasLastParsedTime -`func (o *DAGDetail) HasFileloc() bool` +`func (o *DAGDetail) HasLastParsedTime() bool` -HasFileloc returns a boolean if a field has been set. +HasLastParsedTime returns a boolean if a field has been set. -### GetFileToken +### SetLastParsedTimeNil -`func (o *DAGDetail) GetFileToken() string` +`func (o *DAGDetail) SetLastParsedTimeNil(b bool)` -GetFileToken returns the FileToken field if non-nil, zero value otherwise. + SetLastParsedTimeNil sets the value for LastParsedTime to be an explicit nil -### GetFileTokenOk +### UnsetLastParsedTime +`func (o *DAGDetail) UnsetLastParsedTime()` -`func (o *DAGDetail) GetFileTokenOk() (*string, bool)` +UnsetLastParsedTime ensures that no value is present for LastParsedTime, not even an explicit nil +### GetLastPickled -GetFileTokenOk returns a tuple with the FileToken field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. +`func (o *DAGDetail) GetLastPickled() time.Time` -### SetFileToken +GetLastPickled returns the LastPickled field if non-nil, zero value otherwise. -`func (o *DAGDetail) SetFileToken(v string)` +### GetLastPickledOk -SetFileToken sets FileToken field to given value. +`func (o *DAGDetail) GetLastPickledOk() (*time.Time, bool)` -### HasFileToken +GetLastPickledOk returns a tuple with the LastPickled field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. -`func (o *DAGDetail) HasFileToken() bool` +### SetLastPickled -HasFileToken returns a boolean if a field has been set. +`func (o *DAGDetail) SetLastPickled(v time.Time)` -### GetOwners +SetLastPickled sets LastPickled field to given value. -`func (o *DAGDetail) GetOwners() []string` +### HasLastPickled -GetOwners returns the Owners field if non-nil, zero value otherwise. +`func (o *DAGDetail) HasLastPickled() bool` -### GetOwnersOk +HasLastPickled returns a boolean if a field has been set. -`func (o *DAGDetail) GetOwnersOk() (*[]string, bool)` +### SetLastPickledNil -GetOwnersOk returns a tuple with the Owners field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. +`func (o *DAGDetail) SetLastPickledNil(b bool)` -### SetOwners + SetLastPickledNil sets the value for LastPickled to be an explicit nil -`func (o *DAGDetail) SetOwners(v []string)` +### UnsetLastPickled +`func (o *DAGDetail) UnsetLastPickled()` -SetOwners sets Owners field to given value. +UnsetLastPickled ensures that no value is present for LastPickled, not even an explicit nil +### GetMaxActiveRuns -### HasOwners +`func (o *DAGDetail) GetMaxActiveRuns() int32` -`func (o *DAGDetail) HasOwners() bool` +GetMaxActiveRuns returns the MaxActiveRuns field if non-nil, zero value otherwise. -HasOwners returns a boolean if a field has been set. +### GetMaxActiveRunsOk -### GetDescription +`func (o *DAGDetail) GetMaxActiveRunsOk() (*int32, bool)` -`func (o *DAGDetail) GetDescription() string` +GetMaxActiveRunsOk returns a tuple with the MaxActiveRuns field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. -GetDescription returns the Description field if non-nil, zero value otherwise. +### SetMaxActiveRuns -### GetDescriptionOk +`func (o *DAGDetail) SetMaxActiveRuns(v int32)` -`func (o *DAGDetail) GetDescriptionOk() (*string, bool)` +SetMaxActiveRuns sets MaxActiveRuns field to given value. -GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. +### HasMaxActiveRuns -### SetDescription +`func (o *DAGDetail) HasMaxActiveRuns() bool` -`func (o *DAGDetail) SetDescription(v string)` +HasMaxActiveRuns returns a boolean if a field has been set. -SetDescription sets Description field to given value. +### SetMaxActiveRunsNil -### HasDescription +`func (o *DAGDetail) SetMaxActiveRunsNil(b bool)` -`func (o *DAGDetail) HasDescription() bool` + SetMaxActiveRunsNil sets the value for MaxActiveRuns to be an explicit nil -HasDescription returns a boolean if a field has been set. +### UnsetMaxActiveRuns +`func (o *DAGDetail) UnsetMaxActiveRuns()` -### SetDescriptionNil +UnsetMaxActiveRuns ensures that no value is present for MaxActiveRuns, not even an explicit nil +### GetMaxActiveTasks -`func (o *DAGDetail) SetDescriptionNil(b bool)` +`func (o *DAGDetail) GetMaxActiveTasks() int32` - SetDescriptionNil sets the value for Description to be an explicit nil +GetMaxActiveTasks returns the MaxActiveTasks field if non-nil, zero value otherwise. -### UnsetDescription -`func (o *DAGDetail) UnsetDescription()` +### GetMaxActiveTasksOk -UnsetDescription ensures that no value is present for Description, not even an explicit nil -### GetScheduleInterval +`func (o *DAGDetail) GetMaxActiveTasksOk() (*int32, bool)` -`func (o *DAGDetail) GetScheduleInterval() ScheduleInterval` +GetMaxActiveTasksOk returns a tuple with the MaxActiveTasks field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. -GetScheduleInterval returns the ScheduleInterval field if non-nil, zero value otherwise. +### SetMaxActiveTasks -### GetScheduleIntervalOk +`func (o *DAGDetail) SetMaxActiveTasks(v int32)` -`func (o *DAGDetail) GetScheduleIntervalOk() (*ScheduleInterval, bool)` +SetMaxActiveTasks sets MaxActiveTasks field to given value. -GetScheduleIntervalOk returns a tuple with the ScheduleInterval field if it's non-nil, zero value otherwise +### HasMaxActiveTasks + +`func (o *DAGDetail) HasMaxActiveTasks() bool` + +HasMaxActiveTasks returns a boolean if a field has been set. + +### SetMaxActiveTasksNil + +`func (o *DAGDetail) SetMaxActiveTasksNil(b bool)` + + SetMaxActiveTasksNil sets the value for MaxActiveTasks to be an explicit nil + +### UnsetMaxActiveTasks +`func (o *DAGDetail) UnsetMaxActiveTasks()` + +UnsetMaxActiveTasks ensures that no value is present for MaxActiveTasks, not even an explicit nil +### GetMaxConsecutiveFailedDagRuns + +`func (o *DAGDetail) GetMaxConsecutiveFailedDagRuns() int32` + +GetMaxConsecutiveFailedDagRuns returns the MaxConsecutiveFailedDagRuns field if non-nil, zero value otherwise. + +### GetMaxConsecutiveFailedDagRunsOk + +`func (o *DAGDetail) GetMaxConsecutiveFailedDagRunsOk() (*int32, bool)` + +GetMaxConsecutiveFailedDagRunsOk returns a tuple with the MaxConsecutiveFailedDagRuns field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetScheduleInterval +### SetMaxConsecutiveFailedDagRuns -`func (o *DAGDetail) SetScheduleInterval(v ScheduleInterval)` +`func (o *DAGDetail) SetMaxConsecutiveFailedDagRuns(v int32)` -SetScheduleInterval sets ScheduleInterval field to given value. +SetMaxConsecutiveFailedDagRuns sets MaxConsecutiveFailedDagRuns field to given value. -### HasScheduleInterval +### HasMaxConsecutiveFailedDagRuns -`func (o *DAGDetail) HasScheduleInterval() bool` +`func (o *DAGDetail) HasMaxConsecutiveFailedDagRuns() bool` -HasScheduleInterval returns a boolean if a field has been set. +HasMaxConsecutiveFailedDagRuns returns a boolean if a field has been set. -### SetScheduleIntervalNil +### SetMaxConsecutiveFailedDagRunsNil -`func (o *DAGDetail) SetScheduleIntervalNil(b bool)` +`func (o *DAGDetail) SetMaxConsecutiveFailedDagRunsNil(b bool)` - SetScheduleIntervalNil sets the value for ScheduleInterval to be an explicit nil + SetMaxConsecutiveFailedDagRunsNil sets the value for MaxConsecutiveFailedDagRuns to be an explicit nil -### UnsetScheduleInterval -`func (o *DAGDetail) UnsetScheduleInterval()` +### UnsetMaxConsecutiveFailedDagRuns +`func (o *DAGDetail) UnsetMaxConsecutiveFailedDagRuns()` -UnsetScheduleInterval ensures that no value is present for ScheduleInterval, not even an explicit nil -### GetTimetableDescription +UnsetMaxConsecutiveFailedDagRuns ensures that no value is present for MaxConsecutiveFailedDagRuns, not even an explicit nil +### GetNextDagrun -`func (o *DAGDetail) GetTimetableDescription() string` +`func (o *DAGDetail) GetNextDagrun() time.Time` -GetTimetableDescription returns the TimetableDescription field if non-nil, zero value otherwise. +GetNextDagrun returns the NextDagrun field if non-nil, zero value otherwise. -### GetTimetableDescriptionOk +### GetNextDagrunOk -`func (o *DAGDetail) GetTimetableDescriptionOk() (*string, bool)` +`func (o *DAGDetail) GetNextDagrunOk() (*time.Time, bool)` -GetTimetableDescriptionOk returns a tuple with the TimetableDescription field if it's non-nil, zero value otherwise +GetNextDagrunOk returns a tuple with the NextDagrun field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTimetableDescription +### SetNextDagrun -`func (o *DAGDetail) SetTimetableDescription(v string)` +`func (o *DAGDetail) SetNextDagrun(v time.Time)` -SetTimetableDescription sets TimetableDescription field to given value. +SetNextDagrun sets NextDagrun field to given value. -### HasTimetableDescription +### HasNextDagrun -`func (o *DAGDetail) HasTimetableDescription() bool` +`func (o *DAGDetail) HasNextDagrun() bool` -HasTimetableDescription returns a boolean if a field has been set. +HasNextDagrun returns a boolean if a field has been set. -### SetTimetableDescriptionNil +### SetNextDagrunNil -`func (o *DAGDetail) SetTimetableDescriptionNil(b bool)` +`func (o *DAGDetail) SetNextDagrunNil(b bool)` - SetTimetableDescriptionNil sets the value for TimetableDescription to be an explicit nil + SetNextDagrunNil sets the value for NextDagrun to be an explicit nil -### UnsetTimetableDescription -`func (o *DAGDetail) UnsetTimetableDescription()` +### UnsetNextDagrun +`func (o *DAGDetail) UnsetNextDagrun()` -UnsetTimetableDescription ensures that no value is present for TimetableDescription, not even an explicit nil -### GetTags +UnsetNextDagrun ensures that no value is present for NextDagrun, not even an explicit nil +### GetNextDagrunCreateAfter -`func (o *DAGDetail) GetTags() []Tag` +`func (o *DAGDetail) GetNextDagrunCreateAfter() time.Time` -GetTags returns the Tags field if non-nil, zero value otherwise. +GetNextDagrunCreateAfter returns the NextDagrunCreateAfter field if non-nil, zero value otherwise. -### GetTagsOk +### GetNextDagrunCreateAfterOk -`func (o *DAGDetail) GetTagsOk() (*[]Tag, bool)` +`func (o *DAGDetail) GetNextDagrunCreateAfterOk() (*time.Time, bool)` -GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +GetNextDagrunCreateAfterOk returns a tuple with the NextDagrunCreateAfter field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTags +### SetNextDagrunCreateAfter -`func (o *DAGDetail) SetTags(v []Tag)` +`func (o *DAGDetail) SetNextDagrunCreateAfter(v time.Time)` -SetTags sets Tags field to given value. +SetNextDagrunCreateAfter sets NextDagrunCreateAfter field to given value. -### HasTags +### HasNextDagrunCreateAfter -`func (o *DAGDetail) HasTags() bool` +`func (o *DAGDetail) HasNextDagrunCreateAfter() bool` -HasTags returns a boolean if a field has been set. +HasNextDagrunCreateAfter returns a boolean if a field has been set. -### SetTagsNil +### SetNextDagrunCreateAfterNil -`func (o *DAGDetail) SetTagsNil(b bool)` +`func (o *DAGDetail) SetNextDagrunCreateAfterNil(b bool)` - SetTagsNil sets the value for Tags to be an explicit nil + SetNextDagrunCreateAfterNil sets the value for NextDagrunCreateAfter to be an explicit nil -### UnsetTags -`func (o *DAGDetail) UnsetTags()` +### UnsetNextDagrunCreateAfter +`func (o *DAGDetail) UnsetNextDagrunCreateAfter()` -UnsetTags ensures that no value is present for Tags, not even an explicit nil -### GetMaxActiveTasks +UnsetNextDagrunCreateAfter ensures that no value is present for NextDagrunCreateAfter, not even an explicit nil +### GetNextDagrunDataIntervalEnd -`func (o *DAGDetail) GetMaxActiveTasks() int32` +`func (o *DAGDetail) GetNextDagrunDataIntervalEnd() time.Time` -GetMaxActiveTasks returns the MaxActiveTasks field if non-nil, zero value otherwise. +GetNextDagrunDataIntervalEnd returns the NextDagrunDataIntervalEnd field if non-nil, zero value otherwise. -### GetMaxActiveTasksOk +### GetNextDagrunDataIntervalEndOk -`func (o *DAGDetail) GetMaxActiveTasksOk() (*int32, bool)` +`func (o *DAGDetail) GetNextDagrunDataIntervalEndOk() (*time.Time, bool)` -GetMaxActiveTasksOk returns a tuple with the MaxActiveTasks field if it's non-nil, zero value otherwise +GetNextDagrunDataIntervalEndOk returns a tuple with the NextDagrunDataIntervalEnd field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetMaxActiveTasks +### SetNextDagrunDataIntervalEnd -`func (o *DAGDetail) SetMaxActiveTasks(v int32)` +`func (o *DAGDetail) SetNextDagrunDataIntervalEnd(v time.Time)` -SetMaxActiveTasks sets MaxActiveTasks field to given value. +SetNextDagrunDataIntervalEnd sets NextDagrunDataIntervalEnd field to given value. -### HasMaxActiveTasks +### HasNextDagrunDataIntervalEnd -`func (o *DAGDetail) HasMaxActiveTasks() bool` +`func (o *DAGDetail) HasNextDagrunDataIntervalEnd() bool` -HasMaxActiveTasks returns a boolean if a field has been set. +HasNextDagrunDataIntervalEnd returns a boolean if a field has been set. -### SetMaxActiveTasksNil +### SetNextDagrunDataIntervalEndNil -`func (o *DAGDetail) SetMaxActiveTasksNil(b bool)` +`func (o *DAGDetail) SetNextDagrunDataIntervalEndNil(b bool)` - SetMaxActiveTasksNil sets the value for MaxActiveTasks to be an explicit nil + SetNextDagrunDataIntervalEndNil sets the value for NextDagrunDataIntervalEnd to be an explicit nil -### UnsetMaxActiveTasks -`func (o *DAGDetail) UnsetMaxActiveTasks()` +### UnsetNextDagrunDataIntervalEnd +`func (o *DAGDetail) UnsetNextDagrunDataIntervalEnd()` -UnsetMaxActiveTasks ensures that no value is present for MaxActiveTasks, not even an explicit nil -### GetMaxActiveRuns +UnsetNextDagrunDataIntervalEnd ensures that no value is present for NextDagrunDataIntervalEnd, not even an explicit nil +### GetNextDagrunDataIntervalStart -`func (o *DAGDetail) GetMaxActiveRuns() int32` +`func (o *DAGDetail) GetNextDagrunDataIntervalStart() time.Time` -GetMaxActiveRuns returns the MaxActiveRuns field if non-nil, zero value otherwise. +GetNextDagrunDataIntervalStart returns the NextDagrunDataIntervalStart field if non-nil, zero value otherwise. -### GetMaxActiveRunsOk +### GetNextDagrunDataIntervalStartOk -`func (o *DAGDetail) GetMaxActiveRunsOk() (*int32, bool)` +`func (o *DAGDetail) GetNextDagrunDataIntervalStartOk() (*time.Time, bool)` -GetMaxActiveRunsOk returns a tuple with the MaxActiveRuns field if it's non-nil, zero value otherwise +GetNextDagrunDataIntervalStartOk returns a tuple with the NextDagrunDataIntervalStart field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetMaxActiveRuns +### SetNextDagrunDataIntervalStart -`func (o *DAGDetail) SetMaxActiveRuns(v int32)` +`func (o *DAGDetail) SetNextDagrunDataIntervalStart(v time.Time)` -SetMaxActiveRuns sets MaxActiveRuns field to given value. +SetNextDagrunDataIntervalStart sets NextDagrunDataIntervalStart field to given value. -### HasMaxActiveRuns +### HasNextDagrunDataIntervalStart -`func (o *DAGDetail) HasMaxActiveRuns() bool` +`func (o *DAGDetail) HasNextDagrunDataIntervalStart() bool` -HasMaxActiveRuns returns a boolean if a field has been set. +HasNextDagrunDataIntervalStart returns a boolean if a field has been set. -### SetMaxActiveRunsNil +### SetNextDagrunDataIntervalStartNil -`func (o *DAGDetail) SetMaxActiveRunsNil(b bool)` +`func (o *DAGDetail) SetNextDagrunDataIntervalStartNil(b bool)` - SetMaxActiveRunsNil sets the value for MaxActiveRuns to be an explicit nil + SetNextDagrunDataIntervalStartNil sets the value for NextDagrunDataIntervalStart to be an explicit nil -### UnsetMaxActiveRuns -`func (o *DAGDetail) UnsetMaxActiveRuns()` +### UnsetNextDagrunDataIntervalStart +`func (o *DAGDetail) UnsetNextDagrunDataIntervalStart()` -UnsetMaxActiveRuns ensures that no value is present for MaxActiveRuns, not even an explicit nil -### GetHasTaskConcurrencyLimits +UnsetNextDagrunDataIntervalStart ensures that no value is present for NextDagrunDataIntervalStart, not even an explicit nil +### GetOwners -`func (o *DAGDetail) GetHasTaskConcurrencyLimits() bool` +`func (o *DAGDetail) GetOwners() []string` -GetHasTaskConcurrencyLimits returns the HasTaskConcurrencyLimits field if non-nil, zero value otherwise. +GetOwners returns the Owners field if non-nil, zero value otherwise. -### GetHasTaskConcurrencyLimitsOk +### GetOwnersOk -`func (o *DAGDetail) GetHasTaskConcurrencyLimitsOk() (*bool, bool)` +`func (o *DAGDetail) GetOwnersOk() (*[]string, bool)` -GetHasTaskConcurrencyLimitsOk returns a tuple with the HasTaskConcurrencyLimits field if it's non-nil, zero value otherwise +GetOwnersOk returns a tuple with the Owners field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetHasTaskConcurrencyLimits - -`func (o *DAGDetail) SetHasTaskConcurrencyLimits(v bool)` - -SetHasTaskConcurrencyLimits sets HasTaskConcurrencyLimits field to given value. - -### HasHasTaskConcurrencyLimits - -`func (o *DAGDetail) HasHasTaskConcurrencyLimits() bool` +### SetOwners -HasHasTaskConcurrencyLimits returns a boolean if a field has been set. +`func (o *DAGDetail) SetOwners(v []string)` -### SetHasTaskConcurrencyLimitsNil +SetOwners sets Owners field to given value. -`func (o *DAGDetail) SetHasTaskConcurrencyLimitsNil(b bool)` +### HasOwners - SetHasTaskConcurrencyLimitsNil sets the value for HasTaskConcurrencyLimits to be an explicit nil +`func (o *DAGDetail) HasOwners() bool` -### UnsetHasTaskConcurrencyLimits -`func (o *DAGDetail) UnsetHasTaskConcurrencyLimits()` +HasOwners returns a boolean if a field has been set. -UnsetHasTaskConcurrencyLimits ensures that no value is present for HasTaskConcurrencyLimits, not even an explicit nil -### GetHasImportErrors +### GetPickleId -`func (o *DAGDetail) GetHasImportErrors() bool` +`func (o *DAGDetail) GetPickleId() string` -GetHasImportErrors returns the HasImportErrors field if non-nil, zero value otherwise. +GetPickleId returns the PickleId field if non-nil, zero value otherwise. -### GetHasImportErrorsOk +### GetPickleIdOk -`func (o *DAGDetail) GetHasImportErrorsOk() (*bool, bool)` +`func (o *DAGDetail) GetPickleIdOk() (*string, bool)` -GetHasImportErrorsOk returns a tuple with the HasImportErrors field if it's non-nil, zero value otherwise +GetPickleIdOk returns a tuple with the PickleId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetHasImportErrors +### SetPickleId -`func (o *DAGDetail) SetHasImportErrors(v bool)` +`func (o *DAGDetail) SetPickleId(v string)` -SetHasImportErrors sets HasImportErrors field to given value. +SetPickleId sets PickleId field to given value. -### HasHasImportErrors +### HasPickleId -`func (o *DAGDetail) HasHasImportErrors() bool` +`func (o *DAGDetail) HasPickleId() bool` -HasHasImportErrors returns a boolean if a field has been set. +HasPickleId returns a boolean if a field has been set. -### SetHasImportErrorsNil +### SetPickleIdNil -`func (o *DAGDetail) SetHasImportErrorsNil(b bool)` +`func (o *DAGDetail) SetPickleIdNil(b bool)` - SetHasImportErrorsNil sets the value for HasImportErrors to be an explicit nil + SetPickleIdNil sets the value for PickleId to be an explicit nil -### UnsetHasImportErrors -`func (o *DAGDetail) UnsetHasImportErrors()` +### UnsetPickleId +`func (o *DAGDetail) UnsetPickleId()` -UnsetHasImportErrors ensures that no value is present for HasImportErrors, not even an explicit nil -### GetNextDagrun +UnsetPickleId ensures that no value is present for PickleId, not even an explicit nil +### GetRootDagId -`func (o *DAGDetail) GetNextDagrun() time.Time` +`func (o *DAGDetail) GetRootDagId() string` -GetNextDagrun returns the NextDagrun field if non-nil, zero value otherwise. +GetRootDagId returns the RootDagId field if non-nil, zero value otherwise. -### GetNextDagrunOk +### GetRootDagIdOk -`func (o *DAGDetail) GetNextDagrunOk() (*time.Time, bool)` +`func (o *DAGDetail) GetRootDagIdOk() (*string, bool)` -GetNextDagrunOk returns a tuple with the NextDagrun field if it's non-nil, zero value otherwise +GetRootDagIdOk returns a tuple with the RootDagId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetNextDagrun +### SetRootDagId -`func (o *DAGDetail) SetNextDagrun(v time.Time)` +`func (o *DAGDetail) SetRootDagId(v string)` -SetNextDagrun sets NextDagrun field to given value. +SetRootDagId sets RootDagId field to given value. -### HasNextDagrun +### HasRootDagId -`func (o *DAGDetail) HasNextDagrun() bool` +`func (o *DAGDetail) HasRootDagId() bool` -HasNextDagrun returns a boolean if a field has been set. +HasRootDagId returns a boolean if a field has been set. -### SetNextDagrunNil +### SetRootDagIdNil -`func (o *DAGDetail) SetNextDagrunNil(b bool)` +`func (o *DAGDetail) SetRootDagIdNil(b bool)` - SetNextDagrunNil sets the value for NextDagrun to be an explicit nil + SetRootDagIdNil sets the value for RootDagId to be an explicit nil -### UnsetNextDagrun -`func (o *DAGDetail) UnsetNextDagrun()` +### UnsetRootDagId +`func (o *DAGDetail) UnsetRootDagId()` -UnsetNextDagrun ensures that no value is present for NextDagrun, not even an explicit nil -### GetNextDagrunDataIntervalStart +UnsetRootDagId ensures that no value is present for RootDagId, not even an explicit nil +### GetScheduleInterval -`func (o *DAGDetail) GetNextDagrunDataIntervalStart() time.Time` +`func (o *DAGDetail) GetScheduleInterval() ScheduleInterval` -GetNextDagrunDataIntervalStart returns the NextDagrunDataIntervalStart field if non-nil, zero value otherwise. +GetScheduleInterval returns the ScheduleInterval field if non-nil, zero value otherwise. -### GetNextDagrunDataIntervalStartOk +### GetScheduleIntervalOk -`func (o *DAGDetail) GetNextDagrunDataIntervalStartOk() (*time.Time, bool)` +`func (o *DAGDetail) GetScheduleIntervalOk() (*ScheduleInterval, bool)` -GetNextDagrunDataIntervalStartOk returns a tuple with the NextDagrunDataIntervalStart field if it's non-nil, zero value otherwise +GetScheduleIntervalOk returns a tuple with the ScheduleInterval field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetNextDagrunDataIntervalStart +### SetScheduleInterval -`func (o *DAGDetail) SetNextDagrunDataIntervalStart(v time.Time)` +`func (o *DAGDetail) SetScheduleInterval(v ScheduleInterval)` -SetNextDagrunDataIntervalStart sets NextDagrunDataIntervalStart field to given value. +SetScheduleInterval sets ScheduleInterval field to given value. -### HasNextDagrunDataIntervalStart +### HasScheduleInterval -`func (o *DAGDetail) HasNextDagrunDataIntervalStart() bool` +`func (o *DAGDetail) HasScheduleInterval() bool` -HasNextDagrunDataIntervalStart returns a boolean if a field has been set. +HasScheduleInterval returns a boolean if a field has been set. -### SetNextDagrunDataIntervalStartNil +### SetScheduleIntervalNil -`func (o *DAGDetail) SetNextDagrunDataIntervalStartNil(b bool)` +`func (o *DAGDetail) SetScheduleIntervalNil(b bool)` - SetNextDagrunDataIntervalStartNil sets the value for NextDagrunDataIntervalStart to be an explicit nil + SetScheduleIntervalNil sets the value for ScheduleInterval to be an explicit nil -### UnsetNextDagrunDataIntervalStart -`func (o *DAGDetail) UnsetNextDagrunDataIntervalStart()` +### UnsetScheduleInterval +`func (o *DAGDetail) UnsetScheduleInterval()` -UnsetNextDagrunDataIntervalStart ensures that no value is present for NextDagrunDataIntervalStart, not even an explicit nil -### GetNextDagrunDataIntervalEnd +UnsetScheduleInterval ensures that no value is present for ScheduleInterval, not even an explicit nil +### GetSchedulerLock -`func (o *DAGDetail) GetNextDagrunDataIntervalEnd() time.Time` +`func (o *DAGDetail) GetSchedulerLock() bool` -GetNextDagrunDataIntervalEnd returns the NextDagrunDataIntervalEnd field if non-nil, zero value otherwise. +GetSchedulerLock returns the SchedulerLock field if non-nil, zero value otherwise. -### GetNextDagrunDataIntervalEndOk +### GetSchedulerLockOk -`func (o *DAGDetail) GetNextDagrunDataIntervalEndOk() (*time.Time, bool)` +`func (o *DAGDetail) GetSchedulerLockOk() (*bool, bool)` -GetNextDagrunDataIntervalEndOk returns a tuple with the NextDagrunDataIntervalEnd field if it's non-nil, zero value otherwise +GetSchedulerLockOk returns a tuple with the SchedulerLock field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetNextDagrunDataIntervalEnd +### SetSchedulerLock -`func (o *DAGDetail) SetNextDagrunDataIntervalEnd(v time.Time)` +`func (o *DAGDetail) SetSchedulerLock(v bool)` -SetNextDagrunDataIntervalEnd sets NextDagrunDataIntervalEnd field to given value. +SetSchedulerLock sets SchedulerLock field to given value. -### HasNextDagrunDataIntervalEnd +### HasSchedulerLock -`func (o *DAGDetail) HasNextDagrunDataIntervalEnd() bool` +`func (o *DAGDetail) HasSchedulerLock() bool` -HasNextDagrunDataIntervalEnd returns a boolean if a field has been set. +HasSchedulerLock returns a boolean if a field has been set. -### SetNextDagrunDataIntervalEndNil +### SetSchedulerLockNil -`func (o *DAGDetail) SetNextDagrunDataIntervalEndNil(b bool)` +`func (o *DAGDetail) SetSchedulerLockNil(b bool)` - SetNextDagrunDataIntervalEndNil sets the value for NextDagrunDataIntervalEnd to be an explicit nil + SetSchedulerLockNil sets the value for SchedulerLock to be an explicit nil -### UnsetNextDagrunDataIntervalEnd -`func (o *DAGDetail) UnsetNextDagrunDataIntervalEnd()` +### UnsetSchedulerLock +`func (o *DAGDetail) UnsetSchedulerLock()` -UnsetNextDagrunDataIntervalEnd ensures that no value is present for NextDagrunDataIntervalEnd, not even an explicit nil -### GetNextDagrunCreateAfter +UnsetSchedulerLock ensures that no value is present for SchedulerLock, not even an explicit nil +### GetTags -`func (o *DAGDetail) GetNextDagrunCreateAfter() time.Time` +`func (o *DAGDetail) GetTags() []Tag` -GetNextDagrunCreateAfter returns the NextDagrunCreateAfter field if non-nil, zero value otherwise. +GetTags returns the Tags field if non-nil, zero value otherwise. -### GetNextDagrunCreateAfterOk +### GetTagsOk -`func (o *DAGDetail) GetNextDagrunCreateAfterOk() (*time.Time, bool)` +`func (o *DAGDetail) GetTagsOk() (*[]Tag, bool)` -GetNextDagrunCreateAfterOk returns a tuple with the NextDagrunCreateAfter field if it's non-nil, zero value otherwise +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetNextDagrunCreateAfter +### SetTags -`func (o *DAGDetail) SetNextDagrunCreateAfter(v time.Time)` +`func (o *DAGDetail) SetTags(v []Tag)` -SetNextDagrunCreateAfter sets NextDagrunCreateAfter field to given value. +SetTags sets Tags field to given value. -### HasNextDagrunCreateAfter +### HasTags -`func (o *DAGDetail) HasNextDagrunCreateAfter() bool` +`func (o *DAGDetail) HasTags() bool` -HasNextDagrunCreateAfter returns a boolean if a field has been set. +HasTags returns a boolean if a field has been set. -### SetNextDagrunCreateAfterNil +### SetTagsNil -`func (o *DAGDetail) SetNextDagrunCreateAfterNil(b bool)` +`func (o *DAGDetail) SetTagsNil(b bool)` - SetNextDagrunCreateAfterNil sets the value for NextDagrunCreateAfter to be an explicit nil + SetTagsNil sets the value for Tags to be an explicit nil -### UnsetNextDagrunCreateAfter -`func (o *DAGDetail) UnsetNextDagrunCreateAfter()` +### UnsetTags +`func (o *DAGDetail) UnsetTags()` -UnsetNextDagrunCreateAfter ensures that no value is present for NextDagrunCreateAfter, not even an explicit nil -### GetTimezone +UnsetTags ensures that no value is present for Tags, not even an explicit nil +### GetTimetableDescription -`func (o *DAGDetail) GetTimezone() string` +`func (o *DAGDetail) GetTimetableDescription() string` -GetTimezone returns the Timezone field if non-nil, zero value otherwise. +GetTimetableDescription returns the TimetableDescription field if non-nil, zero value otherwise. -### GetTimezoneOk +### GetTimetableDescriptionOk -`func (o *DAGDetail) GetTimezoneOk() (*string, bool)` +`func (o *DAGDetail) GetTimetableDescriptionOk() (*string, bool)` -GetTimezoneOk returns a tuple with the Timezone field if it's non-nil, zero value otherwise +GetTimetableDescriptionOk returns a tuple with the TimetableDescription field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTimezone +### SetTimetableDescription -`func (o *DAGDetail) SetTimezone(v string)` +`func (o *DAGDetail) SetTimetableDescription(v string)` + +SetTimetableDescription sets TimetableDescription field to given value. + +### HasTimetableDescription + +`func (o *DAGDetail) HasTimetableDescription() bool` + +HasTimetableDescription returns a boolean if a field has been set. -SetTimezone sets Timezone field to given value. +### SetTimetableDescriptionNil -### HasTimezone +`func (o *DAGDetail) SetTimetableDescriptionNil(b bool)` -`func (o *DAGDetail) HasTimezone() bool` + SetTimetableDescriptionNil sets the value for TimetableDescription to be an explicit nil -HasTimezone returns a boolean if a field has been set. +### UnsetTimetableDescription +`func (o *DAGDetail) UnsetTimetableDescription()` +UnsetTimetableDescription ensures that no value is present for TimetableDescription, not even an explicit nil ### GetCatchup `func (o *DAGDetail) GetCatchup() bool` @@ -982,31 +1011,16 @@ SetCatchup sets Catchup field to given value. HasCatchup returns a boolean if a field has been set. -### GetOrientation - -`func (o *DAGDetail) GetOrientation() string` - -GetOrientation returns the Orientation field if non-nil, zero value otherwise. - -### GetOrientationOk - -`func (o *DAGDetail) GetOrientationOk() (*string, bool)` - -GetOrientationOk returns a tuple with the Orientation field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetOrientation +### SetCatchupNil -`func (o *DAGDetail) SetOrientation(v string)` - -SetOrientation sets Orientation field to given value. - -### HasOrientation +`func (o *DAGDetail) SetCatchupNil(b bool)` -`func (o *DAGDetail) HasOrientation() bool` + SetCatchupNil sets the value for Catchup to be an explicit nil -HasOrientation returns a boolean if a field has been set. +### UnsetCatchup +`func (o *DAGDetail) UnsetCatchup()` +UnsetCatchup ensures that no value is present for Catchup, not even an explicit nil ### GetConcurrency `func (o *DAGDetail) GetConcurrency() float32` @@ -1032,66 +1046,86 @@ SetConcurrency sets Concurrency field to given value. HasConcurrency returns a boolean if a field has been set. -### GetStartDate +### SetConcurrencyNil -`func (o *DAGDetail) GetStartDate() time.Time` +`func (o *DAGDetail) SetConcurrencyNil(b bool)` -GetStartDate returns the StartDate field if non-nil, zero value otherwise. + SetConcurrencyNil sets the value for Concurrency to be an explicit nil -### GetStartDateOk +### UnsetConcurrency +`func (o *DAGDetail) UnsetConcurrency()` -`func (o *DAGDetail) GetStartDateOk() (*time.Time, bool)` +UnsetConcurrency ensures that no value is present for Concurrency, not even an explicit nil +### GetDagRunTimeout -GetStartDateOk returns a tuple with the StartDate field if it's non-nil, zero value otherwise +`func (o *DAGDetail) GetDagRunTimeout() TimeDelta` + +GetDagRunTimeout returns the DagRunTimeout field if non-nil, zero value otherwise. + +### GetDagRunTimeoutOk + +`func (o *DAGDetail) GetDagRunTimeoutOk() (*TimeDelta, bool)` + +GetDagRunTimeoutOk returns a tuple with the DagRunTimeout field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetStartDate +### SetDagRunTimeout -`func (o *DAGDetail) SetStartDate(v time.Time)` +`func (o *DAGDetail) SetDagRunTimeout(v TimeDelta)` -SetStartDate sets StartDate field to given value. +SetDagRunTimeout sets DagRunTimeout field to given value. -### HasStartDate +### HasDagRunTimeout -`func (o *DAGDetail) HasStartDate() bool` +`func (o *DAGDetail) HasDagRunTimeout() bool` -HasStartDate returns a boolean if a field has been set. +HasDagRunTimeout returns a boolean if a field has been set. -### SetStartDateNil +### SetDagRunTimeoutNil -`func (o *DAGDetail) SetStartDateNil(b bool)` +`func (o *DAGDetail) SetDagRunTimeoutNil(b bool)` - SetStartDateNil sets the value for StartDate to be an explicit nil + SetDagRunTimeoutNil sets the value for DagRunTimeout to be an explicit nil -### UnsetStartDate -`func (o *DAGDetail) UnsetStartDate()` +### UnsetDagRunTimeout +`func (o *DAGDetail) UnsetDagRunTimeout()` -UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil -### GetDagRunTimeout +UnsetDagRunTimeout ensures that no value is present for DagRunTimeout, not even an explicit nil +### GetDatasetExpression -`func (o *DAGDetail) GetDagRunTimeout() TimeDelta` +`func (o *DAGDetail) GetDatasetExpression() map[string]interface{}` -GetDagRunTimeout returns the DagRunTimeout field if non-nil, zero value otherwise. +GetDatasetExpression returns the DatasetExpression field if non-nil, zero value otherwise. -### GetDagRunTimeoutOk +### GetDatasetExpressionOk -`func (o *DAGDetail) GetDagRunTimeoutOk() (*TimeDelta, bool)` +`func (o *DAGDetail) GetDatasetExpressionOk() (*map[string]interface{}, bool)` -GetDagRunTimeoutOk returns a tuple with the DagRunTimeout field if it's non-nil, zero value otherwise +GetDatasetExpressionOk returns a tuple with the DatasetExpression field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDagRunTimeout +### SetDatasetExpression -`func (o *DAGDetail) SetDagRunTimeout(v TimeDelta)` +`func (o *DAGDetail) SetDatasetExpression(v map[string]interface{})` -SetDagRunTimeout sets DagRunTimeout field to given value. +SetDatasetExpression sets DatasetExpression field to given value. -### HasDagRunTimeout +### HasDatasetExpression -`func (o *DAGDetail) HasDagRunTimeout() bool` +`func (o *DAGDetail) HasDatasetExpression() bool` -HasDagRunTimeout returns a boolean if a field has been set. +HasDatasetExpression returns a boolean if a field has been set. + +### SetDatasetExpressionNil + +`func (o *DAGDetail) SetDatasetExpressionNil(b bool)` + + SetDatasetExpressionNil sets the value for DatasetExpression to be an explicit nil +### UnsetDatasetExpression +`func (o *DAGDetail) UnsetDatasetExpression()` + +UnsetDatasetExpression ensures that no value is present for DatasetExpression, not even an explicit nil ### GetDocMd `func (o *DAGDetail) GetDocMd() string` @@ -1127,31 +1161,6 @@ HasDocMd returns a boolean if a field has been set. `func (o *DAGDetail) UnsetDocMd()` UnsetDocMd ensures that no value is present for DocMd, not even an explicit nil -### GetParams - -`func (o *DAGDetail) GetParams() map[string]interface{}` - -GetParams returns the Params field if non-nil, zero value otherwise. - -### GetParamsOk - -`func (o *DAGDetail) GetParamsOk() (*map[string]interface{}, bool)` - -GetParamsOk returns a tuple with the Params field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetParams - -`func (o *DAGDetail) SetParams(v map[string]interface{})` - -SetParams sets Params field to given value. - -### HasParams - -`func (o *DAGDetail) HasParams() bool` - -HasParams returns a boolean if a field has been set. - ### GetEndDate `func (o *DAGDetail) GetEndDate() time.Time` @@ -1257,41 +1266,66 @@ HasLastParsed returns a boolean if a field has been set. `func (o *DAGDetail) UnsetLastParsed()` UnsetLastParsed ensures that no value is present for LastParsed, not even an explicit nil -### GetTemplateSearchPath +### GetOrientation -`func (o *DAGDetail) GetTemplateSearchPath() []string` +`func (o *DAGDetail) GetOrientation() string` -GetTemplateSearchPath returns the TemplateSearchPath field if non-nil, zero value otherwise. +GetOrientation returns the Orientation field if non-nil, zero value otherwise. -### GetTemplateSearchPathOk +### GetOrientationOk -`func (o *DAGDetail) GetTemplateSearchPathOk() (*[]string, bool)` +`func (o *DAGDetail) GetOrientationOk() (*string, bool)` -GetTemplateSearchPathOk returns a tuple with the TemplateSearchPath field if it's non-nil, zero value otherwise +GetOrientationOk returns a tuple with the Orientation field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTemplateSearchPath +### SetOrientation -`func (o *DAGDetail) SetTemplateSearchPath(v []string)` +`func (o *DAGDetail) SetOrientation(v string)` -SetTemplateSearchPath sets TemplateSearchPath field to given value. +SetOrientation sets Orientation field to given value. -### HasTemplateSearchPath +### HasOrientation -`func (o *DAGDetail) HasTemplateSearchPath() bool` +`func (o *DAGDetail) HasOrientation() bool` -HasTemplateSearchPath returns a boolean if a field has been set. +HasOrientation returns a boolean if a field has been set. -### SetTemplateSearchPathNil +### SetOrientationNil -`func (o *DAGDetail) SetTemplateSearchPathNil(b bool)` +`func (o *DAGDetail) SetOrientationNil(b bool)` - SetTemplateSearchPathNil sets the value for TemplateSearchPath to be an explicit nil + SetOrientationNil sets the value for Orientation to be an explicit nil -### UnsetTemplateSearchPath -`func (o *DAGDetail) UnsetTemplateSearchPath()` +### UnsetOrientation +`func (o *DAGDetail) UnsetOrientation()` + +UnsetOrientation ensures that no value is present for Orientation, not even an explicit nil +### GetParams + +`func (o *DAGDetail) GetParams() map[string]interface{}` + +GetParams returns the Params field if non-nil, zero value otherwise. + +### GetParamsOk + +`func (o *DAGDetail) GetParamsOk() (*map[string]interface{}, bool)` + +GetParamsOk returns a tuple with the Params field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetParams + +`func (o *DAGDetail) SetParams(v map[string]interface{})` + +SetParams sets Params field to given value. + +### HasParams + +`func (o *DAGDetail) HasParams() bool` + +HasParams returns a boolean if a field has been set. -UnsetTemplateSearchPath ensures that no value is present for TemplateSearchPath, not even an explicit nil ### GetRenderTemplateAsNativeObj `func (o *DAGDetail) GetRenderTemplateAsNativeObj() bool` @@ -1327,6 +1361,101 @@ HasRenderTemplateAsNativeObj returns a boolean if a field has been set. `func (o *DAGDetail) UnsetRenderTemplateAsNativeObj()` UnsetRenderTemplateAsNativeObj ensures that no value is present for RenderTemplateAsNativeObj, not even an explicit nil +### GetStartDate + +`func (o *DAGDetail) GetStartDate() time.Time` + +GetStartDate returns the StartDate field if non-nil, zero value otherwise. + +### GetStartDateOk + +`func (o *DAGDetail) GetStartDateOk() (*time.Time, bool)` + +GetStartDateOk returns a tuple with the StartDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartDate + +`func (o *DAGDetail) SetStartDate(v time.Time)` + +SetStartDate sets StartDate field to given value. + +### HasStartDate + +`func (o *DAGDetail) HasStartDate() bool` + +HasStartDate returns a boolean if a field has been set. + +### SetStartDateNil + +`func (o *DAGDetail) SetStartDateNil(b bool)` + + SetStartDateNil sets the value for StartDate to be an explicit nil + +### UnsetStartDate +`func (o *DAGDetail) UnsetStartDate()` + +UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil +### GetTemplateSearchPath + +`func (o *DAGDetail) GetTemplateSearchPath() []string` + +GetTemplateSearchPath returns the TemplateSearchPath field if non-nil, zero value otherwise. + +### GetTemplateSearchPathOk + +`func (o *DAGDetail) GetTemplateSearchPathOk() (*[]string, bool)` + +GetTemplateSearchPathOk returns a tuple with the TemplateSearchPath field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTemplateSearchPath + +`func (o *DAGDetail) SetTemplateSearchPath(v []string)` + +SetTemplateSearchPath sets TemplateSearchPath field to given value. + +### HasTemplateSearchPath + +`func (o *DAGDetail) HasTemplateSearchPath() bool` + +HasTemplateSearchPath returns a boolean if a field has been set. + +### SetTemplateSearchPathNil + +`func (o *DAGDetail) SetTemplateSearchPathNil(b bool)` + + SetTemplateSearchPathNil sets the value for TemplateSearchPath to be an explicit nil + +### UnsetTemplateSearchPath +`func (o *DAGDetail) UnsetTemplateSearchPath()` + +UnsetTemplateSearchPath ensures that no value is present for TemplateSearchPath, not even an explicit nil +### GetTimezone + +`func (o *DAGDetail) GetTimezone() string` + +GetTimezone returns the Timezone field if non-nil, zero value otherwise. + +### GetTimezoneOk + +`func (o *DAGDetail) GetTimezoneOk() (*string, bool)` + +GetTimezoneOk returns a tuple with the Timezone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimezone + +`func (o *DAGDetail) SetTimezone(v string)` + +SetTimezone sets Timezone field to given value. + +### HasTimezone + +`func (o *DAGDetail) HasTimezone() bool` + +HasTimezone returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/DAGRun.md b/airflow/docs/DAGRun.md index d58e995..c94ceb1 100644 --- a/airflow/docs/DAGRun.md +++ b/airflow/docs/DAGRun.md @@ -1,42 +1,23 @@ - - # DAGRun ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**DagRunId** | Pointer to **NullableString** | Run ID. The value of this field can be set only when creating the object. If you try to modify the field of an existing object, the request fails with an BAD_REQUEST error. If not provided, a value will be generated based on execution_date. If the specified dag_run_id is in use, the creation request fails with an ALREADY_EXISTS error. This together with DAG_ID are a unique key. | [optional] +**Conf** | Pointer to **map[string]interface{}** | JSON object describing additional configuration parameters. The value of this field can be set only when creating the object. If you try to modify the field of an existing object, the request fails with an BAD_REQUEST error. | [optional] **DagId** | Pointer to **string** | | [optional] [readonly] -**LogicalDate** | Pointer to **NullableTime** | The logical date (previously called execution date). This is the time or interval covered by this DAG run, according to the DAG definition. The value of this field can be set only when creating the object. If you try to modify the field of an existing object, the request fails with an BAD_REQUEST error. This together with DAG_ID are a unique key. *New in version 2.2.0* | [optional] -**ExecutionDate** | Pointer to **NullableTime** | The execution date. This is the same as logical_date, kept for backwards compatibility. If both this field and logical_date are provided but with different values, the request will fail with an BAD_REQUEST error. *Changed in version 2.2.0*&#58; Field becomes nullable. *Deprecated since version 2.2.0*&#58; Use 'logical_date' instead. | [optional] -**StartDate** | Pointer to **NullableTime** | The start time. The time when DAG run was actually created. *Changed in version 2.1.3*&#58; Field becomes nullable. | [optional] [readonly] +**DagRunId** | Pointer to **NullableString** | Run ID. The value of this field can be set only when creating the object. If you try to modify the field of an existing object, the request fails with an BAD_REQUEST error. If not provided, a value will be generated based on execution_date. If the specified dag_run_id is in use, the creation request fails with an ALREADY_EXISTS error. This together with DAG_ID are a unique key. | [optional] +**DataIntervalEnd** | Pointer to **NullableTime** | The end of the interval the DAG run covers. | [optional] +**DataIntervalStart** | Pointer to **NullableTime** | The beginning of the interval the DAG run covers. | [optional] **EndDate** | Pointer to **NullableTime** | | [optional] [readonly] -**DataIntervalStart** | Pointer to **NullableTime** | | [optional] [readonly] -**DataIntervalEnd** | Pointer to **NullableTime** | | [optional] [readonly] +**ExecutionDate** | Pointer to **NullableTime** | The execution date. This is the same as logical_date, kept for backwards compatibility. If both this field and logical_date are provided but with different values, the request will fail with an BAD_REQUEST error. *Changed in version 2.2.0*&#58; Field becomes nullable. *Deprecated since version 2.2.0*&#58; Use 'logical_date' instead. | [optional] +**ExternalTrigger** | Pointer to **bool** | | [optional] [readonly] **LastSchedulingDecision** | Pointer to **NullableTime** | | [optional] [readonly] +**LogicalDate** | Pointer to **NullableTime** | The logical date (previously called execution date). This is the time or interval covered by this DAG run, according to the DAG definition. The value of this field can be set only when creating the object. If you try to modify the field of an existing object, the request fails with an BAD_REQUEST error. This together with DAG_ID are a unique key. *New in version 2.2.0* | [optional] +**Note** | Pointer to **NullableString** | Contains manually entered notes by the user about the DagRun. *New in version 2.5.0* | [optional] **RunType** | Pointer to **string** | | [optional] [readonly] +**StartDate** | Pointer to **NullableTime** | The start time. The time when DAG run was actually created. *Changed in version 2.1.3*&#58; Field becomes nullable. | [optional] [readonly] **State** | Pointer to [**DagState**](DagState.md) | | [optional] -**ExternalTrigger** | Pointer to **bool** | | [optional] [readonly] [default to true] -**Conf** | Pointer to **map[string]interface{}** | JSON object describing additional configuration parameters. The value of this field can be set only when creating the object. If you try to modify the field of an existing object, the request fails with an BAD_REQUEST error. | [optional] -**Note** | Pointer to **NullableString** | Contains manually entered notes by the user about the DagRun. *New in version 2.5.0* | [optional] ## Methods @@ -57,41 +38,31 @@ NewDAGRunWithDefaults instantiates a new DAGRun object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetDagRunId +### GetConf -`func (o *DAGRun) GetDagRunId() string` +`func (o *DAGRun) GetConf() map[string]interface{}` -GetDagRunId returns the DagRunId field if non-nil, zero value otherwise. +GetConf returns the Conf field if non-nil, zero value otherwise. -### GetDagRunIdOk +### GetConfOk -`func (o *DAGRun) GetDagRunIdOk() (*string, bool)` +`func (o *DAGRun) GetConfOk() (*map[string]interface{}, bool)` -GetDagRunIdOk returns a tuple with the DagRunId field if it's non-nil, zero value otherwise +GetConfOk returns a tuple with the Conf field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDagRunId - -`func (o *DAGRun) SetDagRunId(v string)` - -SetDagRunId sets DagRunId field to given value. - -### HasDagRunId - -`func (o *DAGRun) HasDagRunId() bool` +### SetConf -HasDagRunId returns a boolean if a field has been set. +`func (o *DAGRun) SetConf(v map[string]interface{})` -### SetDagRunIdNil +SetConf sets Conf field to given value. -`func (o *DAGRun) SetDagRunIdNil(b bool)` +### HasConf - SetDagRunIdNil sets the value for DagRunId to be an explicit nil +`func (o *DAGRun) HasConf() bool` -### UnsetDagRunId -`func (o *DAGRun) UnsetDagRunId()` +HasConf returns a boolean if a field has been set. -UnsetDagRunId ensures that no value is present for DagRunId, not even an explicit nil ### GetDagId `func (o *DAGRun) GetDagId() string` @@ -117,111 +88,111 @@ SetDagId sets DagId field to given value. HasDagId returns a boolean if a field has been set. -### GetLogicalDate +### GetDagRunId -`func (o *DAGRun) GetLogicalDate() time.Time` +`func (o *DAGRun) GetDagRunId() string` -GetLogicalDate returns the LogicalDate field if non-nil, zero value otherwise. +GetDagRunId returns the DagRunId field if non-nil, zero value otherwise. -### GetLogicalDateOk +### GetDagRunIdOk -`func (o *DAGRun) GetLogicalDateOk() (*time.Time, bool)` +`func (o *DAGRun) GetDagRunIdOk() (*string, bool)` -GetLogicalDateOk returns a tuple with the LogicalDate field if it's non-nil, zero value otherwise +GetDagRunIdOk returns a tuple with the DagRunId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetLogicalDate +### SetDagRunId -`func (o *DAGRun) SetLogicalDate(v time.Time)` +`func (o *DAGRun) SetDagRunId(v string)` -SetLogicalDate sets LogicalDate field to given value. +SetDagRunId sets DagRunId field to given value. -### HasLogicalDate +### HasDagRunId -`func (o *DAGRun) HasLogicalDate() bool` +`func (o *DAGRun) HasDagRunId() bool` -HasLogicalDate returns a boolean if a field has been set. +HasDagRunId returns a boolean if a field has been set. -### SetLogicalDateNil +### SetDagRunIdNil -`func (o *DAGRun) SetLogicalDateNil(b bool)` +`func (o *DAGRun) SetDagRunIdNil(b bool)` - SetLogicalDateNil sets the value for LogicalDate to be an explicit nil + SetDagRunIdNil sets the value for DagRunId to be an explicit nil -### UnsetLogicalDate -`func (o *DAGRun) UnsetLogicalDate()` +### UnsetDagRunId +`func (o *DAGRun) UnsetDagRunId()` -UnsetLogicalDate ensures that no value is present for LogicalDate, not even an explicit nil -### GetExecutionDate +UnsetDagRunId ensures that no value is present for DagRunId, not even an explicit nil +### GetDataIntervalEnd -`func (o *DAGRun) GetExecutionDate() time.Time` +`func (o *DAGRun) GetDataIntervalEnd() time.Time` -GetExecutionDate returns the ExecutionDate field if non-nil, zero value otherwise. +GetDataIntervalEnd returns the DataIntervalEnd field if non-nil, zero value otherwise. -### GetExecutionDateOk +### GetDataIntervalEndOk -`func (o *DAGRun) GetExecutionDateOk() (*time.Time, bool)` +`func (o *DAGRun) GetDataIntervalEndOk() (*time.Time, bool)` -GetExecutionDateOk returns a tuple with the ExecutionDate field if it's non-nil, zero value otherwise +GetDataIntervalEndOk returns a tuple with the DataIntervalEnd field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetExecutionDate +### SetDataIntervalEnd -`func (o *DAGRun) SetExecutionDate(v time.Time)` +`func (o *DAGRun) SetDataIntervalEnd(v time.Time)` -SetExecutionDate sets ExecutionDate field to given value. +SetDataIntervalEnd sets DataIntervalEnd field to given value. -### HasExecutionDate +### HasDataIntervalEnd -`func (o *DAGRun) HasExecutionDate() bool` +`func (o *DAGRun) HasDataIntervalEnd() bool` -HasExecutionDate returns a boolean if a field has been set. +HasDataIntervalEnd returns a boolean if a field has been set. -### SetExecutionDateNil +### SetDataIntervalEndNil -`func (o *DAGRun) SetExecutionDateNil(b bool)` +`func (o *DAGRun) SetDataIntervalEndNil(b bool)` - SetExecutionDateNil sets the value for ExecutionDate to be an explicit nil + SetDataIntervalEndNil sets the value for DataIntervalEnd to be an explicit nil -### UnsetExecutionDate -`func (o *DAGRun) UnsetExecutionDate()` +### UnsetDataIntervalEnd +`func (o *DAGRun) UnsetDataIntervalEnd()` -UnsetExecutionDate ensures that no value is present for ExecutionDate, not even an explicit nil -### GetStartDate +UnsetDataIntervalEnd ensures that no value is present for DataIntervalEnd, not even an explicit nil +### GetDataIntervalStart -`func (o *DAGRun) GetStartDate() time.Time` +`func (o *DAGRun) GetDataIntervalStart() time.Time` -GetStartDate returns the StartDate field if non-nil, zero value otherwise. +GetDataIntervalStart returns the DataIntervalStart field if non-nil, zero value otherwise. -### GetStartDateOk +### GetDataIntervalStartOk -`func (o *DAGRun) GetStartDateOk() (*time.Time, bool)` +`func (o *DAGRun) GetDataIntervalStartOk() (*time.Time, bool)` -GetStartDateOk returns a tuple with the StartDate field if it's non-nil, zero value otherwise +GetDataIntervalStartOk returns a tuple with the DataIntervalStart field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetStartDate +### SetDataIntervalStart -`func (o *DAGRun) SetStartDate(v time.Time)` +`func (o *DAGRun) SetDataIntervalStart(v time.Time)` -SetStartDate sets StartDate field to given value. +SetDataIntervalStart sets DataIntervalStart field to given value. -### HasStartDate +### HasDataIntervalStart -`func (o *DAGRun) HasStartDate() bool` +`func (o *DAGRun) HasDataIntervalStart() bool` -HasStartDate returns a boolean if a field has been set. +HasDataIntervalStart returns a boolean if a field has been set. -### SetStartDateNil +### SetDataIntervalStartNil -`func (o *DAGRun) SetStartDateNil(b bool)` +`func (o *DAGRun) SetDataIntervalStartNil(b bool)` - SetStartDateNil sets the value for StartDate to be an explicit nil + SetDataIntervalStartNil sets the value for DataIntervalStart to be an explicit nil -### UnsetStartDate -`func (o *DAGRun) UnsetStartDate()` +### UnsetDataIntervalStart +`func (o *DAGRun) UnsetDataIntervalStart()` -UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil +UnsetDataIntervalStart ensures that no value is present for DataIntervalStart, not even an explicit nil ### GetEndDate `func (o *DAGRun) GetEndDate() time.Time` @@ -257,76 +228,66 @@ HasEndDate returns a boolean if a field has been set. `func (o *DAGRun) UnsetEndDate()` UnsetEndDate ensures that no value is present for EndDate, not even an explicit nil -### GetDataIntervalStart +### GetExecutionDate -`func (o *DAGRun) GetDataIntervalStart() time.Time` +`func (o *DAGRun) GetExecutionDate() time.Time` -GetDataIntervalStart returns the DataIntervalStart field if non-nil, zero value otherwise. +GetExecutionDate returns the ExecutionDate field if non-nil, zero value otherwise. -### GetDataIntervalStartOk +### GetExecutionDateOk -`func (o *DAGRun) GetDataIntervalStartOk() (*time.Time, bool)` +`func (o *DAGRun) GetExecutionDateOk() (*time.Time, bool)` -GetDataIntervalStartOk returns a tuple with the DataIntervalStart field if it's non-nil, zero value otherwise +GetExecutionDateOk returns a tuple with the ExecutionDate field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDataIntervalStart +### SetExecutionDate -`func (o *DAGRun) SetDataIntervalStart(v time.Time)` +`func (o *DAGRun) SetExecutionDate(v time.Time)` -SetDataIntervalStart sets DataIntervalStart field to given value. +SetExecutionDate sets ExecutionDate field to given value. -### HasDataIntervalStart +### HasExecutionDate -`func (o *DAGRun) HasDataIntervalStart() bool` +`func (o *DAGRun) HasExecutionDate() bool` -HasDataIntervalStart returns a boolean if a field has been set. +HasExecutionDate returns a boolean if a field has been set. -### SetDataIntervalStartNil +### SetExecutionDateNil -`func (o *DAGRun) SetDataIntervalStartNil(b bool)` +`func (o *DAGRun) SetExecutionDateNil(b bool)` - SetDataIntervalStartNil sets the value for DataIntervalStart to be an explicit nil + SetExecutionDateNil sets the value for ExecutionDate to be an explicit nil -### UnsetDataIntervalStart -`func (o *DAGRun) UnsetDataIntervalStart()` +### UnsetExecutionDate +`func (o *DAGRun) UnsetExecutionDate()` -UnsetDataIntervalStart ensures that no value is present for DataIntervalStart, not even an explicit nil -### GetDataIntervalEnd +UnsetExecutionDate ensures that no value is present for ExecutionDate, not even an explicit nil +### GetExternalTrigger -`func (o *DAGRun) GetDataIntervalEnd() time.Time` +`func (o *DAGRun) GetExternalTrigger() bool` -GetDataIntervalEnd returns the DataIntervalEnd field if non-nil, zero value otherwise. +GetExternalTrigger returns the ExternalTrigger field if non-nil, zero value otherwise. -### GetDataIntervalEndOk +### GetExternalTriggerOk -`func (o *DAGRun) GetDataIntervalEndOk() (*time.Time, bool)` +`func (o *DAGRun) GetExternalTriggerOk() (*bool, bool)` -GetDataIntervalEndOk returns a tuple with the DataIntervalEnd field if it's non-nil, zero value otherwise +GetExternalTriggerOk returns a tuple with the ExternalTrigger field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDataIntervalEnd - -`func (o *DAGRun) SetDataIntervalEnd(v time.Time)` - -SetDataIntervalEnd sets DataIntervalEnd field to given value. - -### HasDataIntervalEnd - -`func (o *DAGRun) HasDataIntervalEnd() bool` +### SetExternalTrigger -HasDataIntervalEnd returns a boolean if a field has been set. +`func (o *DAGRun) SetExternalTrigger(v bool)` -### SetDataIntervalEndNil +SetExternalTrigger sets ExternalTrigger field to given value. -`func (o *DAGRun) SetDataIntervalEndNil(b bool)` +### HasExternalTrigger - SetDataIntervalEndNil sets the value for DataIntervalEnd to be an explicit nil +`func (o *DAGRun) HasExternalTrigger() bool` -### UnsetDataIntervalEnd -`func (o *DAGRun) UnsetDataIntervalEnd()` +HasExternalTrigger returns a boolean if a field has been set. -UnsetDataIntervalEnd ensures that no value is present for DataIntervalEnd, not even an explicit nil ### GetLastSchedulingDecision `func (o *DAGRun) GetLastSchedulingDecision() time.Time` @@ -362,141 +323,161 @@ HasLastSchedulingDecision returns a boolean if a field has been set. `func (o *DAGRun) UnsetLastSchedulingDecision()` UnsetLastSchedulingDecision ensures that no value is present for LastSchedulingDecision, not even an explicit nil -### GetRunType +### GetLogicalDate -`func (o *DAGRun) GetRunType() string` +`func (o *DAGRun) GetLogicalDate() time.Time` -GetRunType returns the RunType field if non-nil, zero value otherwise. +GetLogicalDate returns the LogicalDate field if non-nil, zero value otherwise. -### GetRunTypeOk +### GetLogicalDateOk -`func (o *DAGRun) GetRunTypeOk() (*string, bool)` +`func (o *DAGRun) GetLogicalDateOk() (*time.Time, bool)` -GetRunTypeOk returns a tuple with the RunType field if it's non-nil, zero value otherwise +GetLogicalDateOk returns a tuple with the LogicalDate field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetRunType +### SetLogicalDate -`func (o *DAGRun) SetRunType(v string)` +`func (o *DAGRun) SetLogicalDate(v time.Time)` -SetRunType sets RunType field to given value. +SetLogicalDate sets LogicalDate field to given value. -### HasRunType +### HasLogicalDate -`func (o *DAGRun) HasRunType() bool` +`func (o *DAGRun) HasLogicalDate() bool` -HasRunType returns a boolean if a field has been set. +HasLogicalDate returns a boolean if a field has been set. -### GetState +### SetLogicalDateNil -`func (o *DAGRun) GetState() DagState` +`func (o *DAGRun) SetLogicalDateNil(b bool)` -GetState returns the State field if non-nil, zero value otherwise. + SetLogicalDateNil sets the value for LogicalDate to be an explicit nil -### GetStateOk +### UnsetLogicalDate +`func (o *DAGRun) UnsetLogicalDate()` -`func (o *DAGRun) GetStateOk() (*DagState, bool)` +UnsetLogicalDate ensures that no value is present for LogicalDate, not even an explicit nil +### GetNote -GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +`func (o *DAGRun) GetNote() string` + +GetNote returns the Note field if non-nil, zero value otherwise. + +### GetNoteOk + +`func (o *DAGRun) GetNoteOk() (*string, bool)` + +GetNoteOk returns a tuple with the Note field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetState +### SetNote -`func (o *DAGRun) SetState(v DagState)` +`func (o *DAGRun) SetNote(v string)` -SetState sets State field to given value. +SetNote sets Note field to given value. -### HasState +### HasNote -`func (o *DAGRun) HasState() bool` +`func (o *DAGRun) HasNote() bool` -HasState returns a boolean if a field has been set. +HasNote returns a boolean if a field has been set. -### GetExternalTrigger +### SetNoteNil -`func (o *DAGRun) GetExternalTrigger() bool` +`func (o *DAGRun) SetNoteNil(b bool)` -GetExternalTrigger returns the ExternalTrigger field if non-nil, zero value otherwise. + SetNoteNil sets the value for Note to be an explicit nil -### GetExternalTriggerOk +### UnsetNote +`func (o *DAGRun) UnsetNote()` -`func (o *DAGRun) GetExternalTriggerOk() (*bool, bool)` +UnsetNote ensures that no value is present for Note, not even an explicit nil +### GetRunType -GetExternalTriggerOk returns a tuple with the ExternalTrigger field if it's non-nil, zero value otherwise +`func (o *DAGRun) GetRunType() string` + +GetRunType returns the RunType field if non-nil, zero value otherwise. + +### GetRunTypeOk + +`func (o *DAGRun) GetRunTypeOk() (*string, bool)` + +GetRunTypeOk returns a tuple with the RunType field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetExternalTrigger +### SetRunType -`func (o *DAGRun) SetExternalTrigger(v bool)` +`func (o *DAGRun) SetRunType(v string)` -SetExternalTrigger sets ExternalTrigger field to given value. +SetRunType sets RunType field to given value. -### HasExternalTrigger +### HasRunType -`func (o *DAGRun) HasExternalTrigger() bool` +`func (o *DAGRun) HasRunType() bool` -HasExternalTrigger returns a boolean if a field has been set. +HasRunType returns a boolean if a field has been set. -### GetConf +### GetStartDate -`func (o *DAGRun) GetConf() map[string]interface{}` +`func (o *DAGRun) GetStartDate() time.Time` -GetConf returns the Conf field if non-nil, zero value otherwise. +GetStartDate returns the StartDate field if non-nil, zero value otherwise. -### GetConfOk +### GetStartDateOk -`func (o *DAGRun) GetConfOk() (*map[string]interface{}, bool)` +`func (o *DAGRun) GetStartDateOk() (*time.Time, bool)` -GetConfOk returns a tuple with the Conf field if it's non-nil, zero value otherwise +GetStartDateOk returns a tuple with the StartDate field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetConf +### SetStartDate -`func (o *DAGRun) SetConf(v map[string]interface{})` +`func (o *DAGRun) SetStartDate(v time.Time)` -SetConf sets Conf field to given value. +SetStartDate sets StartDate field to given value. -### HasConf +### HasStartDate -`func (o *DAGRun) HasConf() bool` +`func (o *DAGRun) HasStartDate() bool` -HasConf returns a boolean if a field has been set. +HasStartDate returns a boolean if a field has been set. -### GetNote +### SetStartDateNil -`func (o *DAGRun) GetNote() string` +`func (o *DAGRun) SetStartDateNil(b bool)` -GetNote returns the Note field if non-nil, zero value otherwise. + SetStartDateNil sets the value for StartDate to be an explicit nil -### GetNoteOk +### UnsetStartDate +`func (o *DAGRun) UnsetStartDate()` -`func (o *DAGRun) GetNoteOk() (*string, bool)` +UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil +### GetState -GetNoteOk returns a tuple with the Note field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. +`func (o *DAGRun) GetState() DagState` -### SetNote +GetState returns the State field if non-nil, zero value otherwise. -`func (o *DAGRun) SetNote(v string)` +### GetStateOk -SetNote sets Note field to given value. +`func (o *DAGRun) GetStateOk() (*DagState, bool)` -### HasNote +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. -`func (o *DAGRun) HasNote() bool` +### SetState -HasNote returns a boolean if a field has been set. +`func (o *DAGRun) SetState(v DagState)` -### SetNoteNil +SetState sets State field to given value. -`func (o *DAGRun) SetNoteNil(b bool)` +### HasState - SetNoteNil sets the value for Note to be an explicit nil +`func (o *DAGRun) HasState() bool` -### UnsetNote -`func (o *DAGRun) UnsetNote()` +HasState returns a boolean if a field has been set. -UnsetNote ensures that no value is present for Note, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/DAGRunApi.md b/airflow/docs/DAGRunApi.md index 5e3e57b..d2af646 100644 --- a/airflow/docs/DAGRunApi.md +++ b/airflow/docs/DAGRunApi.md @@ -1,43 +1,24 @@ - - -# \DAGRunApi - -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**ClearDagRun**](DAGRunApi.md#ClearDagRun) | **Post** /dags/{dag_id}/dagRuns/{dag_run_id}/clear | Clear a DAG run -[**DeleteDagRun**](DAGRunApi.md#DeleteDagRun) | **Delete** /dags/{dag_id}/dagRuns/{dag_run_id} | Delete a DAG run -[**GetDagRun**](DAGRunApi.md#GetDagRun) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id} | Get a DAG run -[**GetDagRuns**](DAGRunApi.md#GetDagRuns) | **Get** /dags/{dag_id}/dagRuns | List DAG runs -[**GetDagRunsBatch**](DAGRunApi.md#GetDagRunsBatch) | **Post** /dags/~/dagRuns/list | List DAG runs (batch) -[**GetUpstreamDatasetEvents**](DAGRunApi.md#GetUpstreamDatasetEvents) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/upstreamDatasetEvents | Get dataset events for a DAG run -[**PostDagRun**](DAGRunApi.md#PostDagRun) | **Post** /dags/{dag_id}/dagRuns | Trigger a new DAG run -[**SetDagRunNote**](DAGRunApi.md#SetDagRunNote) | **Patch** /dags/{dag_id}/dagRuns/{dag_run_id}/setNote | Update the DagRun note. -[**UpdateDagRunState**](DAGRunApi.md#UpdateDagRunState) | **Patch** /dags/{dag_id}/dagRuns/{dag_run_id} | Modify a DAG run +[**ClearDagRun**](DAGRunAPI.md#ClearDagRun) | **Post** /dags/{dag_id}/dagRuns/{dag_run_id}/clear | Clear a DAG run +[**DeleteDagRun**](DAGRunAPI.md#DeleteDagRun) | **Delete** /dags/{dag_id}/dagRuns/{dag_run_id} | Delete a DAG run +[**GetDagRun**](DAGRunAPI.md#GetDagRun) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id} | Get a DAG run +[**GetDagRuns**](DAGRunAPI.md#GetDagRuns) | **Get** /dags/{dag_id}/dagRuns | List DAG runs +[**GetDagRunsBatch**](DAGRunAPI.md#GetDagRunsBatch) | **Post** /dags/~/dagRuns/list | List DAG runs (batch) +[**GetUpstreamDatasetEvents**](DAGRunAPI.md#GetUpstreamDatasetEvents) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/upstreamDatasetEvents | Get dataset events for a DAG run +[**PostDagRun**](DAGRunAPI.md#PostDagRun) | **Post** /dags/{dag_id}/dagRuns | Trigger a new DAG run. +[**SetDagRunNote**](DAGRunAPI.md#SetDagRunNote) | **Patch** /dags/{dag_id}/dagRuns/{dag_run_id}/setNote | Update the DagRun note. +[**UpdateDagRunState**](DAGRunAPI.md#UpdateDagRunState) | **Patch** /dags/{dag_id}/dagRuns/{dag_run_id} | Modify a DAG run ## ClearDagRun -> DAGRun ClearDagRun(ctx, dagId, dagRunId).ClearDagRun(clearDagRun).Execute() +> ClearDagRun200Response ClearDagRun(ctx, dagId, dagRunId).ClearDagRun(clearDagRun).Execute() Clear a DAG run @@ -49,26 +30,26 @@ Clear a DAG run package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - dagRunId := "dagRunId_example" // string | The DAG run ID. - clearDagRun := *openapiclient.NewClearDagRun() // ClearDagRun | - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DAGRunApi.ClearDagRun(context.Background(), dagId, dagRunId).ClearDagRun(clearDagRun).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DAGRunApi.ClearDagRun``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ClearDagRun`: DAGRun - fmt.Fprintf(os.Stdout, "Response from `DAGRunApi.ClearDagRun`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + clearDagRun := *openapiclient.NewClearDagRun() // ClearDagRun | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DAGRunAPI.ClearDagRun(context.Background(), dagId, dagRunId).ClearDagRun(clearDagRun).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DAGRunAPI.ClearDagRun``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ClearDagRun`: ClearDagRun200Response + fmt.Fprintf(os.Stdout, "Response from `DAGRunAPI.ClearDagRun`: %v\n", resp) } ``` @@ -94,11 +75,11 @@ Name | Type | Description | Notes ### Return type -[**DAGRun**](DAGRun.md) +[**ClearDagRun200Response**](ClearDagRun200Response.md) ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -122,23 +103,23 @@ Delete a DAG run package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - dagRunId := "dagRunId_example" // string | The DAG run ID. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DAGRunApi.DeleteDagRun(context.Background(), dagId, dagRunId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DAGRunApi.DeleteDagRun``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.DAGRunAPI.DeleteDagRun(context.Background(), dagId, dagRunId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DAGRunAPI.DeleteDagRun``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -167,7 +148,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -181,7 +162,7 @@ Name | Type | Description | Notes ## GetDagRun -> DAGRun GetDagRun(ctx, dagId, dagRunId).Execute() +> DAGRun GetDagRun(ctx, dagId, dagRunId).Fields(fields).Execute() Get a DAG run @@ -191,25 +172,26 @@ Get a DAG run package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - dagRunId := "dagRunId_example" // string | The DAG run ID. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DAGRunApi.GetDagRun(context.Background(), dagId, dagRunId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DAGRunApi.GetDagRun``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetDagRun`: DAGRun - fmt.Fprintf(os.Stdout, "Response from `DAGRunApi.GetDagRun`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + fields := []string{"Inner_example"} // []string | List of field for return. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DAGRunAPI.GetDagRun(context.Background(), dagId, dagRunId).Fields(fields).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DAGRunAPI.GetDagRun``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetDagRun`: DAGRun + fmt.Fprintf(os.Stdout, "Response from `DAGRunAPI.GetDagRun`: %v\n", resp) } ``` @@ -231,6 +213,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **fields** | **[]string** | List of field for return. | ### Return type @@ -238,7 +221,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -252,7 +235,7 @@ Name | Type | Description | Notes ## GetDagRuns -> DAGRunCollection GetDagRuns(ctx, dagId).Limit(limit).Offset(offset).ExecutionDateGte(executionDateGte).ExecutionDateLte(executionDateLte).StartDateGte(startDateGte).StartDateLte(startDateLte).EndDateGte(endDateGte).EndDateLte(endDateLte).State(state).OrderBy(orderBy).Execute() +> DAGRunCollection GetDagRuns(ctx, dagId).Limit(limit).Offset(offset).ExecutionDateGte(executionDateGte).ExecutionDateLte(executionDateLte).StartDateGte(startDateGte).StartDateLte(startDateLte).EndDateGte(endDateGte).EndDateLte(endDateLte).UpdatedAtGte(updatedAtGte).UpdatedAtLte(updatedAtLte).State(state).OrderBy(orderBy).Fields(fields).Execute() List DAG runs @@ -264,35 +247,38 @@ List DAG runs package main import ( - "context" - "fmt" - "os" + "context" + "fmt" + "os" "time" - openapiclient "./openapi" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) - offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) - executionDateGte := time.Now() // time.Time | Returns objects greater or equal to the specified date. This can be combined with execution_date_lte parameter to receive only the selected period. (optional) - executionDateLte := time.Now() // time.Time | Returns objects less than or equal to the specified date. This can be combined with execution_date_gte parameter to receive only the selected period. (optional) - startDateGte := time.Now() // time.Time | Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. (optional) - startDateLte := time.Now() // time.Time | Returns objects less or equal the specified date. This can be combined with start_date_gte parameter to receive only the selected period. (optional) - endDateGte := time.Now() // time.Time | Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. (optional) - endDateLte := time.Now() // time.Time | Returns objects less than or equal to the specified date. This can be combined with start_date_gte parameter to receive only the selected period. (optional) - state := []string{"Inner_example"} // []string | The value can be repeated to retrieve multiple matching values (OR condition). (optional) - orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DAGRunApi.GetDagRuns(context.Background(), dagId).Limit(limit).Offset(offset).ExecutionDateGte(executionDateGte).ExecutionDateLte(executionDateLte).StartDateGte(startDateGte).StartDateLte(startDateLte).EndDateGte(endDateGte).EndDateLte(endDateLte).State(state).OrderBy(orderBy).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DAGRunApi.GetDagRuns``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetDagRuns`: DAGRunCollection - fmt.Fprintf(os.Stdout, "Response from `DAGRunApi.GetDagRuns`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) + offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) + executionDateGte := time.Now() // time.Time | Returns objects greater or equal to the specified date. This can be combined with execution_date_lte parameter to receive only the selected period. (optional) + executionDateLte := time.Now() // time.Time | Returns objects less than or equal to the specified date. This can be combined with execution_date_gte parameter to receive only the selected period. (optional) + startDateGte := time.Now() // time.Time | Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. (optional) + startDateLte := time.Now() // time.Time | Returns objects less or equal the specified date. This can be combined with start_date_gte parameter to receive only the selected period. (optional) + endDateGte := time.Now() // time.Time | Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. (optional) + endDateLte := time.Now() // time.Time | Returns objects less than or equal to the specified date. This can be combined with start_date_gte parameter to receive only the selected period. (optional) + updatedAtGte := time.Now() // time.Time | Returns objects greater or equal the specified date. This can be combined with updated_at_lte parameter to receive only the selected period. *New in version 2.6.0* (optional) + updatedAtLte := time.Now() // time.Time | Returns objects less or equal the specified date. This can be combined with updated_at_gte parameter to receive only the selected period. *New in version 2.6.0* (optional) + state := []string{"Inner_example"} // []string | The value can be repeated to retrieve multiple matching values (OR condition). (optional) + orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) + fields := []string{"Inner_example"} // []string | List of field for return. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DAGRunAPI.GetDagRuns(context.Background(), dagId).Limit(limit).Offset(offset).ExecutionDateGte(executionDateGte).ExecutionDateLte(executionDateLte).StartDateGte(startDateGte).StartDateLte(startDateLte).EndDateGte(endDateGte).EndDateLte(endDateLte).UpdatedAtGte(updatedAtGte).UpdatedAtLte(updatedAtLte).State(state).OrderBy(orderBy).Fields(fields).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DAGRunAPI.GetDagRuns``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetDagRuns`: DAGRunCollection + fmt.Fprintf(os.Stdout, "Response from `DAGRunAPI.GetDagRuns`: %v\n", resp) } ``` @@ -320,8 +306,11 @@ Name | Type | Description | Notes **startDateLte** | **time.Time** | Returns objects less or equal the specified date. This can be combined with start_date_gte parameter to receive only the selected period. | **endDateGte** | **time.Time** | Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. | **endDateLte** | **time.Time** | Returns objects less than or equal to the specified date. This can be combined with start_date_gte parameter to receive only the selected period. | + **updatedAtGte** | **time.Time** | Returns objects greater or equal the specified date. This can be combined with updated_at_lte parameter to receive only the selected period. *New in version 2.6.0* | + **updatedAtLte** | **time.Time** | Returns objects less or equal the specified date. This can be combined with updated_at_gte parameter to receive only the selected period. *New in version 2.6.0* | **state** | **[]string** | The value can be repeated to retrieve multiple matching values (OR condition). | **orderBy** | **string** | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* | + **fields** | **[]string** | List of field for return. | ### Return type @@ -329,7 +318,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -355,24 +344,24 @@ List DAG runs (batch) package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - listDagRunsForm := *openapiclient.NewListDagRunsForm() // ListDagRunsForm | - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DAGRunApi.GetDagRunsBatch(context.Background()).ListDagRunsForm(listDagRunsForm).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DAGRunApi.GetDagRunsBatch``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetDagRunsBatch`: DAGRunCollection - fmt.Fprintf(os.Stdout, "Response from `DAGRunApi.GetDagRunsBatch`: %v\n", resp) + listDagRunsForm := *openapiclient.NewListDagRunsForm() // ListDagRunsForm | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DAGRunAPI.GetDagRunsBatch(context.Background()).ListDagRunsForm(listDagRunsForm).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DAGRunAPI.GetDagRunsBatch``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetDagRunsBatch`: DAGRunCollection + fmt.Fprintf(os.Stdout, "Response from `DAGRunAPI.GetDagRunsBatch`: %v\n", resp) } ``` @@ -395,7 +384,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -421,25 +410,25 @@ Get dataset events for a DAG run package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - dagRunId := "dagRunId_example" // string | The DAG run ID. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DAGRunApi.GetUpstreamDatasetEvents(context.Background(), dagId, dagRunId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DAGRunApi.GetUpstreamDatasetEvents``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetUpstreamDatasetEvents`: DatasetEventCollection - fmt.Fprintf(os.Stdout, "Response from `DAGRunApi.GetUpstreamDatasetEvents`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DAGRunAPI.GetUpstreamDatasetEvents(context.Background(), dagId, dagRunId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DAGRunAPI.GetUpstreamDatasetEvents``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetUpstreamDatasetEvents`: DatasetEventCollection + fmt.Fprintf(os.Stdout, "Response from `DAGRunAPI.GetUpstreamDatasetEvents`: %v\n", resp) } ``` @@ -468,7 +457,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -484,7 +473,9 @@ Name | Type | Description | Notes > DAGRun PostDagRun(ctx, dagId).DAGRun(dAGRun).Execute() -Trigger a new DAG run +Trigger a new DAG run. + + ### Example @@ -492,25 +483,25 @@ Trigger a new DAG run package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - dAGRun := *openapiclient.NewDAGRun() // DAGRun | - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DAGRunApi.PostDagRun(context.Background(), dagId).DAGRun(dAGRun).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DAGRunApi.PostDagRun``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PostDagRun`: DAGRun - fmt.Fprintf(os.Stdout, "Response from `DAGRunApi.PostDagRun`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + dAGRun := *openapiclient.NewDAGRun() // DAGRun | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DAGRunAPI.PostDagRun(context.Background(), dagId).DAGRun(dAGRun).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DAGRunAPI.PostDagRun``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PostDagRun`: DAGRun + fmt.Fprintf(os.Stdout, "Response from `DAGRunAPI.PostDagRun`: %v\n", resp) } ``` @@ -538,7 +529,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -564,26 +555,26 @@ Update the DagRun note. package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - dagRunId := "dagRunId_example" // string | The DAG run ID. - setDagRunNote := *openapiclient.NewSetDagRunNote() // SetDagRunNote | Parameters of set DagRun note. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DAGRunApi.SetDagRunNote(context.Background(), dagId, dagRunId).SetDagRunNote(setDagRunNote).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DAGRunApi.SetDagRunNote``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `SetDagRunNote`: DAGRun - fmt.Fprintf(os.Stdout, "Response from `DAGRunApi.SetDagRunNote`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + setDagRunNote := *openapiclient.NewSetDagRunNote() // SetDagRunNote | Parameters of set DagRun note. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DAGRunAPI.SetDagRunNote(context.Background(), dagId, dagRunId).SetDagRunNote(setDagRunNote).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DAGRunAPI.SetDagRunNote``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `SetDagRunNote`: DAGRun + fmt.Fprintf(os.Stdout, "Response from `DAGRunAPI.SetDagRunNote`: %v\n", resp) } ``` @@ -613,7 +604,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -639,26 +630,26 @@ Modify a DAG run package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - dagRunId := "dagRunId_example" // string | The DAG run ID. - updateDagRunState := *openapiclient.NewUpdateDagRunState() // UpdateDagRunState | - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DAGRunApi.UpdateDagRunState(context.Background(), dagId, dagRunId).UpdateDagRunState(updateDagRunState).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DAGRunApi.UpdateDagRunState``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `UpdateDagRunState`: DAGRun - fmt.Fprintf(os.Stdout, "Response from `DAGRunApi.UpdateDagRunState`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + updateDagRunState := *openapiclient.NewUpdateDagRunState() // UpdateDagRunState | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DAGRunAPI.UpdateDagRunState(context.Background(), dagId, dagRunId).UpdateDagRunState(updateDagRunState).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DAGRunAPI.UpdateDagRunState``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateDagRunState`: DAGRun + fmt.Fprintf(os.Stdout, "Response from `DAGRunAPI.UpdateDagRunState`: %v\n", resp) } ``` @@ -688,7 +679,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers diff --git a/airflow/docs/DAGRunCollection.md b/airflow/docs/DAGRunCollection.md index 4a7721c..b1312ed 100644 --- a/airflow/docs/DAGRunCollection.md +++ b/airflow/docs/DAGRunCollection.md @@ -1,30 +1,11 @@ - - # DAGRunCollection ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] **DagRuns** | Pointer to [**[]DAGRun**](DAGRun.md) | | [optional] -**TotalEntries** | Pointer to **int32** | Count of objects in the current result set. | [optional] ## Methods @@ -45,55 +26,55 @@ NewDAGRunCollectionWithDefaults instantiates a new DAGRunCollection object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetDagRuns +### GetTotalEntries -`func (o *DAGRunCollection) GetDagRuns() []DAGRun` +`func (o *DAGRunCollection) GetTotalEntries() int32` -GetDagRuns returns the DagRuns field if non-nil, zero value otherwise. +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. -### GetDagRunsOk +### GetTotalEntriesOk -`func (o *DAGRunCollection) GetDagRunsOk() (*[]DAGRun, bool)` +`func (o *DAGRunCollection) GetTotalEntriesOk() (*int32, bool)` -GetDagRunsOk returns a tuple with the DagRuns field if it's non-nil, zero value otherwise +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDagRuns +### SetTotalEntries -`func (o *DAGRunCollection) SetDagRuns(v []DAGRun)` +`func (o *DAGRunCollection) SetTotalEntries(v int32)` -SetDagRuns sets DagRuns field to given value. +SetTotalEntries sets TotalEntries field to given value. -### HasDagRuns +### HasTotalEntries -`func (o *DAGRunCollection) HasDagRuns() bool` +`func (o *DAGRunCollection) HasTotalEntries() bool` -HasDagRuns returns a boolean if a field has been set. +HasTotalEntries returns a boolean if a field has been set. -### GetTotalEntries +### GetDagRuns -`func (o *DAGRunCollection) GetTotalEntries() int32` +`func (o *DAGRunCollection) GetDagRuns() []DAGRun` -GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. +GetDagRuns returns the DagRuns field if non-nil, zero value otherwise. -### GetTotalEntriesOk +### GetDagRunsOk -`func (o *DAGRunCollection) GetTotalEntriesOk() (*int32, bool)` +`func (o *DAGRunCollection) GetDagRunsOk() (*[]DAGRun, bool)` -GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +GetDagRunsOk returns a tuple with the DagRuns field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTotalEntries +### SetDagRuns -`func (o *DAGRunCollection) SetTotalEntries(v int32)` +`func (o *DAGRunCollection) SetDagRuns(v []DAGRun)` -SetTotalEntries sets TotalEntries field to given value. +SetDagRuns sets DagRuns field to given value. -### HasTotalEntries +### HasDagRuns -`func (o *DAGRunCollection) HasTotalEntries() bool` +`func (o *DAGRunCollection) HasDagRuns() bool` -HasTotalEntries returns a boolean if a field has been set. +HasDagRuns returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/DagProcessorStatus.md b/airflow/docs/DagProcessorStatus.md new file mode 100644 index 0000000..5aae46f --- /dev/null +++ b/airflow/docs/DagProcessorStatus.md @@ -0,0 +1,102 @@ +# DagProcessorStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LatestDagProcessorHeartbeat** | Pointer to **NullableString** | The time the dag processor last did a heartbeat. | [optional] [readonly] +**Status** | Pointer to [**NullableHealthStatus**](HealthStatus.md) | | [optional] + +## Methods + +### NewDagProcessorStatus + +`func NewDagProcessorStatus() *DagProcessorStatus` + +NewDagProcessorStatus instantiates a new DagProcessorStatus object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDagProcessorStatusWithDefaults + +`func NewDagProcessorStatusWithDefaults() *DagProcessorStatus` + +NewDagProcessorStatusWithDefaults instantiates a new DagProcessorStatus object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLatestDagProcessorHeartbeat + +`func (o *DagProcessorStatus) GetLatestDagProcessorHeartbeat() string` + +GetLatestDagProcessorHeartbeat returns the LatestDagProcessorHeartbeat field if non-nil, zero value otherwise. + +### GetLatestDagProcessorHeartbeatOk + +`func (o *DagProcessorStatus) GetLatestDagProcessorHeartbeatOk() (*string, bool)` + +GetLatestDagProcessorHeartbeatOk returns a tuple with the LatestDagProcessorHeartbeat field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLatestDagProcessorHeartbeat + +`func (o *DagProcessorStatus) SetLatestDagProcessorHeartbeat(v string)` + +SetLatestDagProcessorHeartbeat sets LatestDagProcessorHeartbeat field to given value. + +### HasLatestDagProcessorHeartbeat + +`func (o *DagProcessorStatus) HasLatestDagProcessorHeartbeat() bool` + +HasLatestDagProcessorHeartbeat returns a boolean if a field has been set. + +### SetLatestDagProcessorHeartbeatNil + +`func (o *DagProcessorStatus) SetLatestDagProcessorHeartbeatNil(b bool)` + + SetLatestDagProcessorHeartbeatNil sets the value for LatestDagProcessorHeartbeat to be an explicit nil + +### UnsetLatestDagProcessorHeartbeat +`func (o *DagProcessorStatus) UnsetLatestDagProcessorHeartbeat()` + +UnsetLatestDagProcessorHeartbeat ensures that no value is present for LatestDagProcessorHeartbeat, not even an explicit nil +### GetStatus + +`func (o *DagProcessorStatus) GetStatus() HealthStatus` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *DagProcessorStatus) GetStatusOk() (*HealthStatus, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *DagProcessorStatus) SetStatus(v HealthStatus)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *DagProcessorStatus) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### SetStatusNil + +`func (o *DagProcessorStatus) SetStatusNil(b bool)` + + SetStatusNil sets the value for Status to be an explicit nil + +### UnsetStatus +`func (o *DagProcessorStatus) UnsetStatus()` + +UnsetStatus ensures that no value is present for Status, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/docs/DagScheduleDatasetReference.md b/airflow/docs/DagScheduleDatasetReference.md index cd9828b..9a04309 100644 --- a/airflow/docs/DagScheduleDatasetReference.md +++ b/airflow/docs/DagScheduleDatasetReference.md @@ -1,30 +1,11 @@ - - # DagScheduleDatasetReference ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**DagId** | Pointer to **NullableString** | The DAG ID that depends on the dataset. | [optional] **CreatedAt** | Pointer to **string** | The dataset reference creation time | [optional] +**DagId** | Pointer to **NullableString** | The DAG ID that depends on the dataset. | [optional] **UpdatedAt** | Pointer to **string** | The dataset reference update time | [optional] ## Methods @@ -46,6 +27,31 @@ NewDagScheduleDatasetReferenceWithDefaults instantiates a new DagScheduleDataset This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set +### GetCreatedAt + +`func (o *DagScheduleDatasetReference) GetCreatedAt() string` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *DagScheduleDatasetReference) GetCreatedAtOk() (*string, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *DagScheduleDatasetReference) SetCreatedAt(v string)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *DagScheduleDatasetReference) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + ### GetDagId `func (o *DagScheduleDatasetReference) GetDagId() string` @@ -81,31 +87,6 @@ HasDagId returns a boolean if a field has been set. `func (o *DagScheduleDatasetReference) UnsetDagId()` UnsetDagId ensures that no value is present for DagId, not even an explicit nil -### GetCreatedAt - -`func (o *DagScheduleDatasetReference) GetCreatedAt() string` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *DagScheduleDatasetReference) GetCreatedAtOk() (*string, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *DagScheduleDatasetReference) SetCreatedAt(v string)` - -SetCreatedAt sets CreatedAt field to given value. - -### HasCreatedAt - -`func (o *DagScheduleDatasetReference) HasCreatedAt() bool` - -HasCreatedAt returns a boolean if a field has been set. - ### GetUpdatedAt `func (o *DagScheduleDatasetReference) GetUpdatedAt() string` diff --git a/airflow/docs/DagState.md b/airflow/docs/DagState.md index 389be7f..fcaa210 100644 --- a/airflow/docs/DagState.md +++ b/airflow/docs/DagState.md @@ -1,22 +1,3 @@ - - # DagState ## Enum diff --git a/airflow/docs/DagStatsAPI.md b/airflow/docs/DagStatsAPI.md new file mode 100644 index 0000000..43ed906 --- /dev/null +++ b/airflow/docs/DagStatsAPI.md @@ -0,0 +1,73 @@ +# \DagStatsAPI + +All URIs are relative to */api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetDagStats**](DagStatsAPI.md#GetDagStats) | **Get** /dagStats | List Dag statistics + + + +## GetDagStats + +> DagStatsCollectionSchema GetDagStats(ctx).DagIds(dagIds).Execute() + +List Dag statistics + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./airflow" +) + +func main() { + dagIds := "dagIds_example" // string | One or more DAG IDs separated by commas to filter relevant Dags. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DagStatsAPI.GetDagStats(context.Background()).DagIds(dagIds).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DagStatsAPI.GetDagStats``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetDagStats`: DagStatsCollectionSchema + fmt.Fprintf(os.Stdout, "Response from `DagStatsAPI.GetDagStats`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetDagStatsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **dagIds** | **string** | One or more DAG IDs separated by commas to filter relevant Dags. | + +### Return type + +[**DagStatsCollectionSchema**](DagStatsCollectionSchema.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[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/airflow/docs/DagStatsCollectionItem.md b/airflow/docs/DagStatsCollectionItem.md new file mode 100644 index 0000000..5fb1004 --- /dev/null +++ b/airflow/docs/DagStatsCollectionItem.md @@ -0,0 +1,92 @@ +# DagStatsCollectionItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DagId** | Pointer to **string** | The DAG ID. | [optional] +**Stats** | Pointer to [**[]DagStatsStateCollectionItem**](DagStatsStateCollectionItem.md) | | [optional] + +## Methods + +### NewDagStatsCollectionItem + +`func NewDagStatsCollectionItem() *DagStatsCollectionItem` + +NewDagStatsCollectionItem instantiates a new DagStatsCollectionItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDagStatsCollectionItemWithDefaults + +`func NewDagStatsCollectionItemWithDefaults() *DagStatsCollectionItem` + +NewDagStatsCollectionItemWithDefaults instantiates a new DagStatsCollectionItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDagId + +`func (o *DagStatsCollectionItem) GetDagId() string` + +GetDagId returns the DagId field if non-nil, zero value otherwise. + +### GetDagIdOk + +`func (o *DagStatsCollectionItem) GetDagIdOk() (*string, bool)` + +GetDagIdOk returns a tuple with the DagId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDagId + +`func (o *DagStatsCollectionItem) SetDagId(v string)` + +SetDagId sets DagId field to given value. + +### HasDagId + +`func (o *DagStatsCollectionItem) HasDagId() bool` + +HasDagId returns a boolean if a field has been set. + +### GetStats + +`func (o *DagStatsCollectionItem) GetStats() []DagStatsStateCollectionItem` + +GetStats returns the Stats field if non-nil, zero value otherwise. + +### GetStatsOk + +`func (o *DagStatsCollectionItem) GetStatsOk() (*[]DagStatsStateCollectionItem, bool)` + +GetStatsOk returns a tuple with the Stats field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStats + +`func (o *DagStatsCollectionItem) SetStats(v []DagStatsStateCollectionItem)` + +SetStats sets Stats field to given value. + +### HasStats + +`func (o *DagStatsCollectionItem) HasStats() bool` + +HasStats returns a boolean if a field has been set. + +### SetStatsNil + +`func (o *DagStatsCollectionItem) SetStatsNil(b bool)` + + SetStatsNil sets the value for Stats to be an explicit nil + +### UnsetStats +`func (o *DagStatsCollectionItem) UnsetStats()` + +UnsetStats ensures that no value is present for Stats, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/docs/DagStatsCollectionSchema.md b/airflow/docs/DagStatsCollectionSchema.md new file mode 100644 index 0000000..dd3a2da --- /dev/null +++ b/airflow/docs/DagStatsCollectionSchema.md @@ -0,0 +1,82 @@ +# DagStatsCollectionSchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] +**Dags** | Pointer to [**[]DagStatsCollectionItem**](DagStatsCollectionItem.md) | | [optional] + +## Methods + +### NewDagStatsCollectionSchema + +`func NewDagStatsCollectionSchema() *DagStatsCollectionSchema` + +NewDagStatsCollectionSchema instantiates a new DagStatsCollectionSchema object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDagStatsCollectionSchemaWithDefaults + +`func NewDagStatsCollectionSchemaWithDefaults() *DagStatsCollectionSchema` + +NewDagStatsCollectionSchemaWithDefaults instantiates a new DagStatsCollectionSchema object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotalEntries + +`func (o *DagStatsCollectionSchema) GetTotalEntries() int32` + +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. + +### GetTotalEntriesOk + +`func (o *DagStatsCollectionSchema) GetTotalEntriesOk() (*int32, bool)` + +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalEntries + +`func (o *DagStatsCollectionSchema) SetTotalEntries(v int32)` + +SetTotalEntries sets TotalEntries field to given value. + +### HasTotalEntries + +`func (o *DagStatsCollectionSchema) HasTotalEntries() bool` + +HasTotalEntries returns a boolean if a field has been set. + +### GetDags + +`func (o *DagStatsCollectionSchema) GetDags() []DagStatsCollectionItem` + +GetDags returns the Dags field if non-nil, zero value otherwise. + +### GetDagsOk + +`func (o *DagStatsCollectionSchema) GetDagsOk() (*[]DagStatsCollectionItem, bool)` + +GetDagsOk returns a tuple with the Dags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDags + +`func (o *DagStatsCollectionSchema) SetDags(v []DagStatsCollectionItem)` + +SetDags sets Dags field to given value. + +### HasDags + +`func (o *DagStatsCollectionSchema) HasDags() bool` + +HasDags returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/docs/DagStatsStateCollectionItem.md b/airflow/docs/DagStatsStateCollectionItem.md new file mode 100644 index 0000000..658855b --- /dev/null +++ b/airflow/docs/DagStatsStateCollectionItem.md @@ -0,0 +1,82 @@ +# DagStatsStateCollectionItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Count** | Pointer to **int32** | The DAG state count. | [optional] +**State** | Pointer to **string** | The DAG state. | [optional] + +## Methods + +### NewDagStatsStateCollectionItem + +`func NewDagStatsStateCollectionItem() *DagStatsStateCollectionItem` + +NewDagStatsStateCollectionItem instantiates a new DagStatsStateCollectionItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDagStatsStateCollectionItemWithDefaults + +`func NewDagStatsStateCollectionItemWithDefaults() *DagStatsStateCollectionItem` + +NewDagStatsStateCollectionItemWithDefaults instantiates a new DagStatsStateCollectionItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCount + +`func (o *DagStatsStateCollectionItem) GetCount() int32` + +GetCount returns the Count field if non-nil, zero value otherwise. + +### GetCountOk + +`func (o *DagStatsStateCollectionItem) GetCountOk() (*int32, bool)` + +GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCount + +`func (o *DagStatsStateCollectionItem) SetCount(v int32)` + +SetCount sets Count field to given value. + +### HasCount + +`func (o *DagStatsStateCollectionItem) HasCount() bool` + +HasCount returns a boolean if a field has been set. + +### GetState + +`func (o *DagStatsStateCollectionItem) GetState() string` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *DagStatsStateCollectionItem) GetStateOk() (*string, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *DagStatsStateCollectionItem) SetState(v string)` + +SetState sets State field to given value. + +### HasState + +`func (o *DagStatsStateCollectionItem) HasState() bool` + +HasState returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/docs/DagWarning.md b/airflow/docs/DagWarning.md index 6ba0d94..d4de254 100644 --- a/airflow/docs/DagWarning.md +++ b/airflow/docs/DagWarning.md @@ -1,22 +1,3 @@ - - # DagWarning ## Properties @@ -24,9 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **DagId** | Pointer to **string** | The dag_id. | [optional] [readonly] -**WarningType** | Pointer to **string** | The warning type for the dag warning. | [optional] [readonly] **Message** | Pointer to **string** | The message for the dag warning. | [optional] [readonly] **Timestamp** | Pointer to **string** | The time when this warning was logged. | [optional] [readonly] +**WarningType** | Pointer to **string** | The warning type for the dag warning. | [optional] [readonly] ## Methods @@ -72,31 +53,6 @@ SetDagId sets DagId field to given value. HasDagId returns a boolean if a field has been set. -### GetWarningType - -`func (o *DagWarning) GetWarningType() string` - -GetWarningType returns the WarningType field if non-nil, zero value otherwise. - -### GetWarningTypeOk - -`func (o *DagWarning) GetWarningTypeOk() (*string, bool)` - -GetWarningTypeOk returns a tuple with the WarningType field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetWarningType - -`func (o *DagWarning) SetWarningType(v string)` - -SetWarningType sets WarningType field to given value. - -### HasWarningType - -`func (o *DagWarning) HasWarningType() bool` - -HasWarningType returns a boolean if a field has been set. - ### GetMessage `func (o *DagWarning) GetMessage() string` @@ -147,6 +103,31 @@ SetTimestamp sets Timestamp field to given value. HasTimestamp returns a boolean if a field has been set. +### GetWarningType + +`func (o *DagWarning) GetWarningType() string` + +GetWarningType returns the WarningType field if non-nil, zero value otherwise. + +### GetWarningTypeOk + +`func (o *DagWarning) GetWarningTypeOk() (*string, bool)` + +GetWarningTypeOk returns a tuple with the WarningType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWarningType + +`func (o *DagWarning) SetWarningType(v string)` + +SetWarningType sets WarningType field to given value. + +### HasWarningType + +`func (o *DagWarning) HasWarningType() bool` + +HasWarningType returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/DagWarningApi.md b/airflow/docs/DagWarningApi.md index dca8de8..931e706 100644 --- a/airflow/docs/DagWarningApi.md +++ b/airflow/docs/DagWarningApi.md @@ -1,29 +1,10 @@ - - -# \DagWarningApi - -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**GetDagWarnings**](DagWarningApi.md#GetDagWarnings) | **Get** /dagWarnings | List dag warnings +[**GetDagWarnings**](DagWarningAPI.md#GetDagWarnings) | **Get** /dagWarnings | List dag warnings @@ -39,28 +20,28 @@ List dag warnings package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | If set, only return DAG warnings with this dag_id. (optional) - warningType := "warningType_example" // string | If set, only return DAG warnings with this type. (optional) - limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) - offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) - orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DagWarningApi.GetDagWarnings(context.Background()).DagId(dagId).WarningType(warningType).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DagWarningApi.GetDagWarnings``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetDagWarnings`: DagWarningCollection - fmt.Fprintf(os.Stdout, "Response from `DagWarningApi.GetDagWarnings`: %v\n", resp) + dagId := "dagId_example" // string | If set, only return DAG warnings with this dag_id. (optional) + warningType := "warningType_example" // string | If set, only return DAG warnings with this type. (optional) + limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) + offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) + orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DagWarningAPI.GetDagWarnings(context.Background()).DagId(dagId).WarningType(warningType).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DagWarningAPI.GetDagWarnings``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetDagWarnings`: DagWarningCollection + fmt.Fprintf(os.Stdout, "Response from `DagWarningAPI.GetDagWarnings`: %v\n", resp) } ``` @@ -87,7 +68,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers diff --git a/airflow/docs/DagWarningCollection.md b/airflow/docs/DagWarningCollection.md index 2a0c9e9..5fb3827 100644 --- a/airflow/docs/DagWarningCollection.md +++ b/airflow/docs/DagWarningCollection.md @@ -1,30 +1,11 @@ - - # DagWarningCollection ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ImportErrors** | Pointer to [**[]DagWarning**](DagWarning.md) | | [optional] -**TotalEntries** | Pointer to **int32** | Count of objects in the current result set. | [optional] +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] +**DagWarnings** | Pointer to [**[]DagWarning**](DagWarning.md) | | [optional] ## Methods @@ -45,55 +26,55 @@ NewDagWarningCollectionWithDefaults instantiates a new DagWarningCollection obje This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetImportErrors +### GetTotalEntries -`func (o *DagWarningCollection) GetImportErrors() []DagWarning` +`func (o *DagWarningCollection) GetTotalEntries() int32` -GetImportErrors returns the ImportErrors field if non-nil, zero value otherwise. +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. -### GetImportErrorsOk +### GetTotalEntriesOk -`func (o *DagWarningCollection) GetImportErrorsOk() (*[]DagWarning, bool)` +`func (o *DagWarningCollection) GetTotalEntriesOk() (*int32, bool)` -GetImportErrorsOk returns a tuple with the ImportErrors field if it's non-nil, zero value otherwise +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetImportErrors +### SetTotalEntries -`func (o *DagWarningCollection) SetImportErrors(v []DagWarning)` +`func (o *DagWarningCollection) SetTotalEntries(v int32)` -SetImportErrors sets ImportErrors field to given value. +SetTotalEntries sets TotalEntries field to given value. -### HasImportErrors +### HasTotalEntries -`func (o *DagWarningCollection) HasImportErrors() bool` +`func (o *DagWarningCollection) HasTotalEntries() bool` -HasImportErrors returns a boolean if a field has been set. +HasTotalEntries returns a boolean if a field has been set. -### GetTotalEntries +### GetDagWarnings -`func (o *DagWarningCollection) GetTotalEntries() int32` +`func (o *DagWarningCollection) GetDagWarnings() []DagWarning` -GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. +GetDagWarnings returns the DagWarnings field if non-nil, zero value otherwise. -### GetTotalEntriesOk +### GetDagWarningsOk -`func (o *DagWarningCollection) GetTotalEntriesOk() (*int32, bool)` +`func (o *DagWarningCollection) GetDagWarningsOk() (*[]DagWarning, bool)` -GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +GetDagWarningsOk returns a tuple with the DagWarnings field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTotalEntries +### SetDagWarnings -`func (o *DagWarningCollection) SetTotalEntries(v int32)` +`func (o *DagWarningCollection) SetDagWarnings(v []DagWarning)` -SetTotalEntries sets TotalEntries field to given value. +SetDagWarnings sets DagWarnings field to given value. -### HasTotalEntries +### HasDagWarnings -`func (o *DagWarningCollection) HasTotalEntries() bool` +`func (o *DagWarningCollection) HasDagWarnings() bool` -HasTotalEntries returns a boolean if a field has been set. +HasDagWarnings returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/Dataset.md b/airflow/docs/Dataset.md index 16c22be..063c335 100644 --- a/airflow/docs/Dataset.md +++ b/airflow/docs/Dataset.md @@ -1,35 +1,16 @@ - - # Dataset ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | Pointer to **int32** | The dataset id | [optional] -**Uri** | Pointer to **string** | The dataset uri | [optional] -**Extra** | Pointer to **map[string]interface{}** | The dataset extra | [optional] -**CreatedAt** | Pointer to **string** | The dataset creation time | [optional] -**UpdatedAt** | Pointer to **string** | The dataset update time | [optional] **ConsumingDags** | Pointer to [**[]DagScheduleDatasetReference**](DagScheduleDatasetReference.md) | | [optional] +**CreatedAt** | Pointer to **string** | The dataset creation time | [optional] +**Extra** | Pointer to **map[string]interface{}** | The dataset extra | [optional] +**Id** | Pointer to **int32** | The dataset id | [optional] **ProducingTasks** | Pointer to [**[]TaskOutletDatasetReference**](TaskOutletDatasetReference.md) | | [optional] +**UpdatedAt** | Pointer to **string** | The dataset update time | [optional] +**Uri** | Pointer to **string** | The dataset uri | [optional] ## Methods @@ -50,55 +31,55 @@ NewDatasetWithDefaults instantiates a new Dataset object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetId +### GetConsumingDags -`func (o *Dataset) GetId() int32` +`func (o *Dataset) GetConsumingDags() []DagScheduleDatasetReference` -GetId returns the Id field if non-nil, zero value otherwise. +GetConsumingDags returns the ConsumingDags field if non-nil, zero value otherwise. -### GetIdOk +### GetConsumingDagsOk -`func (o *Dataset) GetIdOk() (*int32, bool)` +`func (o *Dataset) GetConsumingDagsOk() (*[]DagScheduleDatasetReference, bool)` -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +GetConsumingDagsOk returns a tuple with the ConsumingDags field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetId +### SetConsumingDags -`func (o *Dataset) SetId(v int32)` +`func (o *Dataset) SetConsumingDags(v []DagScheduleDatasetReference)` -SetId sets Id field to given value. +SetConsumingDags sets ConsumingDags field to given value. -### HasId +### HasConsumingDags -`func (o *Dataset) HasId() bool` +`func (o *Dataset) HasConsumingDags() bool` -HasId returns a boolean if a field has been set. +HasConsumingDags returns a boolean if a field has been set. -### GetUri +### GetCreatedAt -`func (o *Dataset) GetUri() string` +`func (o *Dataset) GetCreatedAt() string` -GetUri returns the Uri field if non-nil, zero value otherwise. +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. -### GetUriOk +### GetCreatedAtOk -`func (o *Dataset) GetUriOk() (*string, bool)` +`func (o *Dataset) GetCreatedAtOk() (*string, bool)` -GetUriOk returns a tuple with the Uri field if it's non-nil, zero value otherwise +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetUri +### SetCreatedAt -`func (o *Dataset) SetUri(v string)` +`func (o *Dataset) SetCreatedAt(v string)` -SetUri sets Uri field to given value. +SetCreatedAt sets CreatedAt field to given value. -### HasUri +### HasCreatedAt -`func (o *Dataset) HasUri() bool` +`func (o *Dataset) HasCreatedAt() bool` -HasUri returns a boolean if a field has been set. +HasCreatedAt returns a boolean if a field has been set. ### GetExtra @@ -135,105 +116,105 @@ HasExtra returns a boolean if a field has been set. `func (o *Dataset) UnsetExtra()` UnsetExtra ensures that no value is present for Extra, not even an explicit nil -### GetCreatedAt +### GetId -`func (o *Dataset) GetCreatedAt() string` +`func (o *Dataset) GetId() int32` -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. +GetId returns the Id field if non-nil, zero value otherwise. -### GetCreatedAtOk +### GetIdOk -`func (o *Dataset) GetCreatedAtOk() (*string, bool)` +`func (o *Dataset) GetIdOk() (*int32, bool)` -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetCreatedAt +### SetId -`func (o *Dataset) SetCreatedAt(v string)` +`func (o *Dataset) SetId(v int32)` -SetCreatedAt sets CreatedAt field to given value. +SetId sets Id field to given value. -### HasCreatedAt +### HasId -`func (o *Dataset) HasCreatedAt() bool` +`func (o *Dataset) HasId() bool` -HasCreatedAt returns a boolean if a field has been set. +HasId returns a boolean if a field has been set. -### GetUpdatedAt +### GetProducingTasks -`func (o *Dataset) GetUpdatedAt() string` +`func (o *Dataset) GetProducingTasks() []TaskOutletDatasetReference` -GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. +GetProducingTasks returns the ProducingTasks field if non-nil, zero value otherwise. -### GetUpdatedAtOk +### GetProducingTasksOk -`func (o *Dataset) GetUpdatedAtOk() (*string, bool)` +`func (o *Dataset) GetProducingTasksOk() (*[]TaskOutletDatasetReference, bool)` -GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +GetProducingTasksOk returns a tuple with the ProducingTasks field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetUpdatedAt +### SetProducingTasks -`func (o *Dataset) SetUpdatedAt(v string)` +`func (o *Dataset) SetProducingTasks(v []TaskOutletDatasetReference)` -SetUpdatedAt sets UpdatedAt field to given value. +SetProducingTasks sets ProducingTasks field to given value. -### HasUpdatedAt +### HasProducingTasks -`func (o *Dataset) HasUpdatedAt() bool` +`func (o *Dataset) HasProducingTasks() bool` -HasUpdatedAt returns a boolean if a field has been set. +HasProducingTasks returns a boolean if a field has been set. -### GetConsumingDags +### GetUpdatedAt -`func (o *Dataset) GetConsumingDags() []DagScheduleDatasetReference` +`func (o *Dataset) GetUpdatedAt() string` -GetConsumingDags returns the ConsumingDags field if non-nil, zero value otherwise. +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. -### GetConsumingDagsOk +### GetUpdatedAtOk -`func (o *Dataset) GetConsumingDagsOk() (*[]DagScheduleDatasetReference, bool)` +`func (o *Dataset) GetUpdatedAtOk() (*string, bool)` -GetConsumingDagsOk returns a tuple with the ConsumingDags field if it's non-nil, zero value otherwise +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetConsumingDags +### SetUpdatedAt -`func (o *Dataset) SetConsumingDags(v []DagScheduleDatasetReference)` +`func (o *Dataset) SetUpdatedAt(v string)` -SetConsumingDags sets ConsumingDags field to given value. +SetUpdatedAt sets UpdatedAt field to given value. -### HasConsumingDags +### HasUpdatedAt -`func (o *Dataset) HasConsumingDags() bool` +`func (o *Dataset) HasUpdatedAt() bool` -HasConsumingDags returns a boolean if a field has been set. +HasUpdatedAt returns a boolean if a field has been set. -### GetProducingTasks +### GetUri -`func (o *Dataset) GetProducingTasks() []TaskOutletDatasetReference` +`func (o *Dataset) GetUri() string` -GetProducingTasks returns the ProducingTasks field if non-nil, zero value otherwise. +GetUri returns the Uri field if non-nil, zero value otherwise. -### GetProducingTasksOk +### GetUriOk -`func (o *Dataset) GetProducingTasksOk() (*[]TaskOutletDatasetReference, bool)` +`func (o *Dataset) GetUriOk() (*string, bool)` -GetProducingTasksOk returns a tuple with the ProducingTasks field if it's non-nil, zero value otherwise +GetUriOk returns a tuple with the Uri field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetProducingTasks +### SetUri -`func (o *Dataset) SetProducingTasks(v []TaskOutletDatasetReference)` +`func (o *Dataset) SetUri(v string)` -SetProducingTasks sets ProducingTasks field to given value. +SetUri sets Uri field to given value. -### HasProducingTasks +### HasUri -`func (o *Dataset) HasProducingTasks() bool` +`func (o *Dataset) HasUri() bool` -HasProducingTasks returns a boolean if a field has been set. +HasUri returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/DatasetApi.md b/airflow/docs/DatasetApi.md index dc0d1a7..02e97fd 100644 --- a/airflow/docs/DatasetApi.md +++ b/airflow/docs/DatasetApi.md @@ -1,34 +1,453 @@ - +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateDatasetEvent**](DatasetAPI.md#CreateDatasetEvent) | **Post** /datasets/events | Create dataset event +[**DeleteDagDatasetQueuedEvent**](DatasetAPI.md#DeleteDagDatasetQueuedEvent) | **Delete** /dags/{dag_id}/datasets/queuedEvent/{uri} | Delete a queued Dataset event for a DAG. +[**DeleteDagDatasetQueuedEvents**](DatasetAPI.md#DeleteDagDatasetQueuedEvents) | **Delete** /dags/{dag_id}/datasets/queuedEvent | Delete queued Dataset events for a DAG. +[**DeleteDatasetQueuedEvents**](DatasetAPI.md#DeleteDatasetQueuedEvents) | **Delete** /datasets/queuedEvent/{uri} | Delete queued Dataset events for a Dataset. +[**GetDagDatasetQueuedEvent**](DatasetAPI.md#GetDagDatasetQueuedEvent) | **Get** /dags/{dag_id}/datasets/queuedEvent/{uri} | Get a queued Dataset event for a DAG +[**GetDagDatasetQueuedEvents**](DatasetAPI.md#GetDagDatasetQueuedEvents) | **Get** /dags/{dag_id}/datasets/queuedEvent | Get queued Dataset events for a DAG. +[**GetDataset**](DatasetAPI.md#GetDataset) | **Get** /datasets/{uri} | Get a dataset +[**GetDatasetEvents**](DatasetAPI.md#GetDatasetEvents) | **Get** /datasets/events | Get dataset events +[**GetDatasetQueuedEvents**](DatasetAPI.md#GetDatasetQueuedEvents) | **Get** /datasets/queuedEvent/{uri} | Get queued Dataset events for a Dataset. +[**GetDatasets**](DatasetAPI.md#GetDatasets) | **Get** /datasets | List datasets +[**GetUpstreamDatasetEvents**](DatasetAPI.md#GetUpstreamDatasetEvents) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/upstreamDatasetEvents | Get dataset events for a DAG run -# \DatasetApi -All URIs are relative to *http://localhost/api/v1* -Method | HTTP request | Description -------------- | ------------- | ------------- -[**GetDataset**](DatasetApi.md#GetDataset) | **Get** /datasets/{uri} | Get a dataset -[**GetDatasetEvents**](DatasetApi.md#GetDatasetEvents) | **Get** /datasets/events | Get dataset events -[**GetDatasets**](DatasetApi.md#GetDatasets) | **Get** /datasets | List datasets -[**GetUpstreamDatasetEvents**](DatasetApi.md#GetUpstreamDatasetEvents) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/upstreamDatasetEvents | Get dataset events for a DAG run +## CreateDatasetEvent + +> DatasetEvent CreateDatasetEvent(ctx).CreateDatasetEvent(createDatasetEvent).Execute() + +Create dataset event + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./airflow" +) + +func main() { + createDatasetEvent := *openapiclient.NewCreateDatasetEvent("DatasetUri_example") // CreateDatasetEvent | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DatasetAPI.CreateDatasetEvent(context.Background()).CreateDatasetEvent(createDatasetEvent).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DatasetAPI.CreateDatasetEvent``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateDatasetEvent`: DatasetEvent + fmt.Fprintf(os.Stdout, "Response from `DatasetAPI.CreateDatasetEvent`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateDatasetEventRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **createDatasetEvent** | [**CreateDatasetEvent**](CreateDatasetEvent.md) | | + +### Return type + +[**DatasetEvent**](DatasetEvent.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteDagDatasetQueuedEvent + +> DeleteDagDatasetQueuedEvent(ctx, dagId, uri).Before(before).Execute() + +Delete a queued Dataset event for a DAG. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "time" + openapiclient "./airflow" +) + +func main() { + dagId := "dagId_example" // string | The DAG ID. + uri := "uri_example" // string | The encoded Dataset URI + before := time.Now() // time.Time | Timestamp to select event logs occurring before. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.DatasetAPI.DeleteDagDatasetQueuedEvent(context.Background(), dagId, uri).Before(before).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DatasetAPI.DeleteDagDatasetQueuedEvent``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**dagId** | **string** | The DAG ID. | +**uri** | **string** | The encoded Dataset URI | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteDagDatasetQueuedEventRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **before** | **time.Time** | Timestamp to select event logs occurring before. | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteDagDatasetQueuedEvents + +> DeleteDagDatasetQueuedEvents(ctx, dagId).Before(before).Execute() + +Delete queued Dataset events for a DAG. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "time" + openapiclient "./airflow" +) + +func main() { + dagId := "dagId_example" // string | The DAG ID. + before := time.Now() // time.Time | Timestamp to select event logs occurring before. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.DatasetAPI.DeleteDagDatasetQueuedEvents(context.Background(), dagId).Before(before).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DatasetAPI.DeleteDagDatasetQueuedEvents``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**dagId** | **string** | The DAG ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteDagDatasetQueuedEventsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **before** | **time.Time** | Timestamp to select event logs occurring before. | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteDatasetQueuedEvents + +> DeleteDatasetQueuedEvents(ctx, uri).Before(before).Execute() + +Delete queued Dataset events for a Dataset. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "time" + openapiclient "./airflow" +) + +func main() { + uri := "uri_example" // string | The encoded Dataset URI + before := time.Now() // time.Time | Timestamp to select event logs occurring before. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.DatasetAPI.DeleteDatasetQueuedEvents(context.Background(), uri).Before(before).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DatasetAPI.DeleteDatasetQueuedEvents``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**uri** | **string** | The encoded Dataset URI | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteDatasetQueuedEventsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **before** | **time.Time** | Timestamp to select event logs occurring before. | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetDagDatasetQueuedEvent + +> QueuedEvent GetDagDatasetQueuedEvent(ctx, dagId, uri).Before(before).Execute() + +Get a queued Dataset event for a DAG + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "time" + openapiclient "./airflow" +) + +func main() { + dagId := "dagId_example" // string | The DAG ID. + uri := "uri_example" // string | The encoded Dataset URI + before := time.Now() // time.Time | Timestamp to select event logs occurring before. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DatasetAPI.GetDagDatasetQueuedEvent(context.Background(), dagId, uri).Before(before).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DatasetAPI.GetDagDatasetQueuedEvent``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetDagDatasetQueuedEvent`: QueuedEvent + fmt.Fprintf(os.Stdout, "Response from `DatasetAPI.GetDagDatasetQueuedEvent`: %v\n", resp) +} +``` + +### Path Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**dagId** | **string** | The DAG ID. | +**uri** | **string** | The encoded Dataset URI | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetDagDatasetQueuedEventRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **before** | **time.Time** | Timestamp to select event logs occurring before. | + +### Return type + +[**QueuedEvent**](QueuedEvent.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetDagDatasetQueuedEvents + +> QueuedEventCollection GetDagDatasetQueuedEvents(ctx, dagId).Before(before).Execute() + +Get queued Dataset events for a DAG. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "time" + openapiclient "./airflow" +) + +func main() { + dagId := "dagId_example" // string | The DAG ID. + before := time.Now() // time.Time | Timestamp to select event logs occurring before. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DatasetAPI.GetDagDatasetQueuedEvents(context.Background(), dagId).Before(before).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DatasetAPI.GetDagDatasetQueuedEvents``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetDagDatasetQueuedEvents`: QueuedEventCollection + fmt.Fprintf(os.Stdout, "Response from `DatasetAPI.GetDagDatasetQueuedEvents`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**dagId** | **string** | The DAG ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetDagDatasetQueuedEventsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **before** | **time.Time** | Timestamp to select event logs occurring before. | + +### Return type + +[**QueuedEventCollection**](QueuedEventCollection.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + ## GetDataset @@ -44,24 +463,24 @@ Get a dataset package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - uri := "uri_example" // string | The encoded Dataset URI - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DatasetApi.GetDataset(context.Background(), uri).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DatasetApi.GetDataset``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetDataset`: Dataset - fmt.Fprintf(os.Stdout, "Response from `DatasetApi.GetDataset`: %v\n", resp) + uri := "uri_example" // string | The encoded Dataset URI + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DatasetAPI.GetDataset(context.Background(), uri).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DatasetAPI.GetDataset``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetDataset`: Dataset + fmt.Fprintf(os.Stdout, "Response from `DatasetAPI.GetDataset`: %v\n", resp) } ``` @@ -88,7 +507,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -114,31 +533,31 @@ Get dataset events package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) - offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) - orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) - datasetId := int32(56) // int32 | The Dataset ID that updated the dataset. (optional) - sourceDagId := "sourceDagId_example" // string | The DAG ID that updated the dataset. (optional) - sourceTaskId := "sourceTaskId_example" // string | The task ID that updated the dataset. (optional) - sourceRunId := "sourceRunId_example" // string | The DAG run ID that updated the dataset. (optional) - sourceMapIndex := int32(56) // int32 | The map index that updated the dataset. (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DatasetApi.GetDatasetEvents(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).DatasetId(datasetId).SourceDagId(sourceDagId).SourceTaskId(sourceTaskId).SourceRunId(sourceRunId).SourceMapIndex(sourceMapIndex).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DatasetApi.GetDatasetEvents``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetDatasetEvents`: DatasetEventCollection - fmt.Fprintf(os.Stdout, "Response from `DatasetApi.GetDatasetEvents`: %v\n", resp) + limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) + offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) + orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) + datasetId := int32(56) // int32 | The Dataset ID that updated the dataset. (optional) + sourceDagId := "sourceDagId_example" // string | The DAG ID that updated the dataset. (optional) + sourceTaskId := "sourceTaskId_example" // string | The task ID that updated the dataset. (optional) + sourceRunId := "sourceRunId_example" // string | The DAG run ID that updated the dataset. (optional) + sourceMapIndex := int32(56) // int32 | The map index that updated the dataset. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DatasetAPI.GetDatasetEvents(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).DatasetId(datasetId).SourceDagId(sourceDagId).SourceTaskId(sourceTaskId).SourceRunId(sourceRunId).SourceMapIndex(sourceMapIndex).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DatasetAPI.GetDatasetEvents``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetDatasetEvents`: DatasetEventCollection + fmt.Fprintf(os.Stdout, "Response from `DatasetAPI.GetDatasetEvents`: %v\n", resp) } ``` @@ -168,7 +587,80 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetDatasetQueuedEvents + +> QueuedEventCollection GetDatasetQueuedEvents(ctx, uri).Before(before).Execute() + +Get queued Dataset events for a Dataset. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "time" + openapiclient "./airflow" +) + +func main() { + uri := "uri_example" // string | The encoded Dataset URI + before := time.Now() // time.Time | Timestamp to select event logs occurring before. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DatasetAPI.GetDatasetQueuedEvents(context.Background(), uri).Before(before).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DatasetAPI.GetDatasetQueuedEvents``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetDatasetQueuedEvents`: QueuedEventCollection + fmt.Fprintf(os.Stdout, "Response from `DatasetAPI.GetDatasetQueuedEvents`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**uri** | **string** | The encoded Dataset URI | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetDatasetQueuedEventsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **before** | **time.Time** | Timestamp to select event logs occurring before. | + +### Return type + +[**QueuedEventCollection**](QueuedEventCollection.md) + +### Authorization + +No authorization required ### HTTP request headers @@ -182,7 +674,7 @@ Name | Type | Description | Notes ## GetDatasets -> DatasetCollection GetDatasets(ctx).Limit(limit).Offset(offset).OrderBy(orderBy).UriPattern(uriPattern).Execute() +> DatasetCollection GetDatasets(ctx).Limit(limit).Offset(offset).OrderBy(orderBy).UriPattern(uriPattern).DagIds(dagIds).Execute() List datasets @@ -192,27 +684,28 @@ List datasets package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) - offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) - orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) - uriPattern := "uriPattern_example" // string | If set, only return datasets with uris matching this pattern. (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DatasetApi.GetDatasets(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).UriPattern(uriPattern).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DatasetApi.GetDatasets``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetDatasets`: DatasetCollection - fmt.Fprintf(os.Stdout, "Response from `DatasetApi.GetDatasets`: %v\n", resp) + limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) + offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) + orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) + uriPattern := "uriPattern_example" // string | If set, only return datasets with uris matching this pattern. (optional) + dagIds := "dagIds_example" // string | One or more DAG IDs separated by commas to filter datasets by associated DAGs either consuming or producing. *New in version 2.9.0* (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DatasetAPI.GetDatasets(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).UriPattern(uriPattern).DagIds(dagIds).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DatasetAPI.GetDatasets``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetDatasets`: DatasetCollection + fmt.Fprintf(os.Stdout, "Response from `DatasetAPI.GetDatasets`: %v\n", resp) } ``` @@ -231,6 +724,7 @@ Name | Type | Description | Notes **offset** | **int32** | The number of items to skip before starting to collect the result set. | **orderBy** | **string** | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* | **uriPattern** | **string** | If set, only return datasets with uris matching this pattern. | + **dagIds** | **string** | One or more DAG IDs separated by commas to filter datasets by associated DAGs either consuming or producing. *New in version 2.9.0* | ### Return type @@ -238,7 +732,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -264,25 +758,25 @@ Get dataset events for a DAG run package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - dagRunId := "dagRunId_example" // string | The DAG run ID. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DatasetApi.GetUpstreamDatasetEvents(context.Background(), dagId, dagRunId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DatasetApi.GetUpstreamDatasetEvents``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetUpstreamDatasetEvents`: DatasetEventCollection - fmt.Fprintf(os.Stdout, "Response from `DatasetApi.GetUpstreamDatasetEvents`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DatasetAPI.GetUpstreamDatasetEvents(context.Background(), dagId, dagRunId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DatasetAPI.GetUpstreamDatasetEvents``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetUpstreamDatasetEvents`: DatasetEventCollection + fmt.Fprintf(os.Stdout, "Response from `DatasetAPI.GetUpstreamDatasetEvents`: %v\n", resp) } ``` @@ -311,7 +805,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers diff --git a/airflow/docs/DatasetCollection.md b/airflow/docs/DatasetCollection.md index 94a0309..98e0fbe 100644 --- a/airflow/docs/DatasetCollection.md +++ b/airflow/docs/DatasetCollection.md @@ -1,30 +1,11 @@ - - # DatasetCollection ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] **Datasets** | Pointer to [**[]Dataset**](Dataset.md) | | [optional] -**TotalEntries** | Pointer to **int32** | Count of objects in the current result set. | [optional] ## Methods @@ -45,55 +26,55 @@ NewDatasetCollectionWithDefaults instantiates a new DatasetCollection object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetDatasets +### GetTotalEntries -`func (o *DatasetCollection) GetDatasets() []Dataset` +`func (o *DatasetCollection) GetTotalEntries() int32` -GetDatasets returns the Datasets field if non-nil, zero value otherwise. +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. -### GetDatasetsOk +### GetTotalEntriesOk -`func (o *DatasetCollection) GetDatasetsOk() (*[]Dataset, bool)` +`func (o *DatasetCollection) GetTotalEntriesOk() (*int32, bool)` -GetDatasetsOk returns a tuple with the Datasets field if it's non-nil, zero value otherwise +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDatasets +### SetTotalEntries -`func (o *DatasetCollection) SetDatasets(v []Dataset)` +`func (o *DatasetCollection) SetTotalEntries(v int32)` -SetDatasets sets Datasets field to given value. +SetTotalEntries sets TotalEntries field to given value. -### HasDatasets +### HasTotalEntries -`func (o *DatasetCollection) HasDatasets() bool` +`func (o *DatasetCollection) HasTotalEntries() bool` -HasDatasets returns a boolean if a field has been set. +HasTotalEntries returns a boolean if a field has been set. -### GetTotalEntries +### GetDatasets -`func (o *DatasetCollection) GetTotalEntries() int32` +`func (o *DatasetCollection) GetDatasets() []Dataset` -GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. +GetDatasets returns the Datasets field if non-nil, zero value otherwise. -### GetTotalEntriesOk +### GetDatasetsOk -`func (o *DatasetCollection) GetTotalEntriesOk() (*int32, bool)` +`func (o *DatasetCollection) GetDatasetsOk() (*[]Dataset, bool)` -GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +GetDatasetsOk returns a tuple with the Datasets field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTotalEntries +### SetDatasets -`func (o *DatasetCollection) SetTotalEntries(v int32)` +`func (o *DatasetCollection) SetDatasets(v []Dataset)` -SetTotalEntries sets TotalEntries field to given value. +SetDatasets sets Datasets field to given value. -### HasTotalEntries +### HasDatasets -`func (o *DatasetCollection) HasTotalEntries() bool` +`func (o *DatasetCollection) HasDatasets() bool` -HasTotalEntries returns a boolean if a field has been set. +HasDatasets returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/DatasetEvent.md b/airflow/docs/DatasetEvent.md index 2c35a3a..bf7d4ec 100644 --- a/airflow/docs/DatasetEvent.md +++ b/airflow/docs/DatasetEvent.md @@ -1,36 +1,17 @@ - - # DatasetEvent ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**CreatedDagruns** | Pointer to [**[]BasicDAGRun**](BasicDAGRun.md) | | [optional] **DatasetId** | Pointer to **int32** | The dataset id | [optional] **DatasetUri** | Pointer to **string** | The URI of the dataset | [optional] **Extra** | Pointer to **map[string]interface{}** | The dataset event extra | [optional] **SourceDagId** | Pointer to **NullableString** | The DAG ID that updated the dataset. | [optional] -**SourceTaskId** | Pointer to **NullableString** | The task ID that updated the dataset. | [optional] -**SourceRunId** | Pointer to **NullableString** | The DAG run ID that updated the dataset. | [optional] **SourceMapIndex** | Pointer to **NullableInt32** | The task map index that updated the dataset. | [optional] -**CreatedDagruns** | Pointer to [**[]BasicDAGRun**](BasicDAGRun.md) | | [optional] +**SourceRunId** | Pointer to **NullableString** | The DAG run ID that updated the dataset. | [optional] +**SourceTaskId** | Pointer to **NullableString** | The task ID that updated the dataset. | [optional] **Timestamp** | Pointer to **string** | The dataset event creation time | [optional] ## Methods @@ -52,6 +33,31 @@ NewDatasetEventWithDefaults instantiates a new DatasetEvent object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set +### GetCreatedDagruns + +`func (o *DatasetEvent) GetCreatedDagruns() []BasicDAGRun` + +GetCreatedDagruns returns the CreatedDagruns field if non-nil, zero value otherwise. + +### GetCreatedDagrunsOk + +`func (o *DatasetEvent) GetCreatedDagrunsOk() (*[]BasicDAGRun, bool)` + +GetCreatedDagrunsOk returns a tuple with the CreatedDagruns field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedDagruns + +`func (o *DatasetEvent) SetCreatedDagruns(v []BasicDAGRun)` + +SetCreatedDagruns sets CreatedDagruns field to given value. + +### HasCreatedDagruns + +`func (o *DatasetEvent) HasCreatedDagruns() bool` + +HasCreatedDagruns returns a boolean if a field has been set. + ### GetDatasetId `func (o *DatasetEvent) GetDatasetId() int32` @@ -172,41 +178,41 @@ HasSourceDagId returns a boolean if a field has been set. `func (o *DatasetEvent) UnsetSourceDagId()` UnsetSourceDagId ensures that no value is present for SourceDagId, not even an explicit nil -### GetSourceTaskId +### GetSourceMapIndex -`func (o *DatasetEvent) GetSourceTaskId() string` +`func (o *DatasetEvent) GetSourceMapIndex() int32` -GetSourceTaskId returns the SourceTaskId field if non-nil, zero value otherwise. +GetSourceMapIndex returns the SourceMapIndex field if non-nil, zero value otherwise. -### GetSourceTaskIdOk +### GetSourceMapIndexOk -`func (o *DatasetEvent) GetSourceTaskIdOk() (*string, bool)` +`func (o *DatasetEvent) GetSourceMapIndexOk() (*int32, bool)` -GetSourceTaskIdOk returns a tuple with the SourceTaskId field if it's non-nil, zero value otherwise +GetSourceMapIndexOk returns a tuple with the SourceMapIndex field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetSourceTaskId +### SetSourceMapIndex -`func (o *DatasetEvent) SetSourceTaskId(v string)` +`func (o *DatasetEvent) SetSourceMapIndex(v int32)` -SetSourceTaskId sets SourceTaskId field to given value. +SetSourceMapIndex sets SourceMapIndex field to given value. -### HasSourceTaskId +### HasSourceMapIndex -`func (o *DatasetEvent) HasSourceTaskId() bool` +`func (o *DatasetEvent) HasSourceMapIndex() bool` -HasSourceTaskId returns a boolean if a field has been set. +HasSourceMapIndex returns a boolean if a field has been set. -### SetSourceTaskIdNil +### SetSourceMapIndexNil -`func (o *DatasetEvent) SetSourceTaskIdNil(b bool)` +`func (o *DatasetEvent) SetSourceMapIndexNil(b bool)` - SetSourceTaskIdNil sets the value for SourceTaskId to be an explicit nil + SetSourceMapIndexNil sets the value for SourceMapIndex to be an explicit nil -### UnsetSourceTaskId -`func (o *DatasetEvent) UnsetSourceTaskId()` +### UnsetSourceMapIndex +`func (o *DatasetEvent) UnsetSourceMapIndex()` -UnsetSourceTaskId ensures that no value is present for SourceTaskId, not even an explicit nil +UnsetSourceMapIndex ensures that no value is present for SourceMapIndex, not even an explicit nil ### GetSourceRunId `func (o *DatasetEvent) GetSourceRunId() string` @@ -242,66 +248,41 @@ HasSourceRunId returns a boolean if a field has been set. `func (o *DatasetEvent) UnsetSourceRunId()` UnsetSourceRunId ensures that no value is present for SourceRunId, not even an explicit nil -### GetSourceMapIndex +### GetSourceTaskId -`func (o *DatasetEvent) GetSourceMapIndex() int32` +`func (o *DatasetEvent) GetSourceTaskId() string` -GetSourceMapIndex returns the SourceMapIndex field if non-nil, zero value otherwise. +GetSourceTaskId returns the SourceTaskId field if non-nil, zero value otherwise. -### GetSourceMapIndexOk +### GetSourceTaskIdOk -`func (o *DatasetEvent) GetSourceMapIndexOk() (*int32, bool)` +`func (o *DatasetEvent) GetSourceTaskIdOk() (*string, bool)` -GetSourceMapIndexOk returns a tuple with the SourceMapIndex field if it's non-nil, zero value otherwise +GetSourceTaskIdOk returns a tuple with the SourceTaskId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetSourceMapIndex - -`func (o *DatasetEvent) SetSourceMapIndex(v int32)` - -SetSourceMapIndex sets SourceMapIndex field to given value. - -### HasSourceMapIndex - -`func (o *DatasetEvent) HasSourceMapIndex() bool` - -HasSourceMapIndex returns a boolean if a field has been set. - -### SetSourceMapIndexNil - -`func (o *DatasetEvent) SetSourceMapIndexNil(b bool)` - - SetSourceMapIndexNil sets the value for SourceMapIndex to be an explicit nil - -### UnsetSourceMapIndex -`func (o *DatasetEvent) UnsetSourceMapIndex()` - -UnsetSourceMapIndex ensures that no value is present for SourceMapIndex, not even an explicit nil -### GetCreatedDagruns - -`func (o *DatasetEvent) GetCreatedDagruns() []BasicDAGRun` - -GetCreatedDagruns returns the CreatedDagruns field if non-nil, zero value otherwise. +### SetSourceTaskId -### GetCreatedDagrunsOk +`func (o *DatasetEvent) SetSourceTaskId(v string)` -`func (o *DatasetEvent) GetCreatedDagrunsOk() (*[]BasicDAGRun, bool)` +SetSourceTaskId sets SourceTaskId field to given value. -GetCreatedDagrunsOk returns a tuple with the CreatedDagruns field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. +### HasSourceTaskId -### SetCreatedDagruns +`func (o *DatasetEvent) HasSourceTaskId() bool` -`func (o *DatasetEvent) SetCreatedDagruns(v []BasicDAGRun)` +HasSourceTaskId returns a boolean if a field has been set. -SetCreatedDagruns sets CreatedDagruns field to given value. +### SetSourceTaskIdNil -### HasCreatedDagruns +`func (o *DatasetEvent) SetSourceTaskIdNil(b bool)` -`func (o *DatasetEvent) HasCreatedDagruns() bool` + SetSourceTaskIdNil sets the value for SourceTaskId to be an explicit nil -HasCreatedDagruns returns a boolean if a field has been set. +### UnsetSourceTaskId +`func (o *DatasetEvent) UnsetSourceTaskId()` +UnsetSourceTaskId ensures that no value is present for SourceTaskId, not even an explicit nil ### GetTimestamp `func (o *DatasetEvent) GetTimestamp() string` diff --git a/airflow/docs/DatasetEventCollection.md b/airflow/docs/DatasetEventCollection.md index da9024f..2fad839 100644 --- a/airflow/docs/DatasetEventCollection.md +++ b/airflow/docs/DatasetEventCollection.md @@ -1,30 +1,11 @@ - - # DatasetEventCollection ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] **DatasetEvents** | Pointer to [**[]DatasetEvent**](DatasetEvent.md) | | [optional] -**TotalEntries** | Pointer to **int32** | Count of objects in the current result set. | [optional] ## Methods @@ -45,55 +26,55 @@ NewDatasetEventCollectionWithDefaults instantiates a new DatasetEventCollection This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetDatasetEvents +### GetTotalEntries -`func (o *DatasetEventCollection) GetDatasetEvents() []DatasetEvent` +`func (o *DatasetEventCollection) GetTotalEntries() int32` -GetDatasetEvents returns the DatasetEvents field if non-nil, zero value otherwise. +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. -### GetDatasetEventsOk +### GetTotalEntriesOk -`func (o *DatasetEventCollection) GetDatasetEventsOk() (*[]DatasetEvent, bool)` +`func (o *DatasetEventCollection) GetTotalEntriesOk() (*int32, bool)` -GetDatasetEventsOk returns a tuple with the DatasetEvents field if it's non-nil, zero value otherwise +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDatasetEvents +### SetTotalEntries -`func (o *DatasetEventCollection) SetDatasetEvents(v []DatasetEvent)` +`func (o *DatasetEventCollection) SetTotalEntries(v int32)` -SetDatasetEvents sets DatasetEvents field to given value. +SetTotalEntries sets TotalEntries field to given value. -### HasDatasetEvents +### HasTotalEntries -`func (o *DatasetEventCollection) HasDatasetEvents() bool` +`func (o *DatasetEventCollection) HasTotalEntries() bool` -HasDatasetEvents returns a boolean if a field has been set. +HasTotalEntries returns a boolean if a field has been set. -### GetTotalEntries +### GetDatasetEvents -`func (o *DatasetEventCollection) GetTotalEntries() int32` +`func (o *DatasetEventCollection) GetDatasetEvents() []DatasetEvent` -GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. +GetDatasetEvents returns the DatasetEvents field if non-nil, zero value otherwise. -### GetTotalEntriesOk +### GetDatasetEventsOk -`func (o *DatasetEventCollection) GetTotalEntriesOk() (*int32, bool)` +`func (o *DatasetEventCollection) GetDatasetEventsOk() (*[]DatasetEvent, bool)` -GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +GetDatasetEventsOk returns a tuple with the DatasetEvents field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTotalEntries +### SetDatasetEvents -`func (o *DatasetEventCollection) SetTotalEntries(v int32)` +`func (o *DatasetEventCollection) SetDatasetEvents(v []DatasetEvent)` -SetTotalEntries sets TotalEntries field to given value. +SetDatasetEvents sets DatasetEvents field to given value. -### HasTotalEntries +### HasDatasetEvents -`func (o *DatasetEventCollection) HasTotalEntries() bool` +`func (o *DatasetEventCollection) HasDatasetEvents() bool` -HasTotalEntries returns a boolean if a field has been set. +HasDatasetEvents returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/Error.md b/airflow/docs/Error.md index 40e932c..23f22d6 100644 --- a/airflow/docs/Error.md +++ b/airflow/docs/Error.md @@ -1,39 +1,20 @@ - - # Error ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Type** | **string** | A URI reference [RFC3986] that identifies the problem type. This specification encourages that, when dereferenced, it provide human-readable documentation for the problem type. | -**Title** | **string** | A short, human-readable summary of the problem type. | -**Status** | **float32** | The HTTP status code generated by the API server for this occurrence of the problem. | **Detail** | Pointer to **string** | A human-readable explanation specific to this occurrence of the problem. | [optional] **Instance** | Pointer to **string** | A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. | [optional] +**Status** | **float32** | The HTTP status code generated by the API server for this occurrence of the problem. | +**Title** | **string** | A short, human-readable summary of the problem type. | +**Type** | **string** | A URI reference [RFC3986] that identifies the problem type. This specification encourages that, when dereferenced, it provide human-readable documentation for the problem type. | ## Methods ### NewError -`func NewError(type_ string, title string, status float32, ) *Error` +`func NewError(status float32, title string, type_ string, ) *Error` NewError instantiates a new Error object This constructor will assign default values to properties that have it defined, @@ -48,45 +29,55 @@ NewErrorWithDefaults instantiates a new Error object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetType +### GetDetail -`func (o *Error) GetType() string` +`func (o *Error) GetDetail() string` -GetType returns the Type field if non-nil, zero value otherwise. +GetDetail returns the Detail field if non-nil, zero value otherwise. -### GetTypeOk +### GetDetailOk -`func (o *Error) GetTypeOk() (*string, bool)` +`func (o *Error) GetDetailOk() (*string, bool)` -GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +GetDetailOk returns a tuple with the Detail field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetType +### SetDetail -`func (o *Error) SetType(v string)` +`func (o *Error) SetDetail(v string)` -SetType sets Type field to given value. +SetDetail sets Detail field to given value. +### HasDetail -### GetTitle +`func (o *Error) HasDetail() bool` -`func (o *Error) GetTitle() string` +HasDetail returns a boolean if a field has been set. -GetTitle returns the Title field if non-nil, zero value otherwise. +### GetInstance -### GetTitleOk +`func (o *Error) GetInstance() string` -`func (o *Error) GetTitleOk() (*string, bool)` +GetInstance returns the Instance field if non-nil, zero value otherwise. -GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise +### GetInstanceOk + +`func (o *Error) GetInstanceOk() (*string, bool)` + +GetInstanceOk returns a tuple with the Instance field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTitle +### SetInstance -`func (o *Error) SetTitle(v string)` +`func (o *Error) SetInstance(v string)` -SetTitle sets Title field to given value. +SetInstance sets Instance field to given value. +### HasInstance + +`func (o *Error) HasInstance() bool` + +HasInstance returns a boolean if a field has been set. ### GetStatus @@ -108,55 +99,45 @@ and a boolean to check if the value has been set. SetStatus sets Status field to given value. -### GetDetail +### GetTitle -`func (o *Error) GetDetail() string` +`func (o *Error) GetTitle() string` -GetDetail returns the Detail field if non-nil, zero value otherwise. +GetTitle returns the Title field if non-nil, zero value otherwise. -### GetDetailOk +### GetTitleOk -`func (o *Error) GetDetailOk() (*string, bool)` +`func (o *Error) GetTitleOk() (*string, bool)` -GetDetailOk returns a tuple with the Detail field if it's non-nil, zero value otherwise +GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDetail - -`func (o *Error) SetDetail(v string)` +### SetTitle -SetDetail sets Detail field to given value. +`func (o *Error) SetTitle(v string)` -### HasDetail +SetTitle sets Title field to given value. -`func (o *Error) HasDetail() bool` -HasDetail returns a boolean if a field has been set. - -### GetInstance +### GetType -`func (o *Error) GetInstance() string` +`func (o *Error) GetType() string` -GetInstance returns the Instance field if non-nil, zero value otherwise. +GetType returns the Type field if non-nil, zero value otherwise. -### GetInstanceOk +### GetTypeOk -`func (o *Error) GetInstanceOk() (*string, bool)` +`func (o *Error) GetTypeOk() (*string, bool)` -GetInstanceOk returns a tuple with the Instance field if it's non-nil, zero value otherwise +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetInstance - -`func (o *Error) SetInstance(v string)` - -SetInstance sets Instance field to given value. +### SetType -### HasInstance +`func (o *Error) SetType(v string)` -`func (o *Error) HasInstance() bool` +SetType sets Type field to given value. -HasInstance returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/EventLog.md b/airflow/docs/EventLog.md index 160ba95..bef933a 100644 --- a/airflow/docs/EventLog.md +++ b/airflow/docs/EventLog.md @@ -1,36 +1,20 @@ - - # EventLog ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**EventLogId** | Pointer to **int32** | The event log ID | [optional] [readonly] -**When** | Pointer to **time.Time** | The time when these events happened. | [optional] [readonly] **DagId** | Pointer to **NullableString** | The DAG ID | [optional] [readonly] -**TaskId** | Pointer to **NullableString** | The DAG ID | [optional] [readonly] **Event** | Pointer to **string** | A key describing the type of event. | [optional] [readonly] +**EventLogId** | Pointer to **int32** | The event log ID | [optional] [readonly] **ExecutionDate** | Pointer to **NullableTime** | When the event was dispatched for an object having execution_date, the value of this field. | [optional] [readonly] -**Owner** | Pointer to **string** | Name of the user who triggered these events a. | [optional] [readonly] **Extra** | Pointer to **NullableString** | Other information that was not included in the other fields, e.g. the complete CLI command. | [optional] [readonly] +**MapIndex** | Pointer to **NullableInt32** | The Map Index | [optional] [readonly] +**Owner** | Pointer to **NullableString** | Name of the user who triggered these events a. | [optional] [readonly] +**RunId** | Pointer to **NullableString** | The DAG Run ID | [optional] [readonly] +**TaskId** | Pointer to **NullableString** | The Task ID | [optional] [readonly] +**TryNumber** | Pointer to **NullableInt32** | The Try Number | [optional] [readonly] +**When** | Pointer to **time.Time** | The time when these events happened. | [optional] [readonly] ## Methods @@ -51,56 +35,6 @@ NewEventLogWithDefaults instantiates a new EventLog object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetEventLogId - -`func (o *EventLog) GetEventLogId() int32` - -GetEventLogId returns the EventLogId field if non-nil, zero value otherwise. - -### GetEventLogIdOk - -`func (o *EventLog) GetEventLogIdOk() (*int32, bool)` - -GetEventLogIdOk returns a tuple with the EventLogId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEventLogId - -`func (o *EventLog) SetEventLogId(v int32)` - -SetEventLogId sets EventLogId field to given value. - -### HasEventLogId - -`func (o *EventLog) HasEventLogId() bool` - -HasEventLogId returns a boolean if a field has been set. - -### GetWhen - -`func (o *EventLog) GetWhen() time.Time` - -GetWhen returns the When field if non-nil, zero value otherwise. - -### GetWhenOk - -`func (o *EventLog) GetWhenOk() (*time.Time, bool)` - -GetWhenOk returns a tuple with the When field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetWhen - -`func (o *EventLog) SetWhen(v time.Time)` - -SetWhen sets When field to given value. - -### HasWhen - -`func (o *EventLog) HasWhen() bool` - -HasWhen returns a boolean if a field has been set. - ### GetDagId `func (o *EventLog) GetDagId() string` @@ -136,65 +70,55 @@ HasDagId returns a boolean if a field has been set. `func (o *EventLog) UnsetDagId()` UnsetDagId ensures that no value is present for DagId, not even an explicit nil -### GetTaskId +### GetEvent -`func (o *EventLog) GetTaskId() string` +`func (o *EventLog) GetEvent() string` -GetTaskId returns the TaskId field if non-nil, zero value otherwise. +GetEvent returns the Event field if non-nil, zero value otherwise. -### GetTaskIdOk +### GetEventOk -`func (o *EventLog) GetTaskIdOk() (*string, bool)` +`func (o *EventLog) GetEventOk() (*string, bool)` -GetTaskIdOk returns a tuple with the TaskId field if it's non-nil, zero value otherwise +GetEventOk returns a tuple with the Event field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTaskId - -`func (o *EventLog) SetTaskId(v string)` - -SetTaskId sets TaskId field to given value. - -### HasTaskId - -`func (o *EventLog) HasTaskId() bool` +### SetEvent -HasTaskId returns a boolean if a field has been set. +`func (o *EventLog) SetEvent(v string)` -### SetTaskIdNil +SetEvent sets Event field to given value. -`func (o *EventLog) SetTaskIdNil(b bool)` +### HasEvent - SetTaskIdNil sets the value for TaskId to be an explicit nil +`func (o *EventLog) HasEvent() bool` -### UnsetTaskId -`func (o *EventLog) UnsetTaskId()` +HasEvent returns a boolean if a field has been set. -UnsetTaskId ensures that no value is present for TaskId, not even an explicit nil -### GetEvent +### GetEventLogId -`func (o *EventLog) GetEvent() string` +`func (o *EventLog) GetEventLogId() int32` -GetEvent returns the Event field if non-nil, zero value otherwise. +GetEventLogId returns the EventLogId field if non-nil, zero value otherwise. -### GetEventOk +### GetEventLogIdOk -`func (o *EventLog) GetEventOk() (*string, bool)` +`func (o *EventLog) GetEventLogIdOk() (*int32, bool)` -GetEventOk returns a tuple with the Event field if it's non-nil, zero value otherwise +GetEventLogIdOk returns a tuple with the EventLogId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetEvent +### SetEventLogId -`func (o *EventLog) SetEvent(v string)` +`func (o *EventLog) SetEventLogId(v int32)` -SetEvent sets Event field to given value. +SetEventLogId sets EventLogId field to given value. -### HasEvent +### HasEventLogId -`func (o *EventLog) HasEvent() bool` +`func (o *EventLog) HasEventLogId() bool` -HasEvent returns a boolean if a field has been set. +HasEventLogId returns a boolean if a field has been set. ### GetExecutionDate @@ -231,6 +155,76 @@ HasExecutionDate returns a boolean if a field has been set. `func (o *EventLog) UnsetExecutionDate()` UnsetExecutionDate ensures that no value is present for ExecutionDate, not even an explicit nil +### GetExtra + +`func (o *EventLog) GetExtra() string` + +GetExtra returns the Extra field if non-nil, zero value otherwise. + +### GetExtraOk + +`func (o *EventLog) GetExtraOk() (*string, bool)` + +GetExtraOk returns a tuple with the Extra field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExtra + +`func (o *EventLog) SetExtra(v string)` + +SetExtra sets Extra field to given value. + +### HasExtra + +`func (o *EventLog) HasExtra() bool` + +HasExtra returns a boolean if a field has been set. + +### SetExtraNil + +`func (o *EventLog) SetExtraNil(b bool)` + + SetExtraNil sets the value for Extra to be an explicit nil + +### UnsetExtra +`func (o *EventLog) UnsetExtra()` + +UnsetExtra ensures that no value is present for Extra, not even an explicit nil +### GetMapIndex + +`func (o *EventLog) GetMapIndex() int32` + +GetMapIndex returns the MapIndex field if non-nil, zero value otherwise. + +### GetMapIndexOk + +`func (o *EventLog) GetMapIndexOk() (*int32, bool)` + +GetMapIndexOk returns a tuple with the MapIndex field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMapIndex + +`func (o *EventLog) SetMapIndex(v int32)` + +SetMapIndex sets MapIndex field to given value. + +### HasMapIndex + +`func (o *EventLog) HasMapIndex() bool` + +HasMapIndex returns a boolean if a field has been set. + +### SetMapIndexNil + +`func (o *EventLog) SetMapIndexNil(b bool)` + + SetMapIndexNil sets the value for MapIndex to be an explicit nil + +### UnsetMapIndex +`func (o *EventLog) UnsetMapIndex()` + +UnsetMapIndex ensures that no value is present for MapIndex, not even an explicit nil ### GetOwner `func (o *EventLog) GetOwner() string` @@ -256,41 +250,146 @@ SetOwner sets Owner field to given value. HasOwner returns a boolean if a field has been set. -### GetExtra +### SetOwnerNil -`func (o *EventLog) GetExtra() string` +`func (o *EventLog) SetOwnerNil(b bool)` -GetExtra returns the Extra field if non-nil, zero value otherwise. + SetOwnerNil sets the value for Owner to be an explicit nil -### GetExtraOk +### UnsetOwner +`func (o *EventLog) UnsetOwner()` -`func (o *EventLog) GetExtraOk() (*string, bool)` +UnsetOwner ensures that no value is present for Owner, not even an explicit nil +### GetRunId -GetExtraOk returns a tuple with the Extra field if it's non-nil, zero value otherwise +`func (o *EventLog) GetRunId() string` + +GetRunId returns the RunId field if non-nil, zero value otherwise. + +### GetRunIdOk + +`func (o *EventLog) GetRunIdOk() (*string, bool)` + +GetRunIdOk returns a tuple with the RunId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetExtra +### SetRunId -`func (o *EventLog) SetExtra(v string)` +`func (o *EventLog) SetRunId(v string)` -SetExtra sets Extra field to given value. +SetRunId sets RunId field to given value. -### HasExtra +### HasRunId -`func (o *EventLog) HasExtra() bool` +`func (o *EventLog) HasRunId() bool` -HasExtra returns a boolean if a field has been set. +HasRunId returns a boolean if a field has been set. -### SetExtraNil +### SetRunIdNil -`func (o *EventLog) SetExtraNil(b bool)` +`func (o *EventLog) SetRunIdNil(b bool)` - SetExtraNil sets the value for Extra to be an explicit nil + SetRunIdNil sets the value for RunId to be an explicit nil -### UnsetExtra -`func (o *EventLog) UnsetExtra()` +### UnsetRunId +`func (o *EventLog) UnsetRunId()` + +UnsetRunId ensures that no value is present for RunId, not even an explicit nil +### GetTaskId + +`func (o *EventLog) GetTaskId() string` + +GetTaskId returns the TaskId field if non-nil, zero value otherwise. + +### GetTaskIdOk + +`func (o *EventLog) GetTaskIdOk() (*string, bool)` + +GetTaskIdOk returns a tuple with the TaskId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTaskId + +`func (o *EventLog) SetTaskId(v string)` + +SetTaskId sets TaskId field to given value. + +### HasTaskId + +`func (o *EventLog) HasTaskId() bool` + +HasTaskId returns a boolean if a field has been set. + +### SetTaskIdNil + +`func (o *EventLog) SetTaskIdNil(b bool)` + + SetTaskIdNil sets the value for TaskId to be an explicit nil + +### UnsetTaskId +`func (o *EventLog) UnsetTaskId()` + +UnsetTaskId ensures that no value is present for TaskId, not even an explicit nil +### GetTryNumber + +`func (o *EventLog) GetTryNumber() int32` + +GetTryNumber returns the TryNumber field if non-nil, zero value otherwise. + +### GetTryNumberOk + +`func (o *EventLog) GetTryNumberOk() (*int32, bool)` + +GetTryNumberOk returns a tuple with the TryNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTryNumber + +`func (o *EventLog) SetTryNumber(v int32)` + +SetTryNumber sets TryNumber field to given value. + +### HasTryNumber + +`func (o *EventLog) HasTryNumber() bool` + +HasTryNumber returns a boolean if a field has been set. + +### SetTryNumberNil + +`func (o *EventLog) SetTryNumberNil(b bool)` + + SetTryNumberNil sets the value for TryNumber to be an explicit nil + +### UnsetTryNumber +`func (o *EventLog) UnsetTryNumber()` + +UnsetTryNumber ensures that no value is present for TryNumber, not even an explicit nil +### GetWhen + +`func (o *EventLog) GetWhen() time.Time` + +GetWhen returns the When field if non-nil, zero value otherwise. + +### GetWhenOk + +`func (o *EventLog) GetWhenOk() (*time.Time, bool)` + +GetWhenOk returns a tuple with the When field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWhen + +`func (o *EventLog) SetWhen(v time.Time)` + +SetWhen sets When field to given value. + +### HasWhen + +`func (o *EventLog) HasWhen() bool` + +HasWhen returns a boolean if a field has been set. -UnsetExtra ensures that no value is present for Extra, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/EventLogApi.md b/airflow/docs/EventLogApi.md index 6f5eb81..f2a35ab 100644 --- a/airflow/docs/EventLogApi.md +++ b/airflow/docs/EventLogApi.md @@ -1,30 +1,11 @@ - - -# \EventLogApi - -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**GetEventLog**](EventLogApi.md#GetEventLog) | **Get** /eventLogs/{event_log_id} | Get a log entry -[**GetEventLogs**](EventLogApi.md#GetEventLogs) | **Get** /eventLogs | List log entries +[**GetEventLog**](EventLogAPI.md#GetEventLog) | **Get** /eventLogs/{event_log_id} | Get a log entry +[**GetEventLogs**](EventLogAPI.md#GetEventLogs) | **Get** /eventLogs | List log entries @@ -40,24 +21,24 @@ Get a log entry package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - eventLogId := int32(56) // int32 | The event log ID. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.EventLogApi.GetEventLog(context.Background(), eventLogId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `EventLogApi.GetEventLog``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetEventLog`: EventLog - fmt.Fprintf(os.Stdout, "Response from `EventLogApi.GetEventLog`: %v\n", resp) + eventLogId := int32(56) // int32 | The event log ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.EventLogAPI.GetEventLog(context.Background(), eventLogId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `EventLogAPI.GetEventLog``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetEventLog`: EventLog + fmt.Fprintf(os.Stdout, "Response from `EventLogAPI.GetEventLog`: %v\n", resp) } ``` @@ -84,7 +65,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -98,7 +79,7 @@ Name | Type | Description | Notes ## GetEventLogs -> EventLogCollection GetEventLogs(ctx).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() +> EventLogCollection GetEventLogs(ctx).Limit(limit).Offset(offset).OrderBy(orderBy).DagId(dagId).TaskId(taskId).RunId(runId).MapIndex(mapIndex).TryNumber(tryNumber).Event(event).Owner(owner).Before(before).After(after).IncludedEvents(includedEvents).ExcludedEvents(excludedEvents).Execute() List log entries @@ -110,26 +91,38 @@ List log entries package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + "time" + openapiclient "./airflow" ) func main() { - limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) - offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) - orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.EventLogApi.GetEventLogs(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `EventLogApi.GetEventLogs``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetEventLogs`: EventLogCollection - fmt.Fprintf(os.Stdout, "Response from `EventLogApi.GetEventLogs`: %v\n", resp) + limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) + offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) + orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) + dagId := "dagId_example" // string | Returns objects matched by the DAG ID. (optional) + taskId := "taskId_example" // string | Returns objects matched by the Task ID. (optional) + runId := "runId_example" // string | Returns objects matched by the Run ID. (optional) + mapIndex := int32(56) // int32 | Filter on map index for mapped task. (optional) + tryNumber := int32(56) // int32 | Filter on try_number for task instance. (optional) + event := "event_example" // string | The name of event log. (optional) + owner := "owner_example" // string | The owner's name of event log. (optional) + before := time.Now() // time.Time | Timestamp to select event logs occurring before. (optional) + after := time.Now() // time.Time | Timestamp to select event logs occurring after. (optional) + includedEvents := "includedEvents_example" // string | One or more event names separated by commas. If set, only return event logs with events matching this pattern. *New in version 2.9.0* (optional) + excludedEvents := "excludedEvents_example" // string | One or more event names separated by commas. If set, only return event logs with events that do not match this pattern. *New in version 2.9.0* (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.EventLogAPI.GetEventLogs(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).DagId(dagId).TaskId(taskId).RunId(runId).MapIndex(mapIndex).TryNumber(tryNumber).Event(event).Owner(owner).Before(before).After(after).IncludedEvents(includedEvents).ExcludedEvents(excludedEvents).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `EventLogAPI.GetEventLogs``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetEventLogs`: EventLogCollection + fmt.Fprintf(os.Stdout, "Response from `EventLogAPI.GetEventLogs`: %v\n", resp) } ``` @@ -147,6 +140,17 @@ Name | Type | Description | Notes **limit** | **int32** | The numbers of items to return. | [default to 100] **offset** | **int32** | The number of items to skip before starting to collect the result set. | **orderBy** | **string** | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* | + **dagId** | **string** | Returns objects matched by the DAG ID. | + **taskId** | **string** | Returns objects matched by the Task ID. | + **runId** | **string** | Returns objects matched by the Run ID. | + **mapIndex** | **int32** | Filter on map index for mapped task. | + **tryNumber** | **int32** | Filter on try_number for task instance. | + **event** | **string** | The name of event log. | + **owner** | **string** | The owner's name of event log. | + **before** | **time.Time** | Timestamp to select event logs occurring before. | + **after** | **time.Time** | Timestamp to select event logs occurring after. | + **includedEvents** | **string** | One or more event names separated by commas. If set, only return event logs with events matching this pattern. *New in version 2.9.0* | + **excludedEvents** | **string** | One or more event names separated by commas. If set, only return event logs with events that do not match this pattern. *New in version 2.9.0* | ### Return type @@ -154,7 +158,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers diff --git a/airflow/docs/EventLogCollection.md b/airflow/docs/EventLogCollection.md index b6471ab..4680e82 100644 --- a/airflow/docs/EventLogCollection.md +++ b/airflow/docs/EventLogCollection.md @@ -1,30 +1,11 @@ - - # EventLogCollection ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] **EventLogs** | Pointer to [**[]EventLog**](EventLog.md) | | [optional] -**TotalEntries** | Pointer to **int32** | Count of objects in the current result set. | [optional] ## Methods @@ -45,55 +26,55 @@ NewEventLogCollectionWithDefaults instantiates a new EventLogCollection object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetEventLogs +### GetTotalEntries -`func (o *EventLogCollection) GetEventLogs() []EventLog` +`func (o *EventLogCollection) GetTotalEntries() int32` -GetEventLogs returns the EventLogs field if non-nil, zero value otherwise. +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. -### GetEventLogsOk +### GetTotalEntriesOk -`func (o *EventLogCollection) GetEventLogsOk() (*[]EventLog, bool)` +`func (o *EventLogCollection) GetTotalEntriesOk() (*int32, bool)` -GetEventLogsOk returns a tuple with the EventLogs field if it's non-nil, zero value otherwise +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetEventLogs +### SetTotalEntries -`func (o *EventLogCollection) SetEventLogs(v []EventLog)` +`func (o *EventLogCollection) SetTotalEntries(v int32)` -SetEventLogs sets EventLogs field to given value. +SetTotalEntries sets TotalEntries field to given value. -### HasEventLogs +### HasTotalEntries -`func (o *EventLogCollection) HasEventLogs() bool` +`func (o *EventLogCollection) HasTotalEntries() bool` -HasEventLogs returns a boolean if a field has been set. +HasTotalEntries returns a boolean if a field has been set. -### GetTotalEntries +### GetEventLogs -`func (o *EventLogCollection) GetTotalEntries() int32` +`func (o *EventLogCollection) GetEventLogs() []EventLog` -GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. +GetEventLogs returns the EventLogs field if non-nil, zero value otherwise. -### GetTotalEntriesOk +### GetEventLogsOk -`func (o *EventLogCollection) GetTotalEntriesOk() (*int32, bool)` +`func (o *EventLogCollection) GetEventLogsOk() (*[]EventLog, bool)` -GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +GetEventLogsOk returns a tuple with the EventLogs field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTotalEntries +### SetEventLogs -`func (o *EventLogCollection) SetTotalEntries(v int32)` +`func (o *EventLogCollection) SetEventLogs(v []EventLog)` -SetTotalEntries sets TotalEntries field to given value. +SetEventLogs sets EventLogs field to given value. -### HasTotalEntries +### HasEventLogs -`func (o *EventLogCollection) HasTotalEntries() bool` +`func (o *EventLogCollection) HasEventLogs() bool` -HasTotalEntries returns a boolean if a field has been set. +HasEventLogs returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/ExtraLink.md b/airflow/docs/ExtraLink.md index 09a3ac5..3309569 100644 --- a/airflow/docs/ExtraLink.md +++ b/airflow/docs/ExtraLink.md @@ -1,22 +1,3 @@ - - # ExtraLink ## Properties @@ -24,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ClassRef** | Pointer to [**ClassReference**](ClassReference.md) | | [optional] -**Name** | Pointer to **string** | | [optional] [readonly] **Href** | Pointer to **string** | | [optional] [readonly] +**Name** | Pointer to **string** | | [optional] [readonly] ## Methods @@ -71,55 +52,55 @@ SetClassRef sets ClassRef field to given value. HasClassRef returns a boolean if a field has been set. -### GetName +### GetHref -`func (o *ExtraLink) GetName() string` +`func (o *ExtraLink) GetHref() string` -GetName returns the Name field if non-nil, zero value otherwise. +GetHref returns the Href field if non-nil, zero value otherwise. -### GetNameOk +### GetHrefOk -`func (o *ExtraLink) GetNameOk() (*string, bool)` +`func (o *ExtraLink) GetHrefOk() (*string, bool)` -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetName +### SetHref -`func (o *ExtraLink) SetName(v string)` +`func (o *ExtraLink) SetHref(v string)` -SetName sets Name field to given value. +SetHref sets Href field to given value. -### HasName +### HasHref -`func (o *ExtraLink) HasName() bool` +`func (o *ExtraLink) HasHref() bool` -HasName returns a boolean if a field has been set. +HasHref returns a boolean if a field has been set. -### GetHref +### GetName -`func (o *ExtraLink) GetHref() string` +`func (o *ExtraLink) GetName() string` -GetHref returns the Href field if non-nil, zero value otherwise. +GetName returns the Name field if non-nil, zero value otherwise. -### GetHrefOk +### GetNameOk -`func (o *ExtraLink) GetHrefOk() (*string, bool)` +`func (o *ExtraLink) GetNameOk() (*string, bool)` -GetHrefOk returns a tuple with the Href field if it's non-nil, zero value otherwise +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetHref +### SetName -`func (o *ExtraLink) SetHref(v string)` +`func (o *ExtraLink) SetName(v string)` -SetHref sets Href field to given value. +SetName sets Name field to given value. -### HasHref +### HasName -`func (o *ExtraLink) HasHref() bool` +`func (o *ExtraLink) HasName() bool` -HasHref returns a boolean if a field has been set. +HasName returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/ExtraLinkCollection.md b/airflow/docs/ExtraLinkCollection.md index 1e29b7c..c261773 100644 --- a/airflow/docs/ExtraLinkCollection.md +++ b/airflow/docs/ExtraLinkCollection.md @@ -1,22 +1,3 @@ - - # ExtraLinkCollection ## Properties diff --git a/airflow/docs/GetDagSource200Response.md b/airflow/docs/GetDagSource200Response.md new file mode 100644 index 0000000..f5cb903 --- /dev/null +++ b/airflow/docs/GetDagSource200Response.md @@ -0,0 +1,56 @@ +# GetDagSource200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Content** | Pointer to **string** | | [optional] + +## Methods + +### NewGetDagSource200Response + +`func NewGetDagSource200Response() *GetDagSource200Response` + +NewGetDagSource200Response instantiates a new GetDagSource200Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetDagSource200ResponseWithDefaults + +`func NewGetDagSource200ResponseWithDefaults() *GetDagSource200Response` + +NewGetDagSource200ResponseWithDefaults instantiates a new GetDagSource200Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetContent + +`func (o *GetDagSource200Response) GetContent() string` + +GetContent returns the Content field if non-nil, zero value otherwise. + +### GetContentOk + +`func (o *GetDagSource200Response) GetContentOk() (*string, bool)` + +GetContentOk returns a tuple with the Content field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContent + +`func (o *GetDagSource200Response) SetContent(v string)` + +SetContent sets Content field to given value. + +### HasContent + +`func (o *GetDagSource200Response) HasContent() bool` + +HasContent returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/docs/GetLog200Response.md b/airflow/docs/GetLog200Response.md new file mode 100644 index 0000000..a166ad0 --- /dev/null +++ b/airflow/docs/GetLog200Response.md @@ -0,0 +1,82 @@ +# GetLog200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Content** | Pointer to **string** | | [optional] +**ContinuationToken** | Pointer to **string** | | [optional] + +## Methods + +### NewGetLog200Response + +`func NewGetLog200Response() *GetLog200Response` + +NewGetLog200Response instantiates a new GetLog200Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetLog200ResponseWithDefaults + +`func NewGetLog200ResponseWithDefaults() *GetLog200Response` + +NewGetLog200ResponseWithDefaults instantiates a new GetLog200Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetContent + +`func (o *GetLog200Response) GetContent() string` + +GetContent returns the Content field if non-nil, zero value otherwise. + +### GetContentOk + +`func (o *GetLog200Response) GetContentOk() (*string, bool)` + +GetContentOk returns a tuple with the Content field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContent + +`func (o *GetLog200Response) SetContent(v string)` + +SetContent sets Content field to given value. + +### HasContent + +`func (o *GetLog200Response) HasContent() bool` + +HasContent returns a boolean if a field has been set. + +### GetContinuationToken + +`func (o *GetLog200Response) GetContinuationToken() string` + +GetContinuationToken returns the ContinuationToken field if non-nil, zero value otherwise. + +### GetContinuationTokenOk + +`func (o *GetLog200Response) GetContinuationTokenOk() (*string, bool)` + +GetContinuationTokenOk returns a tuple with the ContinuationToken field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContinuationToken + +`func (o *GetLog200Response) SetContinuationToken(v string)` + +SetContinuationToken sets ContinuationToken field to given value. + +### HasContinuationToken + +`func (o *GetLog200Response) HasContinuationToken() bool` + +HasContinuationToken returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/docs/GetProviders200Response.md b/airflow/docs/GetProviders200Response.md new file mode 100644 index 0000000..1fb42c2 --- /dev/null +++ b/airflow/docs/GetProviders200Response.md @@ -0,0 +1,82 @@ +# GetProviders200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Providers** | Pointer to [**[]Provider**](Provider.md) | | [optional] +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] + +## Methods + +### NewGetProviders200Response + +`func NewGetProviders200Response() *GetProviders200Response` + +NewGetProviders200Response instantiates a new GetProviders200Response object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetProviders200ResponseWithDefaults + +`func NewGetProviders200ResponseWithDefaults() *GetProviders200Response` + +NewGetProviders200ResponseWithDefaults instantiates a new GetProviders200Response object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetProviders + +`func (o *GetProviders200Response) GetProviders() []Provider` + +GetProviders returns the Providers field if non-nil, zero value otherwise. + +### GetProvidersOk + +`func (o *GetProviders200Response) GetProvidersOk() (*[]Provider, bool)` + +GetProvidersOk returns a tuple with the Providers field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProviders + +`func (o *GetProviders200Response) SetProviders(v []Provider)` + +SetProviders sets Providers field to given value. + +### HasProviders + +`func (o *GetProviders200Response) HasProviders() bool` + +HasProviders returns a boolean if a field has been set. + +### GetTotalEntries + +`func (o *GetProviders200Response) GetTotalEntries() int32` + +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. + +### GetTotalEntriesOk + +`func (o *GetProviders200Response) GetTotalEntriesOk() (*int32, bool)` + +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalEntries + +`func (o *GetProviders200Response) SetTotalEntries(v int32)` + +SetTotalEntries sets TotalEntries field to given value. + +### HasTotalEntries + +`func (o *GetProviders200Response) HasTotalEntries() bool` + +HasTotalEntries returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/docs/HealthInfo.md b/airflow/docs/HealthInfo.md index 63deb8e..c01a86c 100644 --- a/airflow/docs/HealthInfo.md +++ b/airflow/docs/HealthInfo.md @@ -1,30 +1,13 @@ - - # HealthInfo ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**DagProcessor** | Pointer to [**DagProcessorStatus**](DagProcessorStatus.md) | | [optional] **Metadatabase** | Pointer to [**MetadatabaseStatus**](MetadatabaseStatus.md) | | [optional] **Scheduler** | Pointer to [**SchedulerStatus**](SchedulerStatus.md) | | [optional] +**Triggerer** | Pointer to [**TriggererStatus**](TriggererStatus.md) | | [optional] ## Methods @@ -45,6 +28,31 @@ NewHealthInfoWithDefaults instantiates a new HealthInfo object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set +### GetDagProcessor + +`func (o *HealthInfo) GetDagProcessor() DagProcessorStatus` + +GetDagProcessor returns the DagProcessor field if non-nil, zero value otherwise. + +### GetDagProcessorOk + +`func (o *HealthInfo) GetDagProcessorOk() (*DagProcessorStatus, bool)` + +GetDagProcessorOk returns a tuple with the DagProcessor field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDagProcessor + +`func (o *HealthInfo) SetDagProcessor(v DagProcessorStatus)` + +SetDagProcessor sets DagProcessor field to given value. + +### HasDagProcessor + +`func (o *HealthInfo) HasDagProcessor() bool` + +HasDagProcessor returns a boolean if a field has been set. + ### GetMetadatabase `func (o *HealthInfo) GetMetadatabase() MetadatabaseStatus` @@ -95,6 +103,31 @@ SetScheduler sets Scheduler field to given value. HasScheduler returns a boolean if a field has been set. +### GetTriggerer + +`func (o *HealthInfo) GetTriggerer() TriggererStatus` + +GetTriggerer returns the Triggerer field if non-nil, zero value otherwise. + +### GetTriggererOk + +`func (o *HealthInfo) GetTriggererOk() (*TriggererStatus, bool)` + +GetTriggererOk returns a tuple with the Triggerer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTriggerer + +`func (o *HealthInfo) SetTriggerer(v TriggererStatus)` + +SetTriggerer sets Triggerer field to given value. + +### HasTriggerer + +`func (o *HealthInfo) HasTriggerer() bool` + +HasTriggerer returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/HealthStatus.md b/airflow/docs/HealthStatus.md index 979aec8..4490171 100644 --- a/airflow/docs/HealthStatus.md +++ b/airflow/docs/HealthStatus.md @@ -1,22 +1,3 @@ - - # HealthStatus ## Enum diff --git a/airflow/docs/ImportError.md b/airflow/docs/ImportError.md index bf0050f..d8f31c4 100644 --- a/airflow/docs/ImportError.md +++ b/airflow/docs/ImportError.md @@ -1,32 +1,13 @@ - - # ImportError ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**Filename** | Pointer to **string** | The filename | [optional] [readonly] **ImportErrorId** | Pointer to **int32** | The import error ID. | [optional] [readonly] +**StackTrace** | Pointer to **string** | The full stackstrace. | [optional] [readonly] **Timestamp** | Pointer to **string** | The time when this error was created. | [optional] [readonly] -**Filename** | Pointer to **string** | The filename | [optional] [readonly] -**StackTrace** | Pointer to **string** | The full stackstrace.. | [optional] [readonly] ## Methods @@ -47,105 +28,105 @@ NewImportErrorWithDefaults instantiates a new ImportError object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetImportErrorId +### GetFilename -`func (o *ImportError) GetImportErrorId() int32` +`func (o *ImportError) GetFilename() string` -GetImportErrorId returns the ImportErrorId field if non-nil, zero value otherwise. +GetFilename returns the Filename field if non-nil, zero value otherwise. -### GetImportErrorIdOk +### GetFilenameOk -`func (o *ImportError) GetImportErrorIdOk() (*int32, bool)` +`func (o *ImportError) GetFilenameOk() (*string, bool)` -GetImportErrorIdOk returns a tuple with the ImportErrorId field if it's non-nil, zero value otherwise +GetFilenameOk returns a tuple with the Filename field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetImportErrorId +### SetFilename -`func (o *ImportError) SetImportErrorId(v int32)` +`func (o *ImportError) SetFilename(v string)` -SetImportErrorId sets ImportErrorId field to given value. +SetFilename sets Filename field to given value. -### HasImportErrorId +### HasFilename -`func (o *ImportError) HasImportErrorId() bool` +`func (o *ImportError) HasFilename() bool` -HasImportErrorId returns a boolean if a field has been set. +HasFilename returns a boolean if a field has been set. -### GetTimestamp +### GetImportErrorId -`func (o *ImportError) GetTimestamp() string` +`func (o *ImportError) GetImportErrorId() int32` -GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. +GetImportErrorId returns the ImportErrorId field if non-nil, zero value otherwise. -### GetTimestampOk +### GetImportErrorIdOk -`func (o *ImportError) GetTimestampOk() (*string, bool)` +`func (o *ImportError) GetImportErrorIdOk() (*int32, bool)` -GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise +GetImportErrorIdOk returns a tuple with the ImportErrorId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTimestamp +### SetImportErrorId -`func (o *ImportError) SetTimestamp(v string)` +`func (o *ImportError) SetImportErrorId(v int32)` -SetTimestamp sets Timestamp field to given value. +SetImportErrorId sets ImportErrorId field to given value. -### HasTimestamp +### HasImportErrorId -`func (o *ImportError) HasTimestamp() bool` +`func (o *ImportError) HasImportErrorId() bool` -HasTimestamp returns a boolean if a field has been set. +HasImportErrorId returns a boolean if a field has been set. -### GetFilename +### GetStackTrace -`func (o *ImportError) GetFilename() string` +`func (o *ImportError) GetStackTrace() string` -GetFilename returns the Filename field if non-nil, zero value otherwise. +GetStackTrace returns the StackTrace field if non-nil, zero value otherwise. -### GetFilenameOk +### GetStackTraceOk -`func (o *ImportError) GetFilenameOk() (*string, bool)` +`func (o *ImportError) GetStackTraceOk() (*string, bool)` -GetFilenameOk returns a tuple with the Filename field if it's non-nil, zero value otherwise +GetStackTraceOk returns a tuple with the StackTrace field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetFilename +### SetStackTrace -`func (o *ImportError) SetFilename(v string)` +`func (o *ImportError) SetStackTrace(v string)` -SetFilename sets Filename field to given value. +SetStackTrace sets StackTrace field to given value. -### HasFilename +### HasStackTrace -`func (o *ImportError) HasFilename() bool` +`func (o *ImportError) HasStackTrace() bool` -HasFilename returns a boolean if a field has been set. +HasStackTrace returns a boolean if a field has been set. -### GetStackTrace +### GetTimestamp -`func (o *ImportError) GetStackTrace() string` +`func (o *ImportError) GetTimestamp() string` -GetStackTrace returns the StackTrace field if non-nil, zero value otherwise. +GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. -### GetStackTraceOk +### GetTimestampOk -`func (o *ImportError) GetStackTraceOk() (*string, bool)` +`func (o *ImportError) GetTimestampOk() (*string, bool)` -GetStackTraceOk returns a tuple with the StackTrace field if it's non-nil, zero value otherwise +GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetStackTrace +### SetTimestamp -`func (o *ImportError) SetStackTrace(v string)` +`func (o *ImportError) SetTimestamp(v string)` -SetStackTrace sets StackTrace field to given value. +SetTimestamp sets Timestamp field to given value. -### HasStackTrace +### HasTimestamp -`func (o *ImportError) HasStackTrace() bool` +`func (o *ImportError) HasTimestamp() bool` -HasStackTrace returns a boolean if a field has been set. +HasTimestamp returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/ImportErrorApi.md b/airflow/docs/ImportErrorApi.md index ea99a91..d9584f0 100644 --- a/airflow/docs/ImportErrorApi.md +++ b/airflow/docs/ImportErrorApi.md @@ -1,30 +1,11 @@ - - -# \ImportErrorApi - -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**GetImportError**](ImportErrorApi.md#GetImportError) | **Get** /importErrors/{import_error_id} | Get an import error -[**GetImportErrors**](ImportErrorApi.md#GetImportErrors) | **Get** /importErrors | List import errors +[**GetImportError**](ImportErrorAPI.md#GetImportError) | **Get** /importErrors/{import_error_id} | Get an import error +[**GetImportErrors**](ImportErrorAPI.md#GetImportErrors) | **Get** /importErrors | List import errors @@ -40,24 +21,24 @@ Get an import error package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - importErrorId := int32(56) // int32 | The import error ID. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.ImportErrorApi.GetImportError(context.Background(), importErrorId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ImportErrorApi.GetImportError``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetImportError`: ImportError - fmt.Fprintf(os.Stdout, "Response from `ImportErrorApi.GetImportError`: %v\n", resp) + importErrorId := int32(56) // int32 | The import error ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ImportErrorAPI.GetImportError(context.Background(), importErrorId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ImportErrorAPI.GetImportError``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetImportError`: ImportError + fmt.Fprintf(os.Stdout, "Response from `ImportErrorAPI.GetImportError`: %v\n", resp) } ``` @@ -84,7 +65,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -108,26 +89,26 @@ List import errors package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) - offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) - orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.ImportErrorApi.GetImportErrors(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ImportErrorApi.GetImportErrors``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetImportErrors`: ImportErrorCollection - fmt.Fprintf(os.Stdout, "Response from `ImportErrorApi.GetImportErrors`: %v\n", resp) + limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) + offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) + orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ImportErrorAPI.GetImportErrors(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ImportErrorAPI.GetImportErrors``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetImportErrors`: ImportErrorCollection + fmt.Fprintf(os.Stdout, "Response from `ImportErrorAPI.GetImportErrors`: %v\n", resp) } ``` @@ -152,7 +133,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers diff --git a/airflow/docs/ImportErrorCollection.md b/airflow/docs/ImportErrorCollection.md index cdd2c55..a490db3 100644 --- a/airflow/docs/ImportErrorCollection.md +++ b/airflow/docs/ImportErrorCollection.md @@ -1,30 +1,11 @@ - - # ImportErrorCollection ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] **ImportErrors** | Pointer to [**[]ImportError**](ImportError.md) | | [optional] -**TotalEntries** | Pointer to **int32** | Count of objects in the current result set. | [optional] ## Methods @@ -45,55 +26,55 @@ NewImportErrorCollectionWithDefaults instantiates a new ImportErrorCollection ob This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetImportErrors +### GetTotalEntries -`func (o *ImportErrorCollection) GetImportErrors() []ImportError` +`func (o *ImportErrorCollection) GetTotalEntries() int32` -GetImportErrors returns the ImportErrors field if non-nil, zero value otherwise. +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. -### GetImportErrorsOk +### GetTotalEntriesOk -`func (o *ImportErrorCollection) GetImportErrorsOk() (*[]ImportError, bool)` +`func (o *ImportErrorCollection) GetTotalEntriesOk() (*int32, bool)` -GetImportErrorsOk returns a tuple with the ImportErrors field if it's non-nil, zero value otherwise +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetImportErrors +### SetTotalEntries -`func (o *ImportErrorCollection) SetImportErrors(v []ImportError)` +`func (o *ImportErrorCollection) SetTotalEntries(v int32)` -SetImportErrors sets ImportErrors field to given value. +SetTotalEntries sets TotalEntries field to given value. -### HasImportErrors +### HasTotalEntries -`func (o *ImportErrorCollection) HasImportErrors() bool` +`func (o *ImportErrorCollection) HasTotalEntries() bool` -HasImportErrors returns a boolean if a field has been set. +HasTotalEntries returns a boolean if a field has been set. -### GetTotalEntries +### GetImportErrors -`func (o *ImportErrorCollection) GetTotalEntries() int32` +`func (o *ImportErrorCollection) GetImportErrors() []ImportError` -GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. +GetImportErrors returns the ImportErrors field if non-nil, zero value otherwise. -### GetTotalEntriesOk +### GetImportErrorsOk -`func (o *ImportErrorCollection) GetTotalEntriesOk() (*int32, bool)` +`func (o *ImportErrorCollection) GetImportErrorsOk() (*[]ImportError, bool)` -GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +GetImportErrorsOk returns a tuple with the ImportErrors field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTotalEntries +### SetImportErrors -`func (o *ImportErrorCollection) SetTotalEntries(v int32)` +`func (o *ImportErrorCollection) SetImportErrors(v []ImportError)` -SetTotalEntries sets TotalEntries field to given value. +SetImportErrors sets ImportErrors field to given value. -### HasTotalEntries +### HasImportErrors -`func (o *ImportErrorCollection) HasTotalEntries() bool` +`func (o *ImportErrorCollection) HasImportErrors() bool` -HasTotalEntries returns a boolean if a field has been set. +HasImportErrors returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/Job.md b/airflow/docs/Job.md index 2cada5a..eedddd9 100644 --- a/airflow/docs/Job.md +++ b/airflow/docs/Job.md @@ -1,37 +1,18 @@ - - # Job ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | Pointer to **int32** | | [optional] **DagId** | Pointer to **NullableString** | | [optional] -**State** | Pointer to **NullableString** | | [optional] -**JobType** | Pointer to **NullableString** | | [optional] -**StartDate** | Pointer to **NullableString** | | [optional] **EndDate** | Pointer to **NullableString** | | [optional] -**LatestHeartbeat** | Pointer to **NullableString** | | [optional] **ExecutorClass** | Pointer to **NullableString** | | [optional] **Hostname** | Pointer to **NullableString** | | [optional] +**Id** | Pointer to **int32** | | [optional] +**JobType** | Pointer to **NullableString** | | [optional] +**LatestHeartbeat** | Pointer to **NullableString** | | [optional] +**StartDate** | Pointer to **NullableString** | | [optional] +**State** | Pointer to **NullableString** | | [optional] **Unixname** | Pointer to **NullableString** | | [optional] ## Methods @@ -53,31 +34,6 @@ NewJobWithDefaults instantiates a new Job object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetId - -`func (o *Job) GetId() int32` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *Job) GetIdOk() (*int32, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *Job) SetId(v int32)` - -SetId sets Id field to given value. - -### HasId - -`func (o *Job) HasId() bool` - -HasId returns a boolean if a field has been set. - ### GetDagId `func (o *Job) GetDagId() string` @@ -113,146 +69,171 @@ HasDagId returns a boolean if a field has been set. `func (o *Job) UnsetDagId()` UnsetDagId ensures that no value is present for DagId, not even an explicit nil -### GetState +### GetEndDate -`func (o *Job) GetState() string` +`func (o *Job) GetEndDate() string` -GetState returns the State field if non-nil, zero value otherwise. +GetEndDate returns the EndDate field if non-nil, zero value otherwise. -### GetStateOk +### GetEndDateOk -`func (o *Job) GetStateOk() (*string, bool)` +`func (o *Job) GetEndDateOk() (*string, bool)` -GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +GetEndDateOk returns a tuple with the EndDate field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetState +### SetEndDate -`func (o *Job) SetState(v string)` +`func (o *Job) SetEndDate(v string)` -SetState sets State field to given value. +SetEndDate sets EndDate field to given value. -### HasState +### HasEndDate -`func (o *Job) HasState() bool` +`func (o *Job) HasEndDate() bool` -HasState returns a boolean if a field has been set. +HasEndDate returns a boolean if a field has been set. -### SetStateNil +### SetEndDateNil -`func (o *Job) SetStateNil(b bool)` +`func (o *Job) SetEndDateNil(b bool)` - SetStateNil sets the value for State to be an explicit nil + SetEndDateNil sets the value for EndDate to be an explicit nil -### UnsetState -`func (o *Job) UnsetState()` +### UnsetEndDate +`func (o *Job) UnsetEndDate()` -UnsetState ensures that no value is present for State, not even an explicit nil -### GetJobType +UnsetEndDate ensures that no value is present for EndDate, not even an explicit nil +### GetExecutorClass -`func (o *Job) GetJobType() string` +`func (o *Job) GetExecutorClass() string` -GetJobType returns the JobType field if non-nil, zero value otherwise. +GetExecutorClass returns the ExecutorClass field if non-nil, zero value otherwise. -### GetJobTypeOk +### GetExecutorClassOk -`func (o *Job) GetJobTypeOk() (*string, bool)` +`func (o *Job) GetExecutorClassOk() (*string, bool)` -GetJobTypeOk returns a tuple with the JobType field if it's non-nil, zero value otherwise +GetExecutorClassOk returns a tuple with the ExecutorClass field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetJobType +### SetExecutorClass -`func (o *Job) SetJobType(v string)` +`func (o *Job) SetExecutorClass(v string)` -SetJobType sets JobType field to given value. +SetExecutorClass sets ExecutorClass field to given value. -### HasJobType +### HasExecutorClass -`func (o *Job) HasJobType() bool` +`func (o *Job) HasExecutorClass() bool` -HasJobType returns a boolean if a field has been set. +HasExecutorClass returns a boolean if a field has been set. -### SetJobTypeNil +### SetExecutorClassNil -`func (o *Job) SetJobTypeNil(b bool)` +`func (o *Job) SetExecutorClassNil(b bool)` - SetJobTypeNil sets the value for JobType to be an explicit nil + SetExecutorClassNil sets the value for ExecutorClass to be an explicit nil -### UnsetJobType -`func (o *Job) UnsetJobType()` +### UnsetExecutorClass +`func (o *Job) UnsetExecutorClass()` -UnsetJobType ensures that no value is present for JobType, not even an explicit nil -### GetStartDate +UnsetExecutorClass ensures that no value is present for ExecutorClass, not even an explicit nil +### GetHostname -`func (o *Job) GetStartDate() string` +`func (o *Job) GetHostname() string` -GetStartDate returns the StartDate field if non-nil, zero value otherwise. +GetHostname returns the Hostname field if non-nil, zero value otherwise. -### GetStartDateOk +### GetHostnameOk -`func (o *Job) GetStartDateOk() (*string, bool)` +`func (o *Job) GetHostnameOk() (*string, bool)` -GetStartDateOk returns a tuple with the StartDate field if it's non-nil, zero value otherwise +GetHostnameOk returns a tuple with the Hostname field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetStartDate +### SetHostname -`func (o *Job) SetStartDate(v string)` +`func (o *Job) SetHostname(v string)` -SetStartDate sets StartDate field to given value. +SetHostname sets Hostname field to given value. -### HasStartDate +### HasHostname -`func (o *Job) HasStartDate() bool` +`func (o *Job) HasHostname() bool` -HasStartDate returns a boolean if a field has been set. +HasHostname returns a boolean if a field has been set. -### SetStartDateNil +### SetHostnameNil -`func (o *Job) SetStartDateNil(b bool)` +`func (o *Job) SetHostnameNil(b bool)` - SetStartDateNil sets the value for StartDate to be an explicit nil + SetHostnameNil sets the value for Hostname to be an explicit nil -### UnsetStartDate -`func (o *Job) UnsetStartDate()` +### UnsetHostname +`func (o *Job) UnsetHostname()` -UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil -### GetEndDate +UnsetHostname ensures that no value is present for Hostname, not even an explicit nil +### GetId -`func (o *Job) GetEndDate() string` +`func (o *Job) GetId() int32` -GetEndDate returns the EndDate field if non-nil, zero value otherwise. +GetId returns the Id field if non-nil, zero value otherwise. -### GetEndDateOk +### GetIdOk -`func (o *Job) GetEndDateOk() (*string, bool)` +`func (o *Job) GetIdOk() (*int32, bool)` -GetEndDateOk returns a tuple with the EndDate field if it's non-nil, zero value otherwise +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetEndDate +### SetId -`func (o *Job) SetEndDate(v string)` +`func (o *Job) SetId(v int32)` -SetEndDate sets EndDate field to given value. +SetId sets Id field to given value. -### HasEndDate +### HasId -`func (o *Job) HasEndDate() bool` +`func (o *Job) HasId() bool` -HasEndDate returns a boolean if a field has been set. +HasId returns a boolean if a field has been set. -### SetEndDateNil +### GetJobType -`func (o *Job) SetEndDateNil(b bool)` +`func (o *Job) GetJobType() string` - SetEndDateNil sets the value for EndDate to be an explicit nil +GetJobType returns the JobType field if non-nil, zero value otherwise. -### UnsetEndDate -`func (o *Job) UnsetEndDate()` +### GetJobTypeOk -UnsetEndDate ensures that no value is present for EndDate, not even an explicit nil +`func (o *Job) GetJobTypeOk() (*string, bool)` + +GetJobTypeOk returns a tuple with the JobType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetJobType + +`func (o *Job) SetJobType(v string)` + +SetJobType sets JobType field to given value. + +### HasJobType + +`func (o *Job) HasJobType() bool` + +HasJobType returns a boolean if a field has been set. + +### SetJobTypeNil + +`func (o *Job) SetJobTypeNil(b bool)` + + SetJobTypeNil sets the value for JobType to be an explicit nil + +### UnsetJobType +`func (o *Job) UnsetJobType()` + +UnsetJobType ensures that no value is present for JobType, not even an explicit nil ### GetLatestHeartbeat `func (o *Job) GetLatestHeartbeat() string` @@ -288,76 +269,76 @@ HasLatestHeartbeat returns a boolean if a field has been set. `func (o *Job) UnsetLatestHeartbeat()` UnsetLatestHeartbeat ensures that no value is present for LatestHeartbeat, not even an explicit nil -### GetExecutorClass +### GetStartDate -`func (o *Job) GetExecutorClass() string` +`func (o *Job) GetStartDate() string` -GetExecutorClass returns the ExecutorClass field if non-nil, zero value otherwise. +GetStartDate returns the StartDate field if non-nil, zero value otherwise. -### GetExecutorClassOk +### GetStartDateOk -`func (o *Job) GetExecutorClassOk() (*string, bool)` +`func (o *Job) GetStartDateOk() (*string, bool)` -GetExecutorClassOk returns a tuple with the ExecutorClass field if it's non-nil, zero value otherwise +GetStartDateOk returns a tuple with the StartDate field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetExecutorClass +### SetStartDate -`func (o *Job) SetExecutorClass(v string)` +`func (o *Job) SetStartDate(v string)` -SetExecutorClass sets ExecutorClass field to given value. +SetStartDate sets StartDate field to given value. -### HasExecutorClass +### HasStartDate -`func (o *Job) HasExecutorClass() bool` +`func (o *Job) HasStartDate() bool` -HasExecutorClass returns a boolean if a field has been set. +HasStartDate returns a boolean if a field has been set. -### SetExecutorClassNil +### SetStartDateNil -`func (o *Job) SetExecutorClassNil(b bool)` +`func (o *Job) SetStartDateNil(b bool)` - SetExecutorClassNil sets the value for ExecutorClass to be an explicit nil + SetStartDateNil sets the value for StartDate to be an explicit nil -### UnsetExecutorClass -`func (o *Job) UnsetExecutorClass()` +### UnsetStartDate +`func (o *Job) UnsetStartDate()` -UnsetExecutorClass ensures that no value is present for ExecutorClass, not even an explicit nil -### GetHostname +UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil +### GetState -`func (o *Job) GetHostname() string` +`func (o *Job) GetState() string` -GetHostname returns the Hostname field if non-nil, zero value otherwise. +GetState returns the State field if non-nil, zero value otherwise. -### GetHostnameOk +### GetStateOk -`func (o *Job) GetHostnameOk() (*string, bool)` +`func (o *Job) GetStateOk() (*string, bool)` -GetHostnameOk returns a tuple with the Hostname field if it's non-nil, zero value otherwise +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetHostname +### SetState -`func (o *Job) SetHostname(v string)` +`func (o *Job) SetState(v string)` -SetHostname sets Hostname field to given value. +SetState sets State field to given value. -### HasHostname +### HasState -`func (o *Job) HasHostname() bool` +`func (o *Job) HasState() bool` -HasHostname returns a boolean if a field has been set. +HasState returns a boolean if a field has been set. -### SetHostnameNil +### SetStateNil -`func (o *Job) SetHostnameNil(b bool)` +`func (o *Job) SetStateNil(b bool)` - SetHostnameNil sets the value for Hostname to be an explicit nil + SetStateNil sets the value for State to be an explicit nil -### UnsetHostname -`func (o *Job) UnsetHostname()` +### UnsetState +`func (o *Job) UnsetState()` -UnsetHostname ensures that no value is present for Hostname, not even an explicit nil +UnsetState ensures that no value is present for State, not even an explicit nil ### GetUnixname `func (o *Job) GetUnixname() string` diff --git a/airflow/docs/ListDagRunsForm.md b/airflow/docs/ListDagRunsForm.md index 297a62b..e3cb839 100644 --- a/airflow/docs/ListDagRunsForm.md +++ b/airflow/docs/ListDagRunsForm.md @@ -1,39 +1,20 @@ - - # ListDagRunsForm ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**OrderBy** | Pointer to **string** | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* | [optional] -**PageOffset** | Pointer to **int32** | The number of items to skip before starting to collect the result set. | [optional] -**PageLimit** | Pointer to **int32** | The numbers of items to return. | [optional] [default to 100] **DagIds** | Pointer to **[]string** | Return objects with specific DAG IDs. The value can be repeated to retrieve multiple matching values (OR condition). | [optional] -**States** | Pointer to **[]string** | Return objects with specific states. The value can be repeated to retrieve multiple matching values (OR condition). | [optional] +**EndDateGte** | Pointer to **time.Time** | Returns objects greater or equal the specified date. This can be combined with end_date_lte parameter to receive only the selected period. | [optional] +**EndDateLte** | Pointer to **time.Time** | Returns objects less than or equal to the specified date. This can be combined with end_date_gte parameter to receive only the selected period. | [optional] **ExecutionDateGte** | Pointer to **time.Time** | Returns objects greater or equal to the specified date. This can be combined with execution_date_lte key to receive only the selected period. | [optional] **ExecutionDateLte** | Pointer to **time.Time** | Returns objects less than or equal to the specified date. This can be combined with execution_date_gte key to receive only the selected period. | [optional] +**OrderBy** | Pointer to **string** | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* | [optional] +**PageLimit** | Pointer to **int32** | The numbers of items to return. | [optional] [default to 100] +**PageOffset** | Pointer to **int32** | The number of items to skip before starting to collect the result set. | [optional] **StartDateGte** | Pointer to **time.Time** | Returns objects greater or equal the specified date. This can be combined with start_date_lte key to receive only the selected period. | [optional] **StartDateLte** | Pointer to **time.Time** | Returns objects less or equal the specified date. This can be combined with start_date_gte parameter to receive only the selected period | [optional] -**EndDateGte** | Pointer to **time.Time** | Returns objects greater or equal the specified date. This can be combined with end_date_lte parameter to receive only the selected period. | [optional] -**EndDateLte** | Pointer to **time.Time** | Returns objects less than or equal to the specified date. This can be combined with end_date_gte parameter to receive only the selected period. | [optional] +**States** | Pointer to **[]string** | Return objects with specific states. The value can be repeated to retrieve multiple matching values (OR condition). | [optional] ## Methods @@ -54,180 +35,205 @@ NewListDagRunsFormWithDefaults instantiates a new ListDagRunsForm object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetOrderBy +### GetDagIds -`func (o *ListDagRunsForm) GetOrderBy() string` +`func (o *ListDagRunsForm) GetDagIds() []string` -GetOrderBy returns the OrderBy field if non-nil, zero value otherwise. +GetDagIds returns the DagIds field if non-nil, zero value otherwise. -### GetOrderByOk +### GetDagIdsOk -`func (o *ListDagRunsForm) GetOrderByOk() (*string, bool)` +`func (o *ListDagRunsForm) GetDagIdsOk() (*[]string, bool)` -GetOrderByOk returns a tuple with the OrderBy field if it's non-nil, zero value otherwise +GetDagIdsOk returns a tuple with the DagIds field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetOrderBy +### SetDagIds -`func (o *ListDagRunsForm) SetOrderBy(v string)` +`func (o *ListDagRunsForm) SetDagIds(v []string)` -SetOrderBy sets OrderBy field to given value. +SetDagIds sets DagIds field to given value. -### HasOrderBy +### HasDagIds -`func (o *ListDagRunsForm) HasOrderBy() bool` +`func (o *ListDagRunsForm) HasDagIds() bool` -HasOrderBy returns a boolean if a field has been set. +HasDagIds returns a boolean if a field has been set. -### GetPageOffset +### GetEndDateGte -`func (o *ListDagRunsForm) GetPageOffset() int32` +`func (o *ListDagRunsForm) GetEndDateGte() time.Time` -GetPageOffset returns the PageOffset field if non-nil, zero value otherwise. +GetEndDateGte returns the EndDateGte field if non-nil, zero value otherwise. -### GetPageOffsetOk +### GetEndDateGteOk -`func (o *ListDagRunsForm) GetPageOffsetOk() (*int32, bool)` +`func (o *ListDagRunsForm) GetEndDateGteOk() (*time.Time, bool)` -GetPageOffsetOk returns a tuple with the PageOffset field if it's non-nil, zero value otherwise +GetEndDateGteOk returns a tuple with the EndDateGte field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetPageOffset +### SetEndDateGte -`func (o *ListDagRunsForm) SetPageOffset(v int32)` +`func (o *ListDagRunsForm) SetEndDateGte(v time.Time)` -SetPageOffset sets PageOffset field to given value. +SetEndDateGte sets EndDateGte field to given value. -### HasPageOffset +### HasEndDateGte -`func (o *ListDagRunsForm) HasPageOffset() bool` +`func (o *ListDagRunsForm) HasEndDateGte() bool` -HasPageOffset returns a boolean if a field has been set. +HasEndDateGte returns a boolean if a field has been set. -### GetPageLimit +### GetEndDateLte -`func (o *ListDagRunsForm) GetPageLimit() int32` +`func (o *ListDagRunsForm) GetEndDateLte() time.Time` -GetPageLimit returns the PageLimit field if non-nil, zero value otherwise. +GetEndDateLte returns the EndDateLte field if non-nil, zero value otherwise. -### GetPageLimitOk +### GetEndDateLteOk -`func (o *ListDagRunsForm) GetPageLimitOk() (*int32, bool)` +`func (o *ListDagRunsForm) GetEndDateLteOk() (*time.Time, bool)` -GetPageLimitOk returns a tuple with the PageLimit field if it's non-nil, zero value otherwise +GetEndDateLteOk returns a tuple with the EndDateLte field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetPageLimit +### SetEndDateLte -`func (o *ListDagRunsForm) SetPageLimit(v int32)` +`func (o *ListDagRunsForm) SetEndDateLte(v time.Time)` -SetPageLimit sets PageLimit field to given value. +SetEndDateLte sets EndDateLte field to given value. -### HasPageLimit +### HasEndDateLte -`func (o *ListDagRunsForm) HasPageLimit() bool` +`func (o *ListDagRunsForm) HasEndDateLte() bool` -HasPageLimit returns a boolean if a field has been set. +HasEndDateLte returns a boolean if a field has been set. -### GetDagIds +### GetExecutionDateGte -`func (o *ListDagRunsForm) GetDagIds() []string` +`func (o *ListDagRunsForm) GetExecutionDateGte() time.Time` -GetDagIds returns the DagIds field if non-nil, zero value otherwise. +GetExecutionDateGte returns the ExecutionDateGte field if non-nil, zero value otherwise. -### GetDagIdsOk +### GetExecutionDateGteOk -`func (o *ListDagRunsForm) GetDagIdsOk() (*[]string, bool)` +`func (o *ListDagRunsForm) GetExecutionDateGteOk() (*time.Time, bool)` -GetDagIdsOk returns a tuple with the DagIds field if it's non-nil, zero value otherwise +GetExecutionDateGteOk returns a tuple with the ExecutionDateGte field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDagIds +### SetExecutionDateGte -`func (o *ListDagRunsForm) SetDagIds(v []string)` +`func (o *ListDagRunsForm) SetExecutionDateGte(v time.Time)` -SetDagIds sets DagIds field to given value. +SetExecutionDateGte sets ExecutionDateGte field to given value. -### HasDagIds +### HasExecutionDateGte -`func (o *ListDagRunsForm) HasDagIds() bool` +`func (o *ListDagRunsForm) HasExecutionDateGte() bool` -HasDagIds returns a boolean if a field has been set. +HasExecutionDateGte returns a boolean if a field has been set. -### GetStates +### GetExecutionDateLte -`func (o *ListDagRunsForm) GetStates() []string` +`func (o *ListDagRunsForm) GetExecutionDateLte() time.Time` -GetStates returns the States field if non-nil, zero value otherwise. +GetExecutionDateLte returns the ExecutionDateLte field if non-nil, zero value otherwise. -### GetStatesOk +### GetExecutionDateLteOk -`func (o *ListDagRunsForm) GetStatesOk() (*[]string, bool)` +`func (o *ListDagRunsForm) GetExecutionDateLteOk() (*time.Time, bool)` -GetStatesOk returns a tuple with the States field if it's non-nil, zero value otherwise +GetExecutionDateLteOk returns a tuple with the ExecutionDateLte field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetStates +### SetExecutionDateLte -`func (o *ListDagRunsForm) SetStates(v []string)` +`func (o *ListDagRunsForm) SetExecutionDateLte(v time.Time)` -SetStates sets States field to given value. +SetExecutionDateLte sets ExecutionDateLte field to given value. -### HasStates +### HasExecutionDateLte -`func (o *ListDagRunsForm) HasStates() bool` +`func (o *ListDagRunsForm) HasExecutionDateLte() bool` -HasStates returns a boolean if a field has been set. +HasExecutionDateLte returns a boolean if a field has been set. -### GetExecutionDateGte +### GetOrderBy -`func (o *ListDagRunsForm) GetExecutionDateGte() time.Time` +`func (o *ListDagRunsForm) GetOrderBy() string` -GetExecutionDateGte returns the ExecutionDateGte field if non-nil, zero value otherwise. +GetOrderBy returns the OrderBy field if non-nil, zero value otherwise. -### GetExecutionDateGteOk +### GetOrderByOk -`func (o *ListDagRunsForm) GetExecutionDateGteOk() (*time.Time, bool)` +`func (o *ListDagRunsForm) GetOrderByOk() (*string, bool)` -GetExecutionDateGteOk returns a tuple with the ExecutionDateGte field if it's non-nil, zero value otherwise +GetOrderByOk returns a tuple with the OrderBy field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetExecutionDateGte +### SetOrderBy -`func (o *ListDagRunsForm) SetExecutionDateGte(v time.Time)` +`func (o *ListDagRunsForm) SetOrderBy(v string)` -SetExecutionDateGte sets ExecutionDateGte field to given value. +SetOrderBy sets OrderBy field to given value. -### HasExecutionDateGte +### HasOrderBy -`func (o *ListDagRunsForm) HasExecutionDateGte() bool` +`func (o *ListDagRunsForm) HasOrderBy() bool` -HasExecutionDateGte returns a boolean if a field has been set. +HasOrderBy returns a boolean if a field has been set. -### GetExecutionDateLte +### GetPageLimit -`func (o *ListDagRunsForm) GetExecutionDateLte() time.Time` +`func (o *ListDagRunsForm) GetPageLimit() int32` -GetExecutionDateLte returns the ExecutionDateLte field if non-nil, zero value otherwise. +GetPageLimit returns the PageLimit field if non-nil, zero value otherwise. -### GetExecutionDateLteOk +### GetPageLimitOk -`func (o *ListDagRunsForm) GetExecutionDateLteOk() (*time.Time, bool)` +`func (o *ListDagRunsForm) GetPageLimitOk() (*int32, bool)` -GetExecutionDateLteOk returns a tuple with the ExecutionDateLte field if it's non-nil, zero value otherwise +GetPageLimitOk returns a tuple with the PageLimit field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetExecutionDateLte +### SetPageLimit -`func (o *ListDagRunsForm) SetExecutionDateLte(v time.Time)` +`func (o *ListDagRunsForm) SetPageLimit(v int32)` -SetExecutionDateLte sets ExecutionDateLte field to given value. +SetPageLimit sets PageLimit field to given value. -### HasExecutionDateLte +### HasPageLimit -`func (o *ListDagRunsForm) HasExecutionDateLte() bool` +`func (o *ListDagRunsForm) HasPageLimit() bool` -HasExecutionDateLte returns a boolean if a field has been set. +HasPageLimit returns a boolean if a field has been set. + +### GetPageOffset + +`func (o *ListDagRunsForm) GetPageOffset() int32` + +GetPageOffset returns the PageOffset field if non-nil, zero value otherwise. + +### GetPageOffsetOk + +`func (o *ListDagRunsForm) GetPageOffsetOk() (*int32, bool)` + +GetPageOffsetOk returns a tuple with the PageOffset field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPageOffset + +`func (o *ListDagRunsForm) SetPageOffset(v int32)` + +SetPageOffset sets PageOffset field to given value. + +### HasPageOffset + +`func (o *ListDagRunsForm) HasPageOffset() bool` + +HasPageOffset returns a boolean if a field has been set. ### GetStartDateGte @@ -279,55 +285,30 @@ SetStartDateLte sets StartDateLte field to given value. HasStartDateLte returns a boolean if a field has been set. -### GetEndDateGte - -`func (o *ListDagRunsForm) GetEndDateGte() time.Time` - -GetEndDateGte returns the EndDateGte field if non-nil, zero value otherwise. - -### GetEndDateGteOk - -`func (o *ListDagRunsForm) GetEndDateGteOk() (*time.Time, bool)` - -GetEndDateGteOk returns a tuple with the EndDateGte field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetEndDateGte - -`func (o *ListDagRunsForm) SetEndDateGte(v time.Time)` - -SetEndDateGte sets EndDateGte field to given value. - -### HasEndDateGte - -`func (o *ListDagRunsForm) HasEndDateGte() bool` - -HasEndDateGte returns a boolean if a field has been set. - -### GetEndDateLte +### GetStates -`func (o *ListDagRunsForm) GetEndDateLte() time.Time` +`func (o *ListDagRunsForm) GetStates() []string` -GetEndDateLte returns the EndDateLte field if non-nil, zero value otherwise. +GetStates returns the States field if non-nil, zero value otherwise. -### GetEndDateLteOk +### GetStatesOk -`func (o *ListDagRunsForm) GetEndDateLteOk() (*time.Time, bool)` +`func (o *ListDagRunsForm) GetStatesOk() (*[]string, bool)` -GetEndDateLteOk returns a tuple with the EndDateLte field if it's non-nil, zero value otherwise +GetStatesOk returns a tuple with the States field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetEndDateLte +### SetStates -`func (o *ListDagRunsForm) SetEndDateLte(v time.Time)` +`func (o *ListDagRunsForm) SetStates(v []string)` -SetEndDateLte sets EndDateLte field to given value. +SetStates sets States field to given value. -### HasEndDateLte +### HasStates -`func (o *ListDagRunsForm) HasEndDateLte() bool` +`func (o *ListDagRunsForm) HasStates() bool` -HasEndDateLte returns a boolean if a field has been set. +HasStates returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/ListTaskInstanceForm.md b/airflow/docs/ListTaskInstanceForm.md index b63a72d..cbc27fe 100644 --- a/airflow/docs/ListTaskInstanceForm.md +++ b/airflow/docs/ListTaskInstanceForm.md @@ -1,22 +1,3 @@ - - # ListTaskInstanceForm ## Properties @@ -24,17 +5,22 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **DagIds** | Pointer to **[]string** | Return objects with specific DAG IDs. The value can be repeated to retrieve multiple matching values (OR condition). | [optional] +**DagRunIds** | Pointer to **[]string** | Return objects with specific DAG Run IDs. The value can be repeated to retrieve multiple matching values (OR condition). *New in version 2.7.1* | [optional] +**DurationGte** | Pointer to **float32** | Returns objects greater than or equal to the specified values. This can be combined with duration_lte parameter to receive only the selected period. | [optional] +**DurationLte** | Pointer to **float32** | Returns objects less than or equal to the specified values. This can be combined with duration_gte parameter to receive only the selected range. | [optional] +**EndDateGte** | Pointer to **time.Time** | Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. | [optional] +**EndDateLte** | Pointer to **time.Time** | Returns objects less than or equal to the specified date. This can be combined with start_date_gte parameter to receive only the selected period. | [optional] **ExecutionDateGte** | Pointer to **time.Time** | Returns objects greater or equal to the specified date. This can be combined with execution_date_lte parameter to receive only the selected period. | [optional] **ExecutionDateLte** | Pointer to **time.Time** | Returns objects less than or equal to the specified date. This can be combined with execution_date_gte parameter to receive only the selected period. | [optional] +**Executor** | Pointer to **[]string** | The value can be repeated to retrieve multiple matching values (OR condition). | [optional] +**PageLimit** | Pointer to **int32** | The numbers of items to return. | [optional] [default to 100] +**PageOffset** | Pointer to **int32** | The number of items to skip before starting to collect the result set. | [optional] +**Pool** | Pointer to **[]string** | The value can be repeated to retrieve multiple matching values (OR condition). | [optional] +**Queue** | Pointer to **[]string** | The value can be repeated to retrieve multiple matching values (OR condition). | [optional] **StartDateGte** | Pointer to **time.Time** | Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. | [optional] **StartDateLte** | Pointer to **time.Time** | Returns objects less or equal the specified date. This can be combined with start_date_gte parameter to receive only the selected period. | [optional] -**EndDateGte** | Pointer to **time.Time** | Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. | [optional] -**EndDateLte** | Pointer to **time.Time** | Returns objects less than or equal to the specified date. This can be combined with start_date_gte parameter to receive only the selected period. | [optional] -**DurationGte** | Pointer to **float32** | Returns objects greater than or equal to the specified values. This can be combined with duration_lte parameter to receive only the selected period. | [optional] -**DurationLte** | Pointer to **float32** | Returns objects less than or equal to the specified values. This can be combined with duration_gte parameter to receive only the selected range. | [optional] **State** | Pointer to [**[]TaskState**](TaskState.md) | The value can be repeated to retrieve multiple matching values (OR condition). | [optional] -**Pool** | Pointer to **[]string** | The value can be repeated to retrieve multiple matching values (OR condition). | [optional] -**Queue** | Pointer to **[]string** | The value can be repeated to retrieve multiple matching values (OR condition). | [optional] +**TaskIds** | Pointer to **[]string** | Return objects with specific task IDs. The value can be repeated to retrieve multiple matching values (OR condition). *New in version 2.7.1* | [optional] ## Methods @@ -80,105 +66,80 @@ SetDagIds sets DagIds field to given value. HasDagIds returns a boolean if a field has been set. -### GetExecutionDateGte - -`func (o *ListTaskInstanceForm) GetExecutionDateGte() time.Time` - -GetExecutionDateGte returns the ExecutionDateGte field if non-nil, zero value otherwise. - -### GetExecutionDateGteOk - -`func (o *ListTaskInstanceForm) GetExecutionDateGteOk() (*time.Time, bool)` - -GetExecutionDateGteOk returns a tuple with the ExecutionDateGte field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetExecutionDateGte - -`func (o *ListTaskInstanceForm) SetExecutionDateGte(v time.Time)` - -SetExecutionDateGte sets ExecutionDateGte field to given value. - -### HasExecutionDateGte - -`func (o *ListTaskInstanceForm) HasExecutionDateGte() bool` +### GetDagRunIds -HasExecutionDateGte returns a boolean if a field has been set. +`func (o *ListTaskInstanceForm) GetDagRunIds() []string` -### GetExecutionDateLte +GetDagRunIds returns the DagRunIds field if non-nil, zero value otherwise. -`func (o *ListTaskInstanceForm) GetExecutionDateLte() time.Time` +### GetDagRunIdsOk -GetExecutionDateLte returns the ExecutionDateLte field if non-nil, zero value otherwise. - -### GetExecutionDateLteOk - -`func (o *ListTaskInstanceForm) GetExecutionDateLteOk() (*time.Time, bool)` +`func (o *ListTaskInstanceForm) GetDagRunIdsOk() (*[]string, bool)` -GetExecutionDateLteOk returns a tuple with the ExecutionDateLte field if it's non-nil, zero value otherwise +GetDagRunIdsOk returns a tuple with the DagRunIds field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetExecutionDateLte +### SetDagRunIds -`func (o *ListTaskInstanceForm) SetExecutionDateLte(v time.Time)` +`func (o *ListTaskInstanceForm) SetDagRunIds(v []string)` -SetExecutionDateLte sets ExecutionDateLte field to given value. +SetDagRunIds sets DagRunIds field to given value. -### HasExecutionDateLte +### HasDagRunIds -`func (o *ListTaskInstanceForm) HasExecutionDateLte() bool` +`func (o *ListTaskInstanceForm) HasDagRunIds() bool` -HasExecutionDateLte returns a boolean if a field has been set. +HasDagRunIds returns a boolean if a field has been set. -### GetStartDateGte +### GetDurationGte -`func (o *ListTaskInstanceForm) GetStartDateGte() time.Time` +`func (o *ListTaskInstanceForm) GetDurationGte() float32` -GetStartDateGte returns the StartDateGte field if non-nil, zero value otherwise. +GetDurationGte returns the DurationGte field if non-nil, zero value otherwise. -### GetStartDateGteOk +### GetDurationGteOk -`func (o *ListTaskInstanceForm) GetStartDateGteOk() (*time.Time, bool)` +`func (o *ListTaskInstanceForm) GetDurationGteOk() (*float32, bool)` -GetStartDateGteOk returns a tuple with the StartDateGte field if it's non-nil, zero value otherwise +GetDurationGteOk returns a tuple with the DurationGte field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetStartDateGte +### SetDurationGte -`func (o *ListTaskInstanceForm) SetStartDateGte(v time.Time)` +`func (o *ListTaskInstanceForm) SetDurationGte(v float32)` -SetStartDateGte sets StartDateGte field to given value. +SetDurationGte sets DurationGte field to given value. -### HasStartDateGte +### HasDurationGte -`func (o *ListTaskInstanceForm) HasStartDateGte() bool` +`func (o *ListTaskInstanceForm) HasDurationGte() bool` -HasStartDateGte returns a boolean if a field has been set. +HasDurationGte returns a boolean if a field has been set. -### GetStartDateLte +### GetDurationLte -`func (o *ListTaskInstanceForm) GetStartDateLte() time.Time` +`func (o *ListTaskInstanceForm) GetDurationLte() float32` -GetStartDateLte returns the StartDateLte field if non-nil, zero value otherwise. +GetDurationLte returns the DurationLte field if non-nil, zero value otherwise. -### GetStartDateLteOk +### GetDurationLteOk -`func (o *ListTaskInstanceForm) GetStartDateLteOk() (*time.Time, bool)` +`func (o *ListTaskInstanceForm) GetDurationLteOk() (*float32, bool)` -GetStartDateLteOk returns a tuple with the StartDateLte field if it's non-nil, zero value otherwise +GetDurationLteOk returns a tuple with the DurationLte field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetStartDateLte +### SetDurationLte -`func (o *ListTaskInstanceForm) SetStartDateLte(v time.Time)` +`func (o *ListTaskInstanceForm) SetDurationLte(v float32)` -SetStartDateLte sets StartDateLte field to given value. +SetDurationLte sets DurationLte field to given value. -### HasStartDateLte +### HasDurationLte -`func (o *ListTaskInstanceForm) HasStartDateLte() bool` +`func (o *ListTaskInstanceForm) HasDurationLte() bool` -HasStartDateLte returns a boolean if a field has been set. +HasDurationLte returns a boolean if a field has been set. ### GetEndDateGte @@ -230,80 +191,130 @@ SetEndDateLte sets EndDateLte field to given value. HasEndDateLte returns a boolean if a field has been set. -### GetDurationGte +### GetExecutionDateGte -`func (o *ListTaskInstanceForm) GetDurationGte() float32` +`func (o *ListTaskInstanceForm) GetExecutionDateGte() time.Time` -GetDurationGte returns the DurationGte field if non-nil, zero value otherwise. +GetExecutionDateGte returns the ExecutionDateGte field if non-nil, zero value otherwise. -### GetDurationGteOk +### GetExecutionDateGteOk -`func (o *ListTaskInstanceForm) GetDurationGteOk() (*float32, bool)` +`func (o *ListTaskInstanceForm) GetExecutionDateGteOk() (*time.Time, bool)` -GetDurationGteOk returns a tuple with the DurationGte field if it's non-nil, zero value otherwise +GetExecutionDateGteOk returns a tuple with the ExecutionDateGte field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDurationGte +### SetExecutionDateGte -`func (o *ListTaskInstanceForm) SetDurationGte(v float32)` +`func (o *ListTaskInstanceForm) SetExecutionDateGte(v time.Time)` -SetDurationGte sets DurationGte field to given value. +SetExecutionDateGte sets ExecutionDateGte field to given value. -### HasDurationGte +### HasExecutionDateGte -`func (o *ListTaskInstanceForm) HasDurationGte() bool` +`func (o *ListTaskInstanceForm) HasExecutionDateGte() bool` -HasDurationGte returns a boolean if a field has been set. +HasExecutionDateGte returns a boolean if a field has been set. -### GetDurationLte +### GetExecutionDateLte -`func (o *ListTaskInstanceForm) GetDurationLte() float32` +`func (o *ListTaskInstanceForm) GetExecutionDateLte() time.Time` -GetDurationLte returns the DurationLte field if non-nil, zero value otherwise. +GetExecutionDateLte returns the ExecutionDateLte field if non-nil, zero value otherwise. -### GetDurationLteOk +### GetExecutionDateLteOk -`func (o *ListTaskInstanceForm) GetDurationLteOk() (*float32, bool)` +`func (o *ListTaskInstanceForm) GetExecutionDateLteOk() (*time.Time, bool)` -GetDurationLteOk returns a tuple with the DurationLte field if it's non-nil, zero value otherwise +GetExecutionDateLteOk returns a tuple with the ExecutionDateLte field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDurationLte +### SetExecutionDateLte -`func (o *ListTaskInstanceForm) SetDurationLte(v float32)` +`func (o *ListTaskInstanceForm) SetExecutionDateLte(v time.Time)` -SetDurationLte sets DurationLte field to given value. +SetExecutionDateLte sets ExecutionDateLte field to given value. -### HasDurationLte +### HasExecutionDateLte -`func (o *ListTaskInstanceForm) HasDurationLte() bool` +`func (o *ListTaskInstanceForm) HasExecutionDateLte() bool` -HasDurationLte returns a boolean if a field has been set. +HasExecutionDateLte returns a boolean if a field has been set. -### GetState +### GetExecutor -`func (o *ListTaskInstanceForm) GetState() []TaskState` +`func (o *ListTaskInstanceForm) GetExecutor() []string` -GetState returns the State field if non-nil, zero value otherwise. +GetExecutor returns the Executor field if non-nil, zero value otherwise. -### GetStateOk +### GetExecutorOk -`func (o *ListTaskInstanceForm) GetStateOk() (*[]TaskState, bool)` +`func (o *ListTaskInstanceForm) GetExecutorOk() (*[]string, bool)` -GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +GetExecutorOk returns a tuple with the Executor field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetState +### SetExecutor -`func (o *ListTaskInstanceForm) SetState(v []TaskState)` +`func (o *ListTaskInstanceForm) SetExecutor(v []string)` -SetState sets State field to given value. +SetExecutor sets Executor field to given value. -### HasState +### HasExecutor -`func (o *ListTaskInstanceForm) HasState() bool` +`func (o *ListTaskInstanceForm) HasExecutor() bool` -HasState returns a boolean if a field has been set. +HasExecutor returns a boolean if a field has been set. + +### GetPageLimit + +`func (o *ListTaskInstanceForm) GetPageLimit() int32` + +GetPageLimit returns the PageLimit field if non-nil, zero value otherwise. + +### GetPageLimitOk + +`func (o *ListTaskInstanceForm) GetPageLimitOk() (*int32, bool)` + +GetPageLimitOk returns a tuple with the PageLimit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPageLimit + +`func (o *ListTaskInstanceForm) SetPageLimit(v int32)` + +SetPageLimit sets PageLimit field to given value. + +### HasPageLimit + +`func (o *ListTaskInstanceForm) HasPageLimit() bool` + +HasPageLimit returns a boolean if a field has been set. + +### GetPageOffset + +`func (o *ListTaskInstanceForm) GetPageOffset() int32` + +GetPageOffset returns the PageOffset field if non-nil, zero value otherwise. + +### GetPageOffsetOk + +`func (o *ListTaskInstanceForm) GetPageOffsetOk() (*int32, bool)` + +GetPageOffsetOk returns a tuple with the PageOffset field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPageOffset + +`func (o *ListTaskInstanceForm) SetPageOffset(v int32)` + +SetPageOffset sets PageOffset field to given value. + +### HasPageOffset + +`func (o *ListTaskInstanceForm) HasPageOffset() bool` + +HasPageOffset returns a boolean if a field has been set. ### GetPool @@ -355,6 +366,106 @@ SetQueue sets Queue field to given value. HasQueue returns a boolean if a field has been set. +### GetStartDateGte + +`func (o *ListTaskInstanceForm) GetStartDateGte() time.Time` + +GetStartDateGte returns the StartDateGte field if non-nil, zero value otherwise. + +### GetStartDateGteOk + +`func (o *ListTaskInstanceForm) GetStartDateGteOk() (*time.Time, bool)` + +GetStartDateGteOk returns a tuple with the StartDateGte field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartDateGte + +`func (o *ListTaskInstanceForm) SetStartDateGte(v time.Time)` + +SetStartDateGte sets StartDateGte field to given value. + +### HasStartDateGte + +`func (o *ListTaskInstanceForm) HasStartDateGte() bool` + +HasStartDateGte returns a boolean if a field has been set. + +### GetStartDateLte + +`func (o *ListTaskInstanceForm) GetStartDateLte() time.Time` + +GetStartDateLte returns the StartDateLte field if non-nil, zero value otherwise. + +### GetStartDateLteOk + +`func (o *ListTaskInstanceForm) GetStartDateLteOk() (*time.Time, bool)` + +GetStartDateLteOk returns a tuple with the StartDateLte field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartDateLte + +`func (o *ListTaskInstanceForm) SetStartDateLte(v time.Time)` + +SetStartDateLte sets StartDateLte field to given value. + +### HasStartDateLte + +`func (o *ListTaskInstanceForm) HasStartDateLte() bool` + +HasStartDateLte returns a boolean if a field has been set. + +### GetState + +`func (o *ListTaskInstanceForm) GetState() []TaskState` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *ListTaskInstanceForm) GetStateOk() (*[]TaskState, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *ListTaskInstanceForm) SetState(v []TaskState)` + +SetState sets State field to given value. + +### HasState + +`func (o *ListTaskInstanceForm) HasState() bool` + +HasState returns a boolean if a field has been set. + +### GetTaskIds + +`func (o *ListTaskInstanceForm) GetTaskIds() []string` + +GetTaskIds returns the TaskIds field if non-nil, zero value otherwise. + +### GetTaskIdsOk + +`func (o *ListTaskInstanceForm) GetTaskIdsOk() (*[]string, bool)` + +GetTaskIdsOk returns a tuple with the TaskIds field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTaskIds + +`func (o *ListTaskInstanceForm) SetTaskIds(v []string)` + +SetTaskIds sets TaskIds field to given value. + +### HasTaskIds + +`func (o *ListTaskInstanceForm) HasTaskIds() bool` + +HasTaskIds returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/MetadatabaseStatus.md b/airflow/docs/MetadatabaseStatus.md index 4355812..ea629c4 100644 --- a/airflow/docs/MetadatabaseStatus.md +++ b/airflow/docs/MetadatabaseStatus.md @@ -1,29 +1,10 @@ - - # MetadatabaseStatus ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Status** | Pointer to [**HealthStatus**](HealthStatus.md) | | [optional] +**Status** | Pointer to [**NullableHealthStatus**](HealthStatus.md) | | [optional] ## Methods @@ -69,6 +50,16 @@ SetStatus sets Status field to given value. HasStatus returns a boolean if a field has been set. +### SetStatusNil + +`func (o *MetadatabaseStatus) SetStatusNil(b bool)` + + SetStatusNil sets the value for Status to be an explicit nil + +### UnsetStatus +`func (o *MetadatabaseStatus) UnsetStatus()` + +UnsetStatus ensures that no value is present for Status, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/MonitoringApi.md b/airflow/docs/MonitoringApi.md index c75d8b7..d2fa728 100644 --- a/airflow/docs/MonitoringApi.md +++ b/airflow/docs/MonitoringApi.md @@ -1,30 +1,11 @@ - - -# \MonitoringApi - -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**GetHealth**](MonitoringApi.md#GetHealth) | **Get** /health | Get instance status -[**GetVersion**](MonitoringApi.md#GetVersion) | **Get** /version | Get version information +[**GetHealth**](MonitoringAPI.md#GetHealth) | **Get** /health | Get instance status +[**GetVersion**](MonitoringAPI.md#GetVersion) | **Get** /version | Get version information @@ -42,23 +23,23 @@ Get instance status package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.MonitoringApi.GetHealth(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `MonitoringApi.GetHealth``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetHealth`: HealthInfo - fmt.Fprintf(os.Stdout, "Response from `MonitoringApi.GetHealth`: %v\n", resp) + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.MonitoringAPI.GetHealth(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MonitoringAPI.GetHealth``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetHealth`: HealthInfo + fmt.Fprintf(os.Stdout, "Response from `MonitoringAPI.GetHealth`: %v\n", resp) } ``` @@ -77,7 +58,7 @@ Other parameters are passed through a pointer to a apiGetHealthRequest struct vi ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -101,23 +82,23 @@ Get version information package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.MonitoringApi.GetVersion(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `MonitoringApi.GetVersion``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetVersion`: VersionInfo - fmt.Fprintf(os.Stdout, "Response from `MonitoringApi.GetVersion`: %v\n", resp) + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.MonitoringAPI.GetVersion(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MonitoringAPI.GetVersion``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetVersion`: VersionInfo + fmt.Fprintf(os.Stdout, "Response from `MonitoringAPI.GetVersion`: %v\n", resp) } ``` @@ -136,7 +117,7 @@ Other parameters are passed through a pointer to a apiGetVersionRequest struct v ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers diff --git a/airflow/docs/PermissionApi.md b/airflow/docs/PermissionApi.md index ac96cce..cd8ab27 100644 --- a/airflow/docs/PermissionApi.md +++ b/airflow/docs/PermissionApi.md @@ -1,29 +1,10 @@ - - -# \PermissionApi - -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**GetPermissions**](PermissionApi.md#GetPermissions) | **Get** /permissions | List permissions +[**GetPermissions**](PermissionAPI.md#GetPermissions) | **Get** /permissions | List permissions @@ -41,25 +22,25 @@ List permissions package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) - offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PermissionApi.GetPermissions(context.Background()).Limit(limit).Offset(offset).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PermissionApi.GetPermissions``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetPermissions`: ActionCollection - fmt.Fprintf(os.Stdout, "Response from `PermissionApi.GetPermissions`: %v\n", resp) + limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) + offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PermissionAPI.GetPermissions(context.Background()).Limit(limit).Offset(offset).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PermissionAPI.GetPermissions``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetPermissions`: ActionCollection + fmt.Fprintf(os.Stdout, "Response from `PermissionAPI.GetPermissions`: %v\n", resp) } ``` @@ -83,7 +64,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers diff --git a/airflow/docs/PluginApi.md b/airflow/docs/PluginApi.md index 3e6bacb..ad34685 100644 --- a/airflow/docs/PluginApi.md +++ b/airflow/docs/PluginApi.md @@ -1,29 +1,10 @@ - - -# \PluginApi - -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**GetPlugins**](PluginApi.md#GetPlugins) | **Get** /plugins | Get a list of loaded plugins +[**GetPlugins**](PluginAPI.md#GetPlugins) | **Get** /plugins | Get a list of loaded plugins @@ -41,25 +22,25 @@ Get a list of loaded plugins package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) - offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PluginApi.GetPlugins(context.Background()).Limit(limit).Offset(offset).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PluginApi.GetPlugins``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetPlugins`: PluginCollection - fmt.Fprintf(os.Stdout, "Response from `PluginApi.GetPlugins`: %v\n", resp) + limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) + offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PluginAPI.GetPlugins(context.Background()).Limit(limit).Offset(offset).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PluginAPI.GetPlugins``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetPlugins`: PluginCollection + fmt.Fprintf(os.Stdout, "Response from `PluginAPI.GetPlugins`: %v\n", resp) } ``` @@ -83,7 +64,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers diff --git a/airflow/docs/PluginCollection.md b/airflow/docs/PluginCollection.md index 22209e1..9036e23 100644 --- a/airflow/docs/PluginCollection.md +++ b/airflow/docs/PluginCollection.md @@ -1,30 +1,11 @@ - - # PluginCollection ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] **Plugins** | Pointer to [**[]PluginCollectionItem**](PluginCollectionItem.md) | | [optional] -**TotalEntries** | Pointer to **int32** | Count of objects in the current result set. | [optional] ## Methods @@ -45,55 +26,55 @@ NewPluginCollectionWithDefaults instantiates a new PluginCollection object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetPlugins +### GetTotalEntries -`func (o *PluginCollection) GetPlugins() []PluginCollectionItem` +`func (o *PluginCollection) GetTotalEntries() int32` -GetPlugins returns the Plugins field if non-nil, zero value otherwise. +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. -### GetPluginsOk +### GetTotalEntriesOk -`func (o *PluginCollection) GetPluginsOk() (*[]PluginCollectionItem, bool)` +`func (o *PluginCollection) GetTotalEntriesOk() (*int32, bool)` -GetPluginsOk returns a tuple with the Plugins field if it's non-nil, zero value otherwise +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetPlugins +### SetTotalEntries -`func (o *PluginCollection) SetPlugins(v []PluginCollectionItem)` +`func (o *PluginCollection) SetTotalEntries(v int32)` -SetPlugins sets Plugins field to given value. +SetTotalEntries sets TotalEntries field to given value. -### HasPlugins +### HasTotalEntries -`func (o *PluginCollection) HasPlugins() bool` +`func (o *PluginCollection) HasTotalEntries() bool` -HasPlugins returns a boolean if a field has been set. +HasTotalEntries returns a boolean if a field has been set. -### GetTotalEntries +### GetPlugins -`func (o *PluginCollection) GetTotalEntries() int32` +`func (o *PluginCollection) GetPlugins() []PluginCollectionItem` -GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. +GetPlugins returns the Plugins field if non-nil, zero value otherwise. -### GetTotalEntriesOk +### GetPluginsOk -`func (o *PluginCollection) GetTotalEntriesOk() (*int32, bool)` +`func (o *PluginCollection) GetPluginsOk() (*[]PluginCollectionItem, bool)` -GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +GetPluginsOk returns a tuple with the Plugins field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTotalEntries +### SetPlugins -`func (o *PluginCollection) SetTotalEntries(v int32)` +`func (o *PluginCollection) SetPlugins(v []PluginCollectionItem)` -SetTotalEntries sets TotalEntries field to given value. +SetPlugins sets Plugins field to given value. -### HasTotalEntries +### HasPlugins -`func (o *PluginCollection) HasTotalEntries() bool` +`func (o *PluginCollection) HasPlugins() bool` -HasTotalEntries returns a boolean if a field has been set. +HasPlugins returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/PluginCollectionItem.md b/airflow/docs/PluginCollectionItem.md index 82cd1b2..af0316d 100644 --- a/airflow/docs/PluginCollectionItem.md +++ b/airflow/docs/PluginCollectionItem.md @@ -1,38 +1,22 @@ - - # PluginCollectionItem ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | The name of the plugin | [optional] -**Hooks** | Pointer to **[]string** | The plugin hooks | [optional] -**Executors** | Pointer to **[]string** | The plugin executors | [optional] -**Macros** | Pointer to **[]map[string]interface{}** | The plugin macros | [optional] -**FlaskBlueprints** | Pointer to **[]map[string]interface{}** | The flask blueprints | [optional] -**AppbuilderViews** | Pointer to **[]map[string]interface{}** | The appuilder views | [optional] **AppbuilderMenuItems** | Pointer to **[]map[string]interface{}** | The Flask Appbuilder menu items | [optional] -**GlobalOperatorExtraLinks** | Pointer to **[]map[string]interface{}** | The global operator extra links | [optional] -**OperatorExtraLinks** | Pointer to **[]map[string]interface{}** | Operator extra links | [optional] +**AppbuilderViews** | Pointer to **[]map[string]interface{}** | The appuilder views | [optional] +**Executors** | Pointer to **[]string** | The plugin executors | [optional] +**FlaskBlueprints** | Pointer to **[]string** | The flask blueprints | [optional] +**GlobalOperatorExtraLinks** | Pointer to **[]string** | The global operator extra links | [optional] +**Hooks** | Pointer to **[]string** | The plugin hooks | [optional] +**Listeners** | Pointer to **[]string** | The plugin listeners | [optional] +**Macros** | Pointer to **[]string** | The plugin macros | [optional] +**Name** | Pointer to **string** | The name of the plugin | [optional] +**OperatorExtraLinks** | Pointer to **[]string** | Operator extra links | [optional] **Source** | Pointer to **NullableString** | The plugin source | [optional] +**TiDeps** | Pointer to **[]string** | The plugin task instance dependencies | [optional] +**Timetables** | Pointer to **[]string** | The plugin timetables | [optional] ## Methods @@ -53,55 +37,55 @@ NewPluginCollectionItemWithDefaults instantiates a new PluginCollectionItem obje This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetName +### GetAppbuilderMenuItems -`func (o *PluginCollectionItem) GetName() string` +`func (o *PluginCollectionItem) GetAppbuilderMenuItems() []*map[string]interface{}` -GetName returns the Name field if non-nil, zero value otherwise. +GetAppbuilderMenuItems returns the AppbuilderMenuItems field if non-nil, zero value otherwise. -### GetNameOk +### GetAppbuilderMenuItemsOk -`func (o *PluginCollectionItem) GetNameOk() (*string, bool)` +`func (o *PluginCollectionItem) GetAppbuilderMenuItemsOk() (*[]*map[string]interface{}, bool)` -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +GetAppbuilderMenuItemsOk returns a tuple with the AppbuilderMenuItems field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetName +### SetAppbuilderMenuItems -`func (o *PluginCollectionItem) SetName(v string)` +`func (o *PluginCollectionItem) SetAppbuilderMenuItems(v []*map[string]interface{})` -SetName sets Name field to given value. +SetAppbuilderMenuItems sets AppbuilderMenuItems field to given value. -### HasName +### HasAppbuilderMenuItems -`func (o *PluginCollectionItem) HasName() bool` +`func (o *PluginCollectionItem) HasAppbuilderMenuItems() bool` -HasName returns a boolean if a field has been set. +HasAppbuilderMenuItems returns a boolean if a field has been set. -### GetHooks +### GetAppbuilderViews -`func (o *PluginCollectionItem) GetHooks() []*string` +`func (o *PluginCollectionItem) GetAppbuilderViews() []*map[string]interface{}` -GetHooks returns the Hooks field if non-nil, zero value otherwise. +GetAppbuilderViews returns the AppbuilderViews field if non-nil, zero value otherwise. -### GetHooksOk +### GetAppbuilderViewsOk -`func (o *PluginCollectionItem) GetHooksOk() (*[]*string, bool)` +`func (o *PluginCollectionItem) GetAppbuilderViewsOk() (*[]*map[string]interface{}, bool)` -GetHooksOk returns a tuple with the Hooks field if it's non-nil, zero value otherwise +GetAppbuilderViewsOk returns a tuple with the AppbuilderViews field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetHooks +### SetAppbuilderViews -`func (o *PluginCollectionItem) SetHooks(v []*string)` +`func (o *PluginCollectionItem) SetAppbuilderViews(v []*map[string]interface{})` -SetHooks sets Hooks field to given value. +SetAppbuilderViews sets AppbuilderViews field to given value. -### HasHooks +### HasAppbuilderViews -`func (o *PluginCollectionItem) HasHooks() bool` +`func (o *PluginCollectionItem) HasAppbuilderViews() bool` -HasHooks returns a boolean if a field has been set. +HasAppbuilderViews returns a boolean if a field has been set. ### GetExecutors @@ -128,147 +112,172 @@ SetExecutors sets Executors field to given value. HasExecutors returns a boolean if a field has been set. -### GetMacros +### GetFlaskBlueprints -`func (o *PluginCollectionItem) GetMacros() []*map[string]interface{}` +`func (o *PluginCollectionItem) GetFlaskBlueprints() []*string` -GetMacros returns the Macros field if non-nil, zero value otherwise. +GetFlaskBlueprints returns the FlaskBlueprints field if non-nil, zero value otherwise. -### GetMacrosOk +### GetFlaskBlueprintsOk -`func (o *PluginCollectionItem) GetMacrosOk() (*[]*map[string]interface{}, bool)` +`func (o *PluginCollectionItem) GetFlaskBlueprintsOk() (*[]*string, bool)` -GetMacrosOk returns a tuple with the Macros field if it's non-nil, zero value otherwise +GetFlaskBlueprintsOk returns a tuple with the FlaskBlueprints field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetMacros +### SetFlaskBlueprints -`func (o *PluginCollectionItem) SetMacros(v []*map[string]interface{})` +`func (o *PluginCollectionItem) SetFlaskBlueprints(v []*string)` -SetMacros sets Macros field to given value. +SetFlaskBlueprints sets FlaskBlueprints field to given value. -### HasMacros +### HasFlaskBlueprints -`func (o *PluginCollectionItem) HasMacros() bool` +`func (o *PluginCollectionItem) HasFlaskBlueprints() bool` -HasMacros returns a boolean if a field has been set. +HasFlaskBlueprints returns a boolean if a field has been set. -### GetFlaskBlueprints +### GetGlobalOperatorExtraLinks -`func (o *PluginCollectionItem) GetFlaskBlueprints() []*map[string]interface{}` +`func (o *PluginCollectionItem) GetGlobalOperatorExtraLinks() []*string` -GetFlaskBlueprints returns the FlaskBlueprints field if non-nil, zero value otherwise. +GetGlobalOperatorExtraLinks returns the GlobalOperatorExtraLinks field if non-nil, zero value otherwise. -### GetFlaskBlueprintsOk +### GetGlobalOperatorExtraLinksOk -`func (o *PluginCollectionItem) GetFlaskBlueprintsOk() (*[]*map[string]interface{}, bool)` +`func (o *PluginCollectionItem) GetGlobalOperatorExtraLinksOk() (*[]*string, bool)` -GetFlaskBlueprintsOk returns a tuple with the FlaskBlueprints field if it's non-nil, zero value otherwise +GetGlobalOperatorExtraLinksOk returns a tuple with the GlobalOperatorExtraLinks field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetFlaskBlueprints +### SetGlobalOperatorExtraLinks -`func (o *PluginCollectionItem) SetFlaskBlueprints(v []*map[string]interface{})` +`func (o *PluginCollectionItem) SetGlobalOperatorExtraLinks(v []*string)` -SetFlaskBlueprints sets FlaskBlueprints field to given value. +SetGlobalOperatorExtraLinks sets GlobalOperatorExtraLinks field to given value. -### HasFlaskBlueprints +### HasGlobalOperatorExtraLinks -`func (o *PluginCollectionItem) HasFlaskBlueprints() bool` +`func (o *PluginCollectionItem) HasGlobalOperatorExtraLinks() bool` -HasFlaskBlueprints returns a boolean if a field has been set. +HasGlobalOperatorExtraLinks returns a boolean if a field has been set. -### GetAppbuilderViews +### GetHooks -`func (o *PluginCollectionItem) GetAppbuilderViews() []*map[string]interface{}` +`func (o *PluginCollectionItem) GetHooks() []*string` -GetAppbuilderViews returns the AppbuilderViews field if non-nil, zero value otherwise. +GetHooks returns the Hooks field if non-nil, zero value otherwise. -### GetAppbuilderViewsOk +### GetHooksOk -`func (o *PluginCollectionItem) GetAppbuilderViewsOk() (*[]*map[string]interface{}, bool)` +`func (o *PluginCollectionItem) GetHooksOk() (*[]*string, bool)` -GetAppbuilderViewsOk returns a tuple with the AppbuilderViews field if it's non-nil, zero value otherwise +GetHooksOk returns a tuple with the Hooks field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetAppbuilderViews +### SetHooks -`func (o *PluginCollectionItem) SetAppbuilderViews(v []*map[string]interface{})` +`func (o *PluginCollectionItem) SetHooks(v []*string)` -SetAppbuilderViews sets AppbuilderViews field to given value. +SetHooks sets Hooks field to given value. -### HasAppbuilderViews +### HasHooks -`func (o *PluginCollectionItem) HasAppbuilderViews() bool` +`func (o *PluginCollectionItem) HasHooks() bool` -HasAppbuilderViews returns a boolean if a field has been set. +HasHooks returns a boolean if a field has been set. -### GetAppbuilderMenuItems +### GetListeners -`func (o *PluginCollectionItem) GetAppbuilderMenuItems() []*map[string]interface{}` +`func (o *PluginCollectionItem) GetListeners() []string` -GetAppbuilderMenuItems returns the AppbuilderMenuItems field if non-nil, zero value otherwise. +GetListeners returns the Listeners field if non-nil, zero value otherwise. -### GetAppbuilderMenuItemsOk +### GetListenersOk -`func (o *PluginCollectionItem) GetAppbuilderMenuItemsOk() (*[]*map[string]interface{}, bool)` +`func (o *PluginCollectionItem) GetListenersOk() (*[]string, bool)` -GetAppbuilderMenuItemsOk returns a tuple with the AppbuilderMenuItems field if it's non-nil, zero value otherwise +GetListenersOk returns a tuple with the Listeners field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetAppbuilderMenuItems +### SetListeners -`func (o *PluginCollectionItem) SetAppbuilderMenuItems(v []*map[string]interface{})` +`func (o *PluginCollectionItem) SetListeners(v []string)` -SetAppbuilderMenuItems sets AppbuilderMenuItems field to given value. +SetListeners sets Listeners field to given value. -### HasAppbuilderMenuItems +### HasListeners -`func (o *PluginCollectionItem) HasAppbuilderMenuItems() bool` +`func (o *PluginCollectionItem) HasListeners() bool` -HasAppbuilderMenuItems returns a boolean if a field has been set. +HasListeners returns a boolean if a field has been set. -### GetGlobalOperatorExtraLinks +### GetMacros -`func (o *PluginCollectionItem) GetGlobalOperatorExtraLinks() []*map[string]interface{}` +`func (o *PluginCollectionItem) GetMacros() []*string` -GetGlobalOperatorExtraLinks returns the GlobalOperatorExtraLinks field if non-nil, zero value otherwise. +GetMacros returns the Macros field if non-nil, zero value otherwise. -### GetGlobalOperatorExtraLinksOk +### GetMacrosOk -`func (o *PluginCollectionItem) GetGlobalOperatorExtraLinksOk() (*[]*map[string]interface{}, bool)` +`func (o *PluginCollectionItem) GetMacrosOk() (*[]*string, bool)` -GetGlobalOperatorExtraLinksOk returns a tuple with the GlobalOperatorExtraLinks field if it's non-nil, zero value otherwise +GetMacrosOk returns a tuple with the Macros field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetGlobalOperatorExtraLinks +### SetMacros -`func (o *PluginCollectionItem) SetGlobalOperatorExtraLinks(v []*map[string]interface{})` +`func (o *PluginCollectionItem) SetMacros(v []*string)` -SetGlobalOperatorExtraLinks sets GlobalOperatorExtraLinks field to given value. +SetMacros sets Macros field to given value. -### HasGlobalOperatorExtraLinks +### HasMacros -`func (o *PluginCollectionItem) HasGlobalOperatorExtraLinks() bool` +`func (o *PluginCollectionItem) HasMacros() bool` -HasGlobalOperatorExtraLinks returns a boolean if a field has been set. +HasMacros returns a boolean if a field has been set. + +### GetName + +`func (o *PluginCollectionItem) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *PluginCollectionItem) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *PluginCollectionItem) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *PluginCollectionItem) HasName() bool` + +HasName returns a boolean if a field has been set. ### GetOperatorExtraLinks -`func (o *PluginCollectionItem) GetOperatorExtraLinks() []*map[string]interface{}` +`func (o *PluginCollectionItem) GetOperatorExtraLinks() []*string` GetOperatorExtraLinks returns the OperatorExtraLinks field if non-nil, zero value otherwise. ### GetOperatorExtraLinksOk -`func (o *PluginCollectionItem) GetOperatorExtraLinksOk() (*[]*map[string]interface{}, bool)` +`func (o *PluginCollectionItem) GetOperatorExtraLinksOk() (*[]*string, bool)` GetOperatorExtraLinksOk returns a tuple with the OperatorExtraLinks field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetOperatorExtraLinks -`func (o *PluginCollectionItem) SetOperatorExtraLinks(v []*map[string]interface{})` +`func (o *PluginCollectionItem) SetOperatorExtraLinks(v []*string)` SetOperatorExtraLinks sets OperatorExtraLinks field to given value. @@ -313,6 +322,56 @@ HasSource returns a boolean if a field has been set. `func (o *PluginCollectionItem) UnsetSource()` UnsetSource ensures that no value is present for Source, not even an explicit nil +### GetTiDeps + +`func (o *PluginCollectionItem) GetTiDeps() []string` + +GetTiDeps returns the TiDeps field if non-nil, zero value otherwise. + +### GetTiDepsOk + +`func (o *PluginCollectionItem) GetTiDepsOk() (*[]string, bool)` + +GetTiDepsOk returns a tuple with the TiDeps field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTiDeps + +`func (o *PluginCollectionItem) SetTiDeps(v []string)` + +SetTiDeps sets TiDeps field to given value. + +### HasTiDeps + +`func (o *PluginCollectionItem) HasTiDeps() bool` + +HasTiDeps returns a boolean if a field has been set. + +### GetTimetables + +`func (o *PluginCollectionItem) GetTimetables() []string` + +GetTimetables returns the Timetables field if non-nil, zero value otherwise. + +### GetTimetablesOk + +`func (o *PluginCollectionItem) GetTimetablesOk() (*[]string, bool)` + +GetTimetablesOk returns a tuple with the Timetables field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimetables + +`func (o *PluginCollectionItem) SetTimetables(v []string)` + +SetTimetables sets Timetables field to given value. + +### HasTimetables + +`func (o *PluginCollectionItem) HasTimetables() bool` + +HasTimetables returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/Pool.md b/airflow/docs/Pool.md index 3296a85..031dd94 100644 --- a/airflow/docs/Pool.md +++ b/airflow/docs/Pool.md @@ -1,35 +1,19 @@ - - # Pool ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**DeferredSlots** | Pointer to **int32** | The number of slots used by deferred tasks at the moment. Relevant if 'include_deferred' is set to true. *New in version 2.7.0* | [optional] [readonly] +**Description** | Pointer to **NullableString** | The description of the pool. *New in version 2.3.0* | [optional] +**IncludeDeferred** | Pointer to **bool** | If set to true, deferred tasks are considered when calculating open pool slots. *New in version 2.7.0* | [optional] **Name** | Pointer to **string** | The name of pool. | [optional] -**Slots** | Pointer to **int32** | The maximum number of slots that can be assigned to tasks. One job may occupy one or more slots. | [optional] -**OccupiedSlots** | Pointer to **int32** | The number of slots used by running/queued tasks at the moment. | [optional] [readonly] -**UsedSlots** | Pointer to **int32** | The number of slots used by running tasks at the moment. | [optional] [readonly] -**QueuedSlots** | Pointer to **int32** | The number of slots used by queued tasks at the moment. | [optional] [readonly] +**OccupiedSlots** | Pointer to **int32** | The number of slots used by running/queued tasks at the moment. May include deferred tasks if 'include_deferred' is set to true. | [optional] [readonly] **OpenSlots** | Pointer to **int32** | The number of free slots at the moment. | [optional] [readonly] -**Description** | Pointer to **NullableString** | The description of the pool. *New in version 2.3.0* | [optional] +**QueuedSlots** | Pointer to **int32** | The number of slots used by queued tasks at the moment. | [optional] [readonly] +**RunningSlots** | Pointer to **int32** | The number of slots used by running tasks at the moment. | [optional] [readonly] +**ScheduledSlots** | Pointer to **int32** | The number of slots used by scheduled tasks at the moment. | [optional] [readonly] +**Slots** | Pointer to **int32** | The maximum number of slots that can be assigned to tasks. One job may occupy one or more slots. | [optional] ## Methods @@ -50,55 +34,115 @@ NewPoolWithDefaults instantiates a new Pool object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetName +### GetDeferredSlots -`func (o *Pool) GetName() string` +`func (o *Pool) GetDeferredSlots() int32` -GetName returns the Name field if non-nil, zero value otherwise. +GetDeferredSlots returns the DeferredSlots field if non-nil, zero value otherwise. -### GetNameOk +### GetDeferredSlotsOk -`func (o *Pool) GetNameOk() (*string, bool)` +`func (o *Pool) GetDeferredSlotsOk() (*int32, bool)` -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +GetDeferredSlotsOk returns a tuple with the DeferredSlots field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetName +### SetDeferredSlots -`func (o *Pool) SetName(v string)` +`func (o *Pool) SetDeferredSlots(v int32)` -SetName sets Name field to given value. +SetDeferredSlots sets DeferredSlots field to given value. -### HasName +### HasDeferredSlots -`func (o *Pool) HasName() bool` +`func (o *Pool) HasDeferredSlots() bool` -HasName returns a boolean if a field has been set. +HasDeferredSlots returns a boolean if a field has been set. -### GetSlots +### GetDescription -`func (o *Pool) GetSlots() int32` +`func (o *Pool) GetDescription() string` -GetSlots returns the Slots field if non-nil, zero value otherwise. +GetDescription returns the Description field if non-nil, zero value otherwise. -### GetSlotsOk +### GetDescriptionOk -`func (o *Pool) GetSlotsOk() (*int32, bool)` +`func (o *Pool) GetDescriptionOk() (*string, bool)` -GetSlotsOk returns a tuple with the Slots field if it's non-nil, zero value otherwise +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetSlots +### SetDescription -`func (o *Pool) SetSlots(v int32)` +`func (o *Pool) SetDescription(v string)` -SetSlots sets Slots field to given value. +SetDescription sets Description field to given value. -### HasSlots +### HasDescription -`func (o *Pool) HasSlots() bool` +`func (o *Pool) HasDescription() bool` -HasSlots returns a boolean if a field has been set. +HasDescription returns a boolean if a field has been set. + +### SetDescriptionNil + +`func (o *Pool) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *Pool) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil +### GetIncludeDeferred + +`func (o *Pool) GetIncludeDeferred() bool` + +GetIncludeDeferred returns the IncludeDeferred field if non-nil, zero value otherwise. + +### GetIncludeDeferredOk + +`func (o *Pool) GetIncludeDeferredOk() (*bool, bool)` + +GetIncludeDeferredOk returns a tuple with the IncludeDeferred field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIncludeDeferred + +`func (o *Pool) SetIncludeDeferred(v bool)` + +SetIncludeDeferred sets IncludeDeferred field to given value. + +### HasIncludeDeferred + +`func (o *Pool) HasIncludeDeferred() bool` + +HasIncludeDeferred returns a boolean if a field has been set. + +### GetName + +`func (o *Pool) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Pool) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Pool) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Pool) HasName() bool` + +HasName returns a boolean if a field has been set. ### GetOccupiedSlots @@ -125,30 +169,30 @@ SetOccupiedSlots sets OccupiedSlots field to given value. HasOccupiedSlots returns a boolean if a field has been set. -### GetUsedSlots +### GetOpenSlots -`func (o *Pool) GetUsedSlots() int32` +`func (o *Pool) GetOpenSlots() int32` -GetUsedSlots returns the UsedSlots field if non-nil, zero value otherwise. +GetOpenSlots returns the OpenSlots field if non-nil, zero value otherwise. -### GetUsedSlotsOk +### GetOpenSlotsOk -`func (o *Pool) GetUsedSlotsOk() (*int32, bool)` +`func (o *Pool) GetOpenSlotsOk() (*int32, bool)` -GetUsedSlotsOk returns a tuple with the UsedSlots field if it's non-nil, zero value otherwise +GetOpenSlotsOk returns a tuple with the OpenSlots field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetUsedSlots +### SetOpenSlots -`func (o *Pool) SetUsedSlots(v int32)` +`func (o *Pool) SetOpenSlots(v int32)` -SetUsedSlots sets UsedSlots field to given value. +SetOpenSlots sets OpenSlots field to given value. -### HasUsedSlots +### HasOpenSlots -`func (o *Pool) HasUsedSlots() bool` +`func (o *Pool) HasOpenSlots() bool` -HasUsedSlots returns a boolean if a field has been set. +HasOpenSlots returns a boolean if a field has been set. ### GetQueuedSlots @@ -175,66 +219,81 @@ SetQueuedSlots sets QueuedSlots field to given value. HasQueuedSlots returns a boolean if a field has been set. -### GetOpenSlots +### GetRunningSlots -`func (o *Pool) GetOpenSlots() int32` +`func (o *Pool) GetRunningSlots() int32` -GetOpenSlots returns the OpenSlots field if non-nil, zero value otherwise. +GetRunningSlots returns the RunningSlots field if non-nil, zero value otherwise. -### GetOpenSlotsOk +### GetRunningSlotsOk -`func (o *Pool) GetOpenSlotsOk() (*int32, bool)` +`func (o *Pool) GetRunningSlotsOk() (*int32, bool)` -GetOpenSlotsOk returns a tuple with the OpenSlots field if it's non-nil, zero value otherwise +GetRunningSlotsOk returns a tuple with the RunningSlots field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetOpenSlots +### SetRunningSlots -`func (o *Pool) SetOpenSlots(v int32)` +`func (o *Pool) SetRunningSlots(v int32)` -SetOpenSlots sets OpenSlots field to given value. +SetRunningSlots sets RunningSlots field to given value. -### HasOpenSlots +### HasRunningSlots -`func (o *Pool) HasOpenSlots() bool` +`func (o *Pool) HasRunningSlots() bool` -HasOpenSlots returns a boolean if a field has been set. +HasRunningSlots returns a boolean if a field has been set. -### GetDescription +### GetScheduledSlots -`func (o *Pool) GetDescription() string` +`func (o *Pool) GetScheduledSlots() int32` -GetDescription returns the Description field if non-nil, zero value otherwise. +GetScheduledSlots returns the ScheduledSlots field if non-nil, zero value otherwise. -### GetDescriptionOk +### GetScheduledSlotsOk -`func (o *Pool) GetDescriptionOk() (*string, bool)` +`func (o *Pool) GetScheduledSlotsOk() (*int32, bool)` -GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +GetScheduledSlotsOk returns a tuple with the ScheduledSlots field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDescription +### SetScheduledSlots -`func (o *Pool) SetDescription(v string)` +`func (o *Pool) SetScheduledSlots(v int32)` -SetDescription sets Description field to given value. +SetScheduledSlots sets ScheduledSlots field to given value. -### HasDescription +### HasScheduledSlots -`func (o *Pool) HasDescription() bool` +`func (o *Pool) HasScheduledSlots() bool` -HasDescription returns a boolean if a field has been set. +HasScheduledSlots returns a boolean if a field has been set. -### SetDescriptionNil +### GetSlots -`func (o *Pool) SetDescriptionNil(b bool)` +`func (o *Pool) GetSlots() int32` - SetDescriptionNil sets the value for Description to be an explicit nil +GetSlots returns the Slots field if non-nil, zero value otherwise. -### UnsetDescription -`func (o *Pool) UnsetDescription()` +### GetSlotsOk + +`func (o *Pool) GetSlotsOk() (*int32, bool)` + +GetSlotsOk returns a tuple with the Slots field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSlots + +`func (o *Pool) SetSlots(v int32)` + +SetSlots sets Slots field to given value. + +### HasSlots + +`func (o *Pool) HasSlots() bool` + +HasSlots returns a boolean if a field has been set. -UnsetDescription ensures that no value is present for Description, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/PoolApi.md b/airflow/docs/PoolApi.md index 2453bba..aa48fc5 100644 --- a/airflow/docs/PoolApi.md +++ b/airflow/docs/PoolApi.md @@ -1,33 +1,14 @@ - - -# \PoolApi - -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**DeletePool**](PoolApi.md#DeletePool) | **Delete** /pools/{pool_name} | Delete a pool -[**GetPool**](PoolApi.md#GetPool) | **Get** /pools/{pool_name} | Get a pool -[**GetPools**](PoolApi.md#GetPools) | **Get** /pools | List pools -[**PatchPool**](PoolApi.md#PatchPool) | **Patch** /pools/{pool_name} | Update a pool -[**PostPool**](PoolApi.md#PostPool) | **Post** /pools | Create a pool +[**DeletePool**](PoolAPI.md#DeletePool) | **Delete** /pools/{pool_name} | Delete a pool +[**GetPool**](PoolAPI.md#GetPool) | **Get** /pools/{pool_name} | Get a pool +[**GetPools**](PoolAPI.md#GetPools) | **Get** /pools | List pools +[**PatchPool**](PoolAPI.md#PatchPool) | **Patch** /pools/{pool_name} | Update a pool +[**PostPool**](PoolAPI.md#PostPool) | **Post** /pools | Create a pool @@ -43,22 +24,22 @@ Delete a pool package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - poolName := "poolName_example" // string | The pool name. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PoolApi.DeletePool(context.Background(), poolName).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PoolApi.DeletePool``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + poolName := "poolName_example" // string | The pool name. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.PoolAPI.DeletePool(context.Background(), poolName).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PoolAPI.DeletePool``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -85,7 +66,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -109,24 +90,24 @@ Get a pool package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - poolName := "poolName_example" // string | The pool name. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PoolApi.GetPool(context.Background(), poolName).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PoolApi.GetPool``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetPool`: Pool - fmt.Fprintf(os.Stdout, "Response from `PoolApi.GetPool`: %v\n", resp) + poolName := "poolName_example" // string | The pool name. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PoolAPI.GetPool(context.Background(), poolName).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PoolAPI.GetPool``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetPool`: Pool + fmt.Fprintf(os.Stdout, "Response from `PoolAPI.GetPool`: %v\n", resp) } ``` @@ -153,7 +134,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -177,26 +158,26 @@ List pools package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) - offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) - orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PoolApi.GetPools(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PoolApi.GetPools``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetPools`: PoolCollection - fmt.Fprintf(os.Stdout, "Response from `PoolApi.GetPools`: %v\n", resp) + limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) + offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) + orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PoolAPI.GetPools(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PoolAPI.GetPools``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetPools`: PoolCollection + fmt.Fprintf(os.Stdout, "Response from `PoolAPI.GetPools`: %v\n", resp) } ``` @@ -221,7 +202,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -245,26 +226,26 @@ Update a pool package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - poolName := "poolName_example" // string | The pool name. - pool := *openapiclient.NewPool() // Pool | - updateMask := []string{"Inner_example"} // []string | The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PoolApi.PatchPool(context.Background(), poolName).Pool(pool).UpdateMask(updateMask).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PoolApi.PatchPool``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PatchPool`: Pool - fmt.Fprintf(os.Stdout, "Response from `PoolApi.PatchPool`: %v\n", resp) + poolName := "poolName_example" // string | The pool name. + pool := *openapiclient.NewPool() // Pool | + updateMask := []string{"Inner_example"} // []string | The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PoolAPI.PatchPool(context.Background(), poolName).Pool(pool).UpdateMask(updateMask).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PoolAPI.PatchPool``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PatchPool`: Pool + fmt.Fprintf(os.Stdout, "Response from `PoolAPI.PatchPool`: %v\n", resp) } ``` @@ -293,7 +274,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -317,24 +298,24 @@ Create a pool package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - pool := *openapiclient.NewPool() // Pool | - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.PoolApi.PostPool(context.Background()).Pool(pool).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PoolApi.PostPool``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PostPool`: Pool - fmt.Fprintf(os.Stdout, "Response from `PoolApi.PostPool`: %v\n", resp) + pool := *openapiclient.NewPool() // Pool | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PoolAPI.PostPool(context.Background()).Pool(pool).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PoolAPI.PostPool``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PostPool`: Pool + fmt.Fprintf(os.Stdout, "Response from `PoolAPI.PostPool`: %v\n", resp) } ``` @@ -357,7 +338,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers diff --git a/airflow/docs/PoolCollection.md b/airflow/docs/PoolCollection.md index f8c6770..5f7fdcd 100644 --- a/airflow/docs/PoolCollection.md +++ b/airflow/docs/PoolCollection.md @@ -1,30 +1,11 @@ - - # PoolCollection ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] **Pools** | Pointer to [**[]Pool**](Pool.md) | | [optional] -**TotalEntries** | Pointer to **int32** | Count of objects in the current result set. | [optional] ## Methods @@ -45,55 +26,55 @@ NewPoolCollectionWithDefaults instantiates a new PoolCollection object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetPools +### GetTotalEntries -`func (o *PoolCollection) GetPools() []Pool` +`func (o *PoolCollection) GetTotalEntries() int32` -GetPools returns the Pools field if non-nil, zero value otherwise. +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. -### GetPoolsOk +### GetTotalEntriesOk -`func (o *PoolCollection) GetPoolsOk() (*[]Pool, bool)` +`func (o *PoolCollection) GetTotalEntriesOk() (*int32, bool)` -GetPoolsOk returns a tuple with the Pools field if it's non-nil, zero value otherwise +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetPools +### SetTotalEntries -`func (o *PoolCollection) SetPools(v []Pool)` +`func (o *PoolCollection) SetTotalEntries(v int32)` -SetPools sets Pools field to given value. +SetTotalEntries sets TotalEntries field to given value. -### HasPools +### HasTotalEntries -`func (o *PoolCollection) HasPools() bool` +`func (o *PoolCollection) HasTotalEntries() bool` -HasPools returns a boolean if a field has been set. +HasTotalEntries returns a boolean if a field has been set. -### GetTotalEntries +### GetPools -`func (o *PoolCollection) GetTotalEntries() int32` +`func (o *PoolCollection) GetPools() []Pool` -GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. +GetPools returns the Pools field if non-nil, zero value otherwise. -### GetTotalEntriesOk +### GetPoolsOk -`func (o *PoolCollection) GetTotalEntriesOk() (*int32, bool)` +`func (o *PoolCollection) GetPoolsOk() (*[]Pool, bool)` -GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +GetPoolsOk returns a tuple with the Pools field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTotalEntries +### SetPools -`func (o *PoolCollection) SetTotalEntries(v int32)` +`func (o *PoolCollection) SetPools(v []Pool)` -SetTotalEntries sets TotalEntries field to given value. +SetPools sets Pools field to given value. -### HasTotalEntries +### HasPools -`func (o *PoolCollection) HasTotalEntries() bool` +`func (o *PoolCollection) HasPools() bool` -HasTotalEntries returns a boolean if a field has been set. +HasPools returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/Provider.md b/airflow/docs/Provider.md index 5ccb18d..62152aa 100644 --- a/airflow/docs/Provider.md +++ b/airflow/docs/Provider.md @@ -1,30 +1,11 @@ - - # Provider ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**PackageName** | Pointer to **string** | The package name of the provider. | [optional] **Description** | Pointer to **string** | The description of the provider. | [optional] +**PackageName** | Pointer to **string** | The package name of the provider. | [optional] **Version** | Pointer to **string** | The version of the provider. | [optional] ## Methods @@ -46,55 +27,55 @@ NewProviderWithDefaults instantiates a new Provider object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetPackageName +### GetDescription -`func (o *Provider) GetPackageName() string` +`func (o *Provider) GetDescription() string` -GetPackageName returns the PackageName field if non-nil, zero value otherwise. +GetDescription returns the Description field if non-nil, zero value otherwise. -### GetPackageNameOk +### GetDescriptionOk -`func (o *Provider) GetPackageNameOk() (*string, bool)` +`func (o *Provider) GetDescriptionOk() (*string, bool)` -GetPackageNameOk returns a tuple with the PackageName field if it's non-nil, zero value otherwise +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetPackageName +### SetDescription -`func (o *Provider) SetPackageName(v string)` +`func (o *Provider) SetDescription(v string)` -SetPackageName sets PackageName field to given value. +SetDescription sets Description field to given value. -### HasPackageName +### HasDescription -`func (o *Provider) HasPackageName() bool` +`func (o *Provider) HasDescription() bool` -HasPackageName returns a boolean if a field has been set. +HasDescription returns a boolean if a field has been set. -### GetDescription +### GetPackageName -`func (o *Provider) GetDescription() string` +`func (o *Provider) GetPackageName() string` -GetDescription returns the Description field if non-nil, zero value otherwise. +GetPackageName returns the PackageName field if non-nil, zero value otherwise. -### GetDescriptionOk +### GetPackageNameOk -`func (o *Provider) GetDescriptionOk() (*string, bool)` +`func (o *Provider) GetPackageNameOk() (*string, bool)` -GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +GetPackageNameOk returns a tuple with the PackageName field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDescription +### SetPackageName -`func (o *Provider) SetDescription(v string)` +`func (o *Provider) SetPackageName(v string)` -SetDescription sets Description field to given value. +SetPackageName sets PackageName field to given value. -### HasDescription +### HasPackageName -`func (o *Provider) HasDescription() bool` +`func (o *Provider) HasPackageName() bool` -HasDescription returns a boolean if a field has been set. +HasPackageName returns a boolean if a field has been set. ### GetVersion diff --git a/airflow/docs/ProviderApi.md b/airflow/docs/ProviderApi.md index f59a608..d3068d8 100644 --- a/airflow/docs/ProviderApi.md +++ b/airflow/docs/ProviderApi.md @@ -1,35 +1,16 @@ - - -# \ProviderApi - -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**GetProviders**](ProviderApi.md#GetProviders) | **Get** /providers | List providers +[**GetProviders**](ProviderAPI.md#GetProviders) | **Get** /providers | List providers ## GetProviders -> ProviderCollection GetProviders(ctx).Execute() +> GetProviders200Response GetProviders(ctx).Execute() List providers @@ -41,23 +22,23 @@ List providers package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.ProviderApi.GetProviders(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ProviderApi.GetProviders``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetProviders`: ProviderCollection - fmt.Fprintf(os.Stdout, "Response from `ProviderApi.GetProviders`: %v\n", resp) + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ProviderAPI.GetProviders(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ProviderAPI.GetProviders``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetProviders`: GetProviders200Response + fmt.Fprintf(os.Stdout, "Response from `ProviderAPI.GetProviders`: %v\n", resp) } ``` @@ -72,11 +53,11 @@ Other parameters are passed through a pointer to a apiGetProvidersRequest struct ### Return type -[**ProviderCollection**](ProviderCollection.md) +[**GetProviders200Response**](GetProviders200Response.md) ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers diff --git a/airflow/docs/ProviderCollection.md b/airflow/docs/ProviderCollection.md index 547fcaf..92cdf8b 100644 --- a/airflow/docs/ProviderCollection.md +++ b/airflow/docs/ProviderCollection.md @@ -1,22 +1,3 @@ - - # ProviderCollection ## Properties diff --git a/airflow/docs/QueuedEvent.md b/airflow/docs/QueuedEvent.md new file mode 100644 index 0000000..094309e --- /dev/null +++ b/airflow/docs/QueuedEvent.md @@ -0,0 +1,108 @@ +# QueuedEvent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | Pointer to **time.Time** | The creation time of QueuedEvent | [optional] +**DagId** | Pointer to **string** | The DAG ID. | [optional] +**Uri** | Pointer to **string** | The datata uri. | [optional] + +## Methods + +### NewQueuedEvent + +`func NewQueuedEvent() *QueuedEvent` + +NewQueuedEvent instantiates a new QueuedEvent object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewQueuedEventWithDefaults + +`func NewQueuedEventWithDefaults() *QueuedEvent` + +NewQueuedEventWithDefaults instantiates a new QueuedEvent object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCreatedAt + +`func (o *QueuedEvent) GetCreatedAt() time.Time` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *QueuedEvent) GetCreatedAtOk() (*time.Time, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *QueuedEvent) SetCreatedAt(v time.Time)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *QueuedEvent) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetDagId + +`func (o *QueuedEvent) GetDagId() string` + +GetDagId returns the DagId field if non-nil, zero value otherwise. + +### GetDagIdOk + +`func (o *QueuedEvent) GetDagIdOk() (*string, bool)` + +GetDagIdOk returns a tuple with the DagId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDagId + +`func (o *QueuedEvent) SetDagId(v string)` + +SetDagId sets DagId field to given value. + +### HasDagId + +`func (o *QueuedEvent) HasDagId() bool` + +HasDagId returns a boolean if a field has been set. + +### GetUri + +`func (o *QueuedEvent) GetUri() string` + +GetUri returns the Uri field if non-nil, zero value otherwise. + +### GetUriOk + +`func (o *QueuedEvent) GetUriOk() (*string, bool)` + +GetUriOk returns a tuple with the Uri field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUri + +`func (o *QueuedEvent) SetUri(v string)` + +SetUri sets Uri field to given value. + +### HasUri + +`func (o *QueuedEvent) HasUri() bool` + +HasUri returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/docs/QueuedEventCollection.md b/airflow/docs/QueuedEventCollection.md new file mode 100644 index 0000000..b7b4dab --- /dev/null +++ b/airflow/docs/QueuedEventCollection.md @@ -0,0 +1,82 @@ +# QueuedEventCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] +**Datasets** | Pointer to [**[]QueuedEvent**](QueuedEvent.md) | | [optional] + +## Methods + +### NewQueuedEventCollection + +`func NewQueuedEventCollection() *QueuedEventCollection` + +NewQueuedEventCollection instantiates a new QueuedEventCollection object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewQueuedEventCollectionWithDefaults + +`func NewQueuedEventCollectionWithDefaults() *QueuedEventCollection` + +NewQueuedEventCollectionWithDefaults instantiates a new QueuedEventCollection object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotalEntries + +`func (o *QueuedEventCollection) GetTotalEntries() int32` + +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. + +### GetTotalEntriesOk + +`func (o *QueuedEventCollection) GetTotalEntriesOk() (*int32, bool)` + +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalEntries + +`func (o *QueuedEventCollection) SetTotalEntries(v int32)` + +SetTotalEntries sets TotalEntries field to given value. + +### HasTotalEntries + +`func (o *QueuedEventCollection) HasTotalEntries() bool` + +HasTotalEntries returns a boolean if a field has been set. + +### GetDatasets + +`func (o *QueuedEventCollection) GetDatasets() []QueuedEvent` + +GetDatasets returns the Datasets field if non-nil, zero value otherwise. + +### GetDatasetsOk + +`func (o *QueuedEventCollection) GetDatasetsOk() (*[]QueuedEvent, bool)` + +GetDatasetsOk returns a tuple with the Datasets field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDatasets + +`func (o *QueuedEventCollection) SetDatasets(v []QueuedEvent)` + +SetDatasets sets Datasets field to given value. + +### HasDatasets + +`func (o *QueuedEventCollection) HasDatasets() bool` + +HasDatasets returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/docs/RelativeDelta.md b/airflow/docs/RelativeDelta.md index 5cb1c23..11a16e1 100644 --- a/airflow/docs/RelativeDelta.md +++ b/airflow/docs/RelativeDelta.md @@ -1,22 +1,3 @@ - - # RelativeDelta ## Properties @@ -24,27 +5,27 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Type** | **string** | | -**Years** | **int32** | | -**Months** | **int32** | | +**Day** | **int32** | | **Days** | **int32** | | -**Leapdays** | **int32** | | +**Hour** | **int32** | | **Hours** | **int32** | | -**Minutes** | **int32** | | -**Seconds** | **int32** | | +**Leapdays** | **int32** | | +**Microsecond** | **int32** | | **Microseconds** | **int32** | | -**Year** | **int32** | | -**Month** | **int32** | | -**Day** | **int32** | | -**Hour** | **int32** | | **Minute** | **int32** | | +**Minutes** | **int32** | | +**Month** | **int32** | | +**Months** | **int32** | | **Second** | **int32** | | -**Microsecond** | **int32** | | +**Seconds** | **int32** | | +**Year** | **int32** | | +**Years** | **int32** | | ## Methods ### NewRelativeDelta -`func NewRelativeDelta(type_ string, years int32, months int32, days int32, leapdays int32, hours int32, minutes int32, seconds int32, microseconds int32, year int32, month int32, day int32, hour int32, minute int32, second int32, microsecond int32, ) *RelativeDelta` +`func NewRelativeDelta(type_ string, day int32, days int32, hour int32, hours int32, leapdays int32, microsecond int32, microseconds int32, minute int32, minutes int32, month int32, months int32, second int32, seconds int32, year int32, years int32, ) *RelativeDelta` NewRelativeDelta instantiates a new RelativeDelta object This constructor will assign default values to properties that have it defined, @@ -79,44 +60,24 @@ and a boolean to check if the value has been set. SetType sets Type field to given value. -### GetYears - -`func (o *RelativeDelta) GetYears() int32` - -GetYears returns the Years field if non-nil, zero value otherwise. - -### GetYearsOk - -`func (o *RelativeDelta) GetYearsOk() (*int32, bool)` - -GetYearsOk returns a tuple with the Years field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetYears - -`func (o *RelativeDelta) SetYears(v int32)` - -SetYears sets Years field to given value. - - -### GetMonths +### GetDay -`func (o *RelativeDelta) GetMonths() int32` +`func (o *RelativeDelta) GetDay() int32` -GetMonths returns the Months field if non-nil, zero value otherwise. +GetDay returns the Day field if non-nil, zero value otherwise. -### GetMonthsOk +### GetDayOk -`func (o *RelativeDelta) GetMonthsOk() (*int32, bool)` +`func (o *RelativeDelta) GetDayOk() (*int32, bool)` -GetMonthsOk returns a tuple with the Months field if it's non-nil, zero value otherwise +GetDayOk returns a tuple with the Day field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetMonths +### SetDay -`func (o *RelativeDelta) SetMonths(v int32)` +`func (o *RelativeDelta) SetDay(v int32)` -SetMonths sets Months field to given value. +SetDay sets Day field to given value. ### GetDays @@ -139,24 +100,24 @@ and a boolean to check if the value has been set. SetDays sets Days field to given value. -### GetLeapdays +### GetHour -`func (o *RelativeDelta) GetLeapdays() int32` +`func (o *RelativeDelta) GetHour() int32` -GetLeapdays returns the Leapdays field if non-nil, zero value otherwise. +GetHour returns the Hour field if non-nil, zero value otherwise. -### GetLeapdaysOk +### GetHourOk -`func (o *RelativeDelta) GetLeapdaysOk() (*int32, bool)` +`func (o *RelativeDelta) GetHourOk() (*int32, bool)` -GetLeapdaysOk returns a tuple with the Leapdays field if it's non-nil, zero value otherwise +GetHourOk returns a tuple with the Hour field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetLeapdays +### SetHour -`func (o *RelativeDelta) SetLeapdays(v int32)` +`func (o *RelativeDelta) SetHour(v int32)` -SetLeapdays sets Leapdays field to given value. +SetHour sets Hour field to given value. ### GetHours @@ -179,44 +140,44 @@ and a boolean to check if the value has been set. SetHours sets Hours field to given value. -### GetMinutes +### GetLeapdays -`func (o *RelativeDelta) GetMinutes() int32` +`func (o *RelativeDelta) GetLeapdays() int32` -GetMinutes returns the Minutes field if non-nil, zero value otherwise. +GetLeapdays returns the Leapdays field if non-nil, zero value otherwise. -### GetMinutesOk +### GetLeapdaysOk -`func (o *RelativeDelta) GetMinutesOk() (*int32, bool)` +`func (o *RelativeDelta) GetLeapdaysOk() (*int32, bool)` -GetMinutesOk returns a tuple with the Minutes field if it's non-nil, zero value otherwise +GetLeapdaysOk returns a tuple with the Leapdays field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetMinutes +### SetLeapdays -`func (o *RelativeDelta) SetMinutes(v int32)` +`func (o *RelativeDelta) SetLeapdays(v int32)` -SetMinutes sets Minutes field to given value. +SetLeapdays sets Leapdays field to given value. -### GetSeconds +### GetMicrosecond -`func (o *RelativeDelta) GetSeconds() int32` +`func (o *RelativeDelta) GetMicrosecond() int32` -GetSeconds returns the Seconds field if non-nil, zero value otherwise. +GetMicrosecond returns the Microsecond field if non-nil, zero value otherwise. -### GetSecondsOk +### GetMicrosecondOk -`func (o *RelativeDelta) GetSecondsOk() (*int32, bool)` +`func (o *RelativeDelta) GetMicrosecondOk() (*int32, bool)` -GetSecondsOk returns a tuple with the Seconds field if it's non-nil, zero value otherwise +GetMicrosecondOk returns a tuple with the Microsecond field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetSeconds +### SetMicrosecond -`func (o *RelativeDelta) SetSeconds(v int32)` +`func (o *RelativeDelta) SetMicrosecond(v int32)` -SetSeconds sets Seconds field to given value. +SetMicrosecond sets Microsecond field to given value. ### GetMicroseconds @@ -239,24 +200,44 @@ and a boolean to check if the value has been set. SetMicroseconds sets Microseconds field to given value. -### GetYear +### GetMinute -`func (o *RelativeDelta) GetYear() int32` +`func (o *RelativeDelta) GetMinute() int32` -GetYear returns the Year field if non-nil, zero value otherwise. +GetMinute returns the Minute field if non-nil, zero value otherwise. -### GetYearOk +### GetMinuteOk -`func (o *RelativeDelta) GetYearOk() (*int32, bool)` +`func (o *RelativeDelta) GetMinuteOk() (*int32, bool)` -GetYearOk returns a tuple with the Year field if it's non-nil, zero value otherwise +GetMinuteOk returns a tuple with the Minute field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetYear +### SetMinute -`func (o *RelativeDelta) SetYear(v int32)` +`func (o *RelativeDelta) SetMinute(v int32)` -SetYear sets Year field to given value. +SetMinute sets Minute field to given value. + + +### GetMinutes + +`func (o *RelativeDelta) GetMinutes() int32` + +GetMinutes returns the Minutes field if non-nil, zero value otherwise. + +### GetMinutesOk + +`func (o *RelativeDelta) GetMinutesOk() (*int32, bool)` + +GetMinutesOk returns a tuple with the Minutes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMinutes + +`func (o *RelativeDelta) SetMinutes(v int32)` + +SetMinutes sets Minutes field to given value. ### GetMonth @@ -279,104 +260,104 @@ and a boolean to check if the value has been set. SetMonth sets Month field to given value. -### GetDay +### GetMonths -`func (o *RelativeDelta) GetDay() int32` +`func (o *RelativeDelta) GetMonths() int32` -GetDay returns the Day field if non-nil, zero value otherwise. +GetMonths returns the Months field if non-nil, zero value otherwise. -### GetDayOk +### GetMonthsOk -`func (o *RelativeDelta) GetDayOk() (*int32, bool)` +`func (o *RelativeDelta) GetMonthsOk() (*int32, bool)` -GetDayOk returns a tuple with the Day field if it's non-nil, zero value otherwise +GetMonthsOk returns a tuple with the Months field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDay +### SetMonths -`func (o *RelativeDelta) SetDay(v int32)` +`func (o *RelativeDelta) SetMonths(v int32)` -SetDay sets Day field to given value. +SetMonths sets Months field to given value. -### GetHour +### GetSecond -`func (o *RelativeDelta) GetHour() int32` +`func (o *RelativeDelta) GetSecond() int32` -GetHour returns the Hour field if non-nil, zero value otherwise. +GetSecond returns the Second field if non-nil, zero value otherwise. -### GetHourOk +### GetSecondOk -`func (o *RelativeDelta) GetHourOk() (*int32, bool)` +`func (o *RelativeDelta) GetSecondOk() (*int32, bool)` -GetHourOk returns a tuple with the Hour field if it's non-nil, zero value otherwise +GetSecondOk returns a tuple with the Second field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetHour +### SetSecond -`func (o *RelativeDelta) SetHour(v int32)` +`func (o *RelativeDelta) SetSecond(v int32)` -SetHour sets Hour field to given value. +SetSecond sets Second field to given value. -### GetMinute +### GetSeconds -`func (o *RelativeDelta) GetMinute() int32` +`func (o *RelativeDelta) GetSeconds() int32` -GetMinute returns the Minute field if non-nil, zero value otherwise. +GetSeconds returns the Seconds field if non-nil, zero value otherwise. -### GetMinuteOk +### GetSecondsOk -`func (o *RelativeDelta) GetMinuteOk() (*int32, bool)` +`func (o *RelativeDelta) GetSecondsOk() (*int32, bool)` -GetMinuteOk returns a tuple with the Minute field if it's non-nil, zero value otherwise +GetSecondsOk returns a tuple with the Seconds field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetMinute +### SetSeconds -`func (o *RelativeDelta) SetMinute(v int32)` +`func (o *RelativeDelta) SetSeconds(v int32)` -SetMinute sets Minute field to given value. +SetSeconds sets Seconds field to given value. -### GetSecond +### GetYear -`func (o *RelativeDelta) GetSecond() int32` +`func (o *RelativeDelta) GetYear() int32` -GetSecond returns the Second field if non-nil, zero value otherwise. +GetYear returns the Year field if non-nil, zero value otherwise. -### GetSecondOk +### GetYearOk -`func (o *RelativeDelta) GetSecondOk() (*int32, bool)` +`func (o *RelativeDelta) GetYearOk() (*int32, bool)` -GetSecondOk returns a tuple with the Second field if it's non-nil, zero value otherwise +GetYearOk returns a tuple with the Year field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetSecond +### SetYear -`func (o *RelativeDelta) SetSecond(v int32)` +`func (o *RelativeDelta) SetYear(v int32)` -SetSecond sets Second field to given value. +SetYear sets Year field to given value. -### GetMicrosecond +### GetYears -`func (o *RelativeDelta) GetMicrosecond() int32` +`func (o *RelativeDelta) GetYears() int32` -GetMicrosecond returns the Microsecond field if non-nil, zero value otherwise. +GetYears returns the Years field if non-nil, zero value otherwise. -### GetMicrosecondOk +### GetYearsOk -`func (o *RelativeDelta) GetMicrosecondOk() (*int32, bool)` +`func (o *RelativeDelta) GetYearsOk() (*int32, bool)` -GetMicrosecondOk returns a tuple with the Microsecond field if it's non-nil, zero value otherwise +GetYearsOk returns a tuple with the Years field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetMicrosecond +### SetYears -`func (o *RelativeDelta) SetMicrosecond(v int32)` +`func (o *RelativeDelta) SetYears(v int32)` -SetMicrosecond sets Microsecond field to given value. +SetYears sets Years field to given value. diff --git a/airflow/docs/Resource.md b/airflow/docs/Resource.md index 1eca4c2..2e6358c 100644 --- a/airflow/docs/Resource.md +++ b/airflow/docs/Resource.md @@ -1,22 +1,3 @@ - - # Resource ## Properties diff --git a/airflow/docs/Role.md b/airflow/docs/Role.md index 3093ab3..f437859 100644 --- a/airflow/docs/Role.md +++ b/airflow/docs/Role.md @@ -1,30 +1,11 @@ - - # Role ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | Pointer to **string** | The name of the role *Changed in version 2.3.0*&#58; A minimum character length requirement ('minLength') is added. | [optional] **Actions** | Pointer to [**[]ActionResource**](ActionResource.md) | | [optional] +**Name** | Pointer to **string** | The name of the role *Changed in version 2.3.0*&#58; A minimum character length requirement ('minLength') is added. | [optional] ## Methods @@ -45,55 +26,55 @@ NewRoleWithDefaults instantiates a new Role object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetName +### GetActions -`func (o *Role) GetName() string` +`func (o *Role) GetActions() []ActionResource` -GetName returns the Name field if non-nil, zero value otherwise. +GetActions returns the Actions field if non-nil, zero value otherwise. -### GetNameOk +### GetActionsOk -`func (o *Role) GetNameOk() (*string, bool)` +`func (o *Role) GetActionsOk() (*[]ActionResource, bool)` -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +GetActionsOk returns a tuple with the Actions field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetName +### SetActions -`func (o *Role) SetName(v string)` +`func (o *Role) SetActions(v []ActionResource)` -SetName sets Name field to given value. +SetActions sets Actions field to given value. -### HasName +### HasActions -`func (o *Role) HasName() bool` +`func (o *Role) HasActions() bool` -HasName returns a boolean if a field has been set. +HasActions returns a boolean if a field has been set. -### GetActions +### GetName -`func (o *Role) GetActions() []ActionResource` +`func (o *Role) GetName() string` -GetActions returns the Actions field if non-nil, zero value otherwise. +GetName returns the Name field if non-nil, zero value otherwise. -### GetActionsOk +### GetNameOk -`func (o *Role) GetActionsOk() (*[]ActionResource, bool)` +`func (o *Role) GetNameOk() (*string, bool)` -GetActionsOk returns a tuple with the Actions field if it's non-nil, zero value otherwise +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetActions +### SetName -`func (o *Role) SetActions(v []ActionResource)` +`func (o *Role) SetName(v string)` -SetActions sets Actions field to given value. +SetName sets Name field to given value. -### HasActions +### HasName -`func (o *Role) HasActions() bool` +`func (o *Role) HasName() bool` -HasActions returns a boolean if a field has been set. +HasName returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/RoleApi.md b/airflow/docs/RoleApi.md index 9e286d9..e0c2d41 100644 --- a/airflow/docs/RoleApi.md +++ b/airflow/docs/RoleApi.md @@ -1,33 +1,14 @@ - - -# \RoleApi - -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**DeleteRole**](RoleApi.md#DeleteRole) | **Delete** /roles/{role_name} | Delete a role -[**GetRole**](RoleApi.md#GetRole) | **Get** /roles/{role_name} | Get a role -[**GetRoles**](RoleApi.md#GetRoles) | **Get** /roles | List roles -[**PatchRole**](RoleApi.md#PatchRole) | **Patch** /roles/{role_name} | Update a role -[**PostRole**](RoleApi.md#PostRole) | **Post** /roles | Create a role +[**DeleteRole**](RoleAPI.md#DeleteRole) | **Delete** /roles/{role_name} | Delete a role +[**GetRole**](RoleAPI.md#GetRole) | **Get** /roles/{role_name} | Get a role +[**GetRoles**](RoleAPI.md#GetRoles) | **Get** /roles | List roles +[**PatchRole**](RoleAPI.md#PatchRole) | **Patch** /roles/{role_name} | Update a role +[**PostRole**](RoleAPI.md#PostRole) | **Post** /roles | Create a role @@ -45,22 +26,22 @@ Delete a role package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - roleName := "roleName_example" // string | The role name - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.RoleApi.DeleteRole(context.Background(), roleName).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `RoleApi.DeleteRole``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + roleName := "roleName_example" // string | The role name + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.RoleAPI.DeleteRole(context.Background(), roleName).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RoleAPI.DeleteRole``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -87,7 +68,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -113,24 +94,24 @@ Get a role package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - roleName := "roleName_example" // string | The role name - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.RoleApi.GetRole(context.Background(), roleName).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `RoleApi.GetRole``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetRole`: Role - fmt.Fprintf(os.Stdout, "Response from `RoleApi.GetRole`: %v\n", resp) + roleName := "roleName_example" // string | The role name + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.RoleAPI.GetRole(context.Background(), roleName).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RoleAPI.GetRole``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetRole`: Role + fmt.Fprintf(os.Stdout, "Response from `RoleAPI.GetRole`: %v\n", resp) } ``` @@ -157,7 +138,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -183,26 +164,26 @@ List roles package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) - offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) - orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.RoleApi.GetRoles(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `RoleApi.GetRoles``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetRoles`: RoleCollection - fmt.Fprintf(os.Stdout, "Response from `RoleApi.GetRoles`: %v\n", resp) + limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) + offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) + orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.RoleAPI.GetRoles(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RoleAPI.GetRoles``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetRoles`: RoleCollection + fmt.Fprintf(os.Stdout, "Response from `RoleAPI.GetRoles`: %v\n", resp) } ``` @@ -227,7 +208,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -253,26 +234,26 @@ Update a role package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - roleName := "roleName_example" // string | The role name - role := *openapiclient.NewRole() // Role | - updateMask := []string{"Inner_example"} // []string | The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.RoleApi.PatchRole(context.Background(), roleName).Role(role).UpdateMask(updateMask).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `RoleApi.PatchRole``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PatchRole`: Role - fmt.Fprintf(os.Stdout, "Response from `RoleApi.PatchRole`: %v\n", resp) + roleName := "roleName_example" // string | The role name + role := *openapiclient.NewRole() // Role | + updateMask := []string{"Inner_example"} // []string | The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.RoleAPI.PatchRole(context.Background(), roleName).Role(role).UpdateMask(updateMask).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RoleAPI.PatchRole``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PatchRole`: Role + fmt.Fprintf(os.Stdout, "Response from `RoleAPI.PatchRole`: %v\n", resp) } ``` @@ -301,7 +282,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -327,24 +308,24 @@ Create a role package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - role := *openapiclient.NewRole() // Role | - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.RoleApi.PostRole(context.Background()).Role(role).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `RoleApi.PostRole``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PostRole`: Role - fmt.Fprintf(os.Stdout, "Response from `RoleApi.PostRole`: %v\n", resp) + role := *openapiclient.NewRole() // Role | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.RoleAPI.PostRole(context.Background()).Role(role).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RoleAPI.PostRole``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PostRole`: Role + fmt.Fprintf(os.Stdout, "Response from `RoleAPI.PostRole`: %v\n", resp) } ``` @@ -367,7 +348,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers diff --git a/airflow/docs/RoleCollection.md b/airflow/docs/RoleCollection.md index 58db8a0..b96f0ab 100644 --- a/airflow/docs/RoleCollection.md +++ b/airflow/docs/RoleCollection.md @@ -1,30 +1,11 @@ - - # RoleCollection ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] **Roles** | Pointer to [**[]Role**](Role.md) | | [optional] -**TotalEntries** | Pointer to **int32** | Count of objects in the current result set. | [optional] ## Methods @@ -45,55 +26,55 @@ NewRoleCollectionWithDefaults instantiates a new RoleCollection object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetRoles +### GetTotalEntries -`func (o *RoleCollection) GetRoles() []Role` +`func (o *RoleCollection) GetTotalEntries() int32` -GetRoles returns the Roles field if non-nil, zero value otherwise. +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. -### GetRolesOk +### GetTotalEntriesOk -`func (o *RoleCollection) GetRolesOk() (*[]Role, bool)` +`func (o *RoleCollection) GetTotalEntriesOk() (*int32, bool)` -GetRolesOk returns a tuple with the Roles field if it's non-nil, zero value otherwise +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetRoles +### SetTotalEntries -`func (o *RoleCollection) SetRoles(v []Role)` +`func (o *RoleCollection) SetTotalEntries(v int32)` -SetRoles sets Roles field to given value. +SetTotalEntries sets TotalEntries field to given value. -### HasRoles +### HasTotalEntries -`func (o *RoleCollection) HasRoles() bool` +`func (o *RoleCollection) HasTotalEntries() bool` -HasRoles returns a boolean if a field has been set. +HasTotalEntries returns a boolean if a field has been set. -### GetTotalEntries +### GetRoles -`func (o *RoleCollection) GetTotalEntries() int32` +`func (o *RoleCollection) GetRoles() []Role` -GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. +GetRoles returns the Roles field if non-nil, zero value otherwise. -### GetTotalEntriesOk +### GetRolesOk -`func (o *RoleCollection) GetTotalEntriesOk() (*int32, bool)` +`func (o *RoleCollection) GetRolesOk() (*[]Role, bool)` -GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +GetRolesOk returns a tuple with the Roles field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTotalEntries +### SetRoles -`func (o *RoleCollection) SetTotalEntries(v int32)` +`func (o *RoleCollection) SetRoles(v []Role)` -SetTotalEntries sets TotalEntries field to given value. +SetRoles sets Roles field to given value. -### HasTotalEntries +### HasRoles -`func (o *RoleCollection) HasTotalEntries() bool` +`func (o *RoleCollection) HasRoles() bool` -HasTotalEntries returns a boolean if a field has been set. +HasRoles returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/SLAMiss.md b/airflow/docs/SLAMiss.md index 3738ba4..8a38057 100644 --- a/airflow/docs/SLAMiss.md +++ b/airflow/docs/SLAMiss.md @@ -1,35 +1,16 @@ - - # SLAMiss ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TaskId** | Pointer to **string** | The task ID. | [optional] [readonly] **DagId** | Pointer to **string** | The DAG ID. | [optional] -**ExecutionDate** | Pointer to **string** | | [optional] -**EmailSent** | Pointer to **bool** | | [optional] -**Timestamp** | Pointer to **string** | | [optional] **Description** | Pointer to **NullableString** | | [optional] +**EmailSent** | Pointer to **bool** | | [optional] +**ExecutionDate** | Pointer to **string** | | [optional] **NotificationSent** | Pointer to **bool** | | [optional] +**TaskId** | Pointer to **string** | The task ID. | [optional] [readonly] +**Timestamp** | Pointer to **string** | | [optional] ## Methods @@ -50,31 +31,6 @@ NewSLAMissWithDefaults instantiates a new SLAMiss object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetTaskId - -`func (o *SLAMiss) GetTaskId() string` - -GetTaskId returns the TaskId field if non-nil, zero value otherwise. - -### GetTaskIdOk - -`func (o *SLAMiss) GetTaskIdOk() (*string, bool)` - -GetTaskIdOk returns a tuple with the TaskId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTaskId - -`func (o *SLAMiss) SetTaskId(v string)` - -SetTaskId sets TaskId field to given value. - -### HasTaskId - -`func (o *SLAMiss) HasTaskId() bool` - -HasTaskId returns a boolean if a field has been set. - ### GetDagId `func (o *SLAMiss) GetDagId() string` @@ -100,31 +56,41 @@ SetDagId sets DagId field to given value. HasDagId returns a boolean if a field has been set. -### GetExecutionDate +### GetDescription -`func (o *SLAMiss) GetExecutionDate() string` +`func (o *SLAMiss) GetDescription() string` -GetExecutionDate returns the ExecutionDate field if non-nil, zero value otherwise. +GetDescription returns the Description field if non-nil, zero value otherwise. -### GetExecutionDateOk +### GetDescriptionOk -`func (o *SLAMiss) GetExecutionDateOk() (*string, bool)` +`func (o *SLAMiss) GetDescriptionOk() (*string, bool)` -GetExecutionDateOk returns a tuple with the ExecutionDate field if it's non-nil, zero value otherwise +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetExecutionDate +### SetDescription -`func (o *SLAMiss) SetExecutionDate(v string)` +`func (o *SLAMiss) SetDescription(v string)` -SetExecutionDate sets ExecutionDate field to given value. +SetDescription sets Description field to given value. -### HasExecutionDate +### HasDescription -`func (o *SLAMiss) HasExecutionDate() bool` +`func (o *SLAMiss) HasDescription() bool` -HasExecutionDate returns a boolean if a field has been set. +HasDescription returns a boolean if a field has been set. + +### SetDescriptionNil + +`func (o *SLAMiss) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *SLAMiss) UnsetDescription()` +UnsetDescription ensures that no value is present for Description, not even an explicit nil ### GetEmailSent `func (o *SLAMiss) GetEmailSent() bool` @@ -150,90 +116,105 @@ SetEmailSent sets EmailSent field to given value. HasEmailSent returns a boolean if a field has been set. -### GetTimestamp +### GetExecutionDate -`func (o *SLAMiss) GetTimestamp() string` +`func (o *SLAMiss) GetExecutionDate() string` -GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. +GetExecutionDate returns the ExecutionDate field if non-nil, zero value otherwise. -### GetTimestampOk +### GetExecutionDateOk -`func (o *SLAMiss) GetTimestampOk() (*string, bool)` +`func (o *SLAMiss) GetExecutionDateOk() (*string, bool)` -GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise +GetExecutionDateOk returns a tuple with the ExecutionDate field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTimestamp +### SetExecutionDate -`func (o *SLAMiss) SetTimestamp(v string)` +`func (o *SLAMiss) SetExecutionDate(v string)` -SetTimestamp sets Timestamp field to given value. +SetExecutionDate sets ExecutionDate field to given value. -### HasTimestamp +### HasExecutionDate -`func (o *SLAMiss) HasTimestamp() bool` +`func (o *SLAMiss) HasExecutionDate() bool` -HasTimestamp returns a boolean if a field has been set. +HasExecutionDate returns a boolean if a field has been set. -### GetDescription +### GetNotificationSent -`func (o *SLAMiss) GetDescription() string` +`func (o *SLAMiss) GetNotificationSent() bool` -GetDescription returns the Description field if non-nil, zero value otherwise. +GetNotificationSent returns the NotificationSent field if non-nil, zero value otherwise. -### GetDescriptionOk +### GetNotificationSentOk -`func (o *SLAMiss) GetDescriptionOk() (*string, bool)` +`func (o *SLAMiss) GetNotificationSentOk() (*bool, bool)` -GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +GetNotificationSentOk returns a tuple with the NotificationSent field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDescription +### SetNotificationSent -`func (o *SLAMiss) SetDescription(v string)` +`func (o *SLAMiss) SetNotificationSent(v bool)` -SetDescription sets Description field to given value. +SetNotificationSent sets NotificationSent field to given value. -### HasDescription +### HasNotificationSent -`func (o *SLAMiss) HasDescription() bool` +`func (o *SLAMiss) HasNotificationSent() bool` -HasDescription returns a boolean if a field has been set. +HasNotificationSent returns a boolean if a field has been set. -### SetDescriptionNil +### GetTaskId -`func (o *SLAMiss) SetDescriptionNil(b bool)` +`func (o *SLAMiss) GetTaskId() string` - SetDescriptionNil sets the value for Description to be an explicit nil +GetTaskId returns the TaskId field if non-nil, zero value otherwise. -### UnsetDescription -`func (o *SLAMiss) UnsetDescription()` +### GetTaskIdOk -UnsetDescription ensures that no value is present for Description, not even an explicit nil -### GetNotificationSent +`func (o *SLAMiss) GetTaskIdOk() (*string, bool)` -`func (o *SLAMiss) GetNotificationSent() bool` +GetTaskIdOk returns a tuple with the TaskId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. -GetNotificationSent returns the NotificationSent field if non-nil, zero value otherwise. +### SetTaskId -### GetNotificationSentOk +`func (o *SLAMiss) SetTaskId(v string)` -`func (o *SLAMiss) GetNotificationSentOk() (*bool, bool)` +SetTaskId sets TaskId field to given value. -GetNotificationSentOk returns a tuple with the NotificationSent field if it's non-nil, zero value otherwise +### HasTaskId + +`func (o *SLAMiss) HasTaskId() bool` + +HasTaskId returns a boolean if a field has been set. + +### GetTimestamp + +`func (o *SLAMiss) GetTimestamp() string` + +GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. + +### GetTimestampOk + +`func (o *SLAMiss) GetTimestampOk() (*string, bool)` + +GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetNotificationSent +### SetTimestamp -`func (o *SLAMiss) SetNotificationSent(v bool)` +`func (o *SLAMiss) SetTimestamp(v string)` -SetNotificationSent sets NotificationSent field to given value. +SetTimestamp sets Timestamp field to given value. -### HasNotificationSent +### HasTimestamp -`func (o *SLAMiss) HasNotificationSent() bool` +`func (o *SLAMiss) HasTimestamp() bool` -HasNotificationSent returns a boolean if a field has been set. +HasTimestamp returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/ScheduleInterval.md b/airflow/docs/ScheduleInterval.md index e1c3a29..760b192 100644 --- a/airflow/docs/ScheduleInterval.md +++ b/airflow/docs/ScheduleInterval.md @@ -1,22 +1,3 @@ - - # ScheduleInterval ## Properties @@ -25,27 +6,27 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Type** | **string** | | **Days** | **int32** | | -**Seconds** | **int32** | | **Microseconds** | **int32** | | -**Years** | **int32** | | -**Months** | **int32** | | -**Leapdays** | **int32** | | -**Hours** | **int32** | | -**Minutes** | **int32** | | -**Year** | **int32** | | -**Month** | **int32** | | +**Seconds** | **int32** | | **Day** | **int32** | | **Hour** | **int32** | | +**Hours** | **int32** | | +**Leapdays** | **int32** | | +**Microsecond** | **int32** | | **Minute** | **int32** | | +**Minutes** | **int32** | | +**Month** | **int32** | | +**Months** | **int32** | | **Second** | **int32** | | -**Microsecond** | **int32** | | +**Year** | **int32** | | +**Years** | **int32** | | **Value** | **string** | | ## Methods ### NewScheduleInterval -`func NewScheduleInterval(type_ string, days int32, seconds int32, microseconds int32, years int32, months int32, leapdays int32, hours int32, minutes int32, year int32, month int32, day int32, hour int32, minute int32, second int32, microsecond int32, value string, ) *ScheduleInterval` +`func NewScheduleInterval(type_ string, days int32, microseconds int32, seconds int32, day int32, hour int32, hours int32, leapdays int32, microsecond int32, minute int32, minutes int32, month int32, months int32, second int32, year int32, years int32, value string, ) *ScheduleInterval` NewScheduleInterval instantiates a new ScheduleInterval object This constructor will assign default values to properties that have it defined, @@ -100,26 +81,6 @@ and a boolean to check if the value has been set. SetDays sets Days field to given value. -### GetSeconds - -`func (o *ScheduleInterval) GetSeconds() int32` - -GetSeconds returns the Seconds field if non-nil, zero value otherwise. - -### GetSecondsOk - -`func (o *ScheduleInterval) GetSecondsOk() (*int32, bool)` - -GetSecondsOk returns a tuple with the Seconds field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSeconds - -`func (o *ScheduleInterval) SetSeconds(v int32)` - -SetSeconds sets Seconds field to given value. - - ### GetMicroseconds `func (o *ScheduleInterval) GetMicroseconds() int32` @@ -140,64 +101,64 @@ and a boolean to check if the value has been set. SetMicroseconds sets Microseconds field to given value. -### GetYears +### GetSeconds -`func (o *ScheduleInterval) GetYears() int32` +`func (o *ScheduleInterval) GetSeconds() int32` -GetYears returns the Years field if non-nil, zero value otherwise. +GetSeconds returns the Seconds field if non-nil, zero value otherwise. -### GetYearsOk +### GetSecondsOk -`func (o *ScheduleInterval) GetYearsOk() (*int32, bool)` +`func (o *ScheduleInterval) GetSecondsOk() (*int32, bool)` -GetYearsOk returns a tuple with the Years field if it's non-nil, zero value otherwise +GetSecondsOk returns a tuple with the Seconds field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetYears +### SetSeconds -`func (o *ScheduleInterval) SetYears(v int32)` +`func (o *ScheduleInterval) SetSeconds(v int32)` -SetYears sets Years field to given value. +SetSeconds sets Seconds field to given value. -### GetMonths +### GetDay -`func (o *ScheduleInterval) GetMonths() int32` +`func (o *ScheduleInterval) GetDay() int32` -GetMonths returns the Months field if non-nil, zero value otherwise. +GetDay returns the Day field if non-nil, zero value otherwise. -### GetMonthsOk +### GetDayOk -`func (o *ScheduleInterval) GetMonthsOk() (*int32, bool)` +`func (o *ScheduleInterval) GetDayOk() (*int32, bool)` -GetMonthsOk returns a tuple with the Months field if it's non-nil, zero value otherwise +GetDayOk returns a tuple with the Day field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetMonths +### SetDay -`func (o *ScheduleInterval) SetMonths(v int32)` +`func (o *ScheduleInterval) SetDay(v int32)` -SetMonths sets Months field to given value. +SetDay sets Day field to given value. -### GetLeapdays +### GetHour -`func (o *ScheduleInterval) GetLeapdays() int32` +`func (o *ScheduleInterval) GetHour() int32` -GetLeapdays returns the Leapdays field if non-nil, zero value otherwise. +GetHour returns the Hour field if non-nil, zero value otherwise. -### GetLeapdaysOk +### GetHourOk -`func (o *ScheduleInterval) GetLeapdaysOk() (*int32, bool)` +`func (o *ScheduleInterval) GetHourOk() (*int32, bool)` -GetLeapdaysOk returns a tuple with the Leapdays field if it's non-nil, zero value otherwise +GetHourOk returns a tuple with the Hour field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetLeapdays +### SetHour -`func (o *ScheduleInterval) SetLeapdays(v int32)` +`func (o *ScheduleInterval) SetHour(v int32)` -SetLeapdays sets Leapdays field to given value. +SetHour sets Hour field to given value. ### GetHours @@ -220,124 +181,124 @@ and a boolean to check if the value has been set. SetHours sets Hours field to given value. -### GetMinutes +### GetLeapdays -`func (o *ScheduleInterval) GetMinutes() int32` +`func (o *ScheduleInterval) GetLeapdays() int32` -GetMinutes returns the Minutes field if non-nil, zero value otherwise. +GetLeapdays returns the Leapdays field if non-nil, zero value otherwise. -### GetMinutesOk +### GetLeapdaysOk -`func (o *ScheduleInterval) GetMinutesOk() (*int32, bool)` +`func (o *ScheduleInterval) GetLeapdaysOk() (*int32, bool)` -GetMinutesOk returns a tuple with the Minutes field if it's non-nil, zero value otherwise +GetLeapdaysOk returns a tuple with the Leapdays field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetMinutes +### SetLeapdays -`func (o *ScheduleInterval) SetMinutes(v int32)` +`func (o *ScheduleInterval) SetLeapdays(v int32)` -SetMinutes sets Minutes field to given value. +SetLeapdays sets Leapdays field to given value. -### GetYear +### GetMicrosecond -`func (o *ScheduleInterval) GetYear() int32` +`func (o *ScheduleInterval) GetMicrosecond() int32` -GetYear returns the Year field if non-nil, zero value otherwise. +GetMicrosecond returns the Microsecond field if non-nil, zero value otherwise. -### GetYearOk +### GetMicrosecondOk -`func (o *ScheduleInterval) GetYearOk() (*int32, bool)` +`func (o *ScheduleInterval) GetMicrosecondOk() (*int32, bool)` -GetYearOk returns a tuple with the Year field if it's non-nil, zero value otherwise +GetMicrosecondOk returns a tuple with the Microsecond field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetYear +### SetMicrosecond -`func (o *ScheduleInterval) SetYear(v int32)` +`func (o *ScheduleInterval) SetMicrosecond(v int32)` -SetYear sets Year field to given value. +SetMicrosecond sets Microsecond field to given value. -### GetMonth +### GetMinute -`func (o *ScheduleInterval) GetMonth() int32` +`func (o *ScheduleInterval) GetMinute() int32` -GetMonth returns the Month field if non-nil, zero value otherwise. +GetMinute returns the Minute field if non-nil, zero value otherwise. -### GetMonthOk +### GetMinuteOk -`func (o *ScheduleInterval) GetMonthOk() (*int32, bool)` +`func (o *ScheduleInterval) GetMinuteOk() (*int32, bool)` -GetMonthOk returns a tuple with the Month field if it's non-nil, zero value otherwise +GetMinuteOk returns a tuple with the Minute field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetMonth +### SetMinute -`func (o *ScheduleInterval) SetMonth(v int32)` +`func (o *ScheduleInterval) SetMinute(v int32)` -SetMonth sets Month field to given value. +SetMinute sets Minute field to given value. -### GetDay +### GetMinutes -`func (o *ScheduleInterval) GetDay() int32` +`func (o *ScheduleInterval) GetMinutes() int32` -GetDay returns the Day field if non-nil, zero value otherwise. +GetMinutes returns the Minutes field if non-nil, zero value otherwise. -### GetDayOk +### GetMinutesOk -`func (o *ScheduleInterval) GetDayOk() (*int32, bool)` +`func (o *ScheduleInterval) GetMinutesOk() (*int32, bool)` -GetDayOk returns a tuple with the Day field if it's non-nil, zero value otherwise +GetMinutesOk returns a tuple with the Minutes field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDay +### SetMinutes -`func (o *ScheduleInterval) SetDay(v int32)` +`func (o *ScheduleInterval) SetMinutes(v int32)` -SetDay sets Day field to given value. +SetMinutes sets Minutes field to given value. -### GetHour +### GetMonth -`func (o *ScheduleInterval) GetHour() int32` +`func (o *ScheduleInterval) GetMonth() int32` -GetHour returns the Hour field if non-nil, zero value otherwise. +GetMonth returns the Month field if non-nil, zero value otherwise. -### GetHourOk +### GetMonthOk -`func (o *ScheduleInterval) GetHourOk() (*int32, bool)` +`func (o *ScheduleInterval) GetMonthOk() (*int32, bool)` -GetHourOk returns a tuple with the Hour field if it's non-nil, zero value otherwise +GetMonthOk returns a tuple with the Month field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetHour +### SetMonth -`func (o *ScheduleInterval) SetHour(v int32)` +`func (o *ScheduleInterval) SetMonth(v int32)` -SetHour sets Hour field to given value. +SetMonth sets Month field to given value. -### GetMinute +### GetMonths -`func (o *ScheduleInterval) GetMinute() int32` +`func (o *ScheduleInterval) GetMonths() int32` -GetMinute returns the Minute field if non-nil, zero value otherwise. +GetMonths returns the Months field if non-nil, zero value otherwise. -### GetMinuteOk +### GetMonthsOk -`func (o *ScheduleInterval) GetMinuteOk() (*int32, bool)` +`func (o *ScheduleInterval) GetMonthsOk() (*int32, bool)` -GetMinuteOk returns a tuple with the Minute field if it's non-nil, zero value otherwise +GetMonthsOk returns a tuple with the Months field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetMinute +### SetMonths -`func (o *ScheduleInterval) SetMinute(v int32)` +`func (o *ScheduleInterval) SetMonths(v int32)` -SetMinute sets Minute field to given value. +SetMonths sets Months field to given value. ### GetSecond @@ -360,24 +321,44 @@ and a boolean to check if the value has been set. SetSecond sets Second field to given value. -### GetMicrosecond +### GetYear -`func (o *ScheduleInterval) GetMicrosecond() int32` +`func (o *ScheduleInterval) GetYear() int32` -GetMicrosecond returns the Microsecond field if non-nil, zero value otherwise. +GetYear returns the Year field if non-nil, zero value otherwise. -### GetMicrosecondOk +### GetYearOk -`func (o *ScheduleInterval) GetMicrosecondOk() (*int32, bool)` +`func (o *ScheduleInterval) GetYearOk() (*int32, bool)` -GetMicrosecondOk returns a tuple with the Microsecond field if it's non-nil, zero value otherwise +GetYearOk returns a tuple with the Year field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetMicrosecond +### SetYear -`func (o *ScheduleInterval) SetMicrosecond(v int32)` +`func (o *ScheduleInterval) SetYear(v int32)` -SetMicrosecond sets Microsecond field to given value. +SetYear sets Year field to given value. + + +### GetYears + +`func (o *ScheduleInterval) GetYears() int32` + +GetYears returns the Years field if non-nil, zero value otherwise. + +### GetYearsOk + +`func (o *ScheduleInterval) GetYearsOk() (*int32, bool)` + +GetYearsOk returns a tuple with the Years field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetYears + +`func (o *ScheduleInterval) SetYears(v int32)` + +SetYears sets Years field to given value. ### GetValue diff --git a/airflow/docs/SchedulerStatus.md b/airflow/docs/SchedulerStatus.md index 23222ea..7c361c0 100644 --- a/airflow/docs/SchedulerStatus.md +++ b/airflow/docs/SchedulerStatus.md @@ -1,30 +1,11 @@ - - # SchedulerStatus ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Status** | Pointer to [**HealthStatus**](HealthStatus.md) | | [optional] -**LatestSchedulerHeartbeat** | Pointer to **NullableString** | The time the scheduler last do a heartbeat. | [optional] [readonly] +**LatestSchedulerHeartbeat** | Pointer to **NullableString** | The time the scheduler last did a heartbeat. | [optional] [readonly] +**Status** | Pointer to [**NullableHealthStatus**](HealthStatus.md) | | [optional] ## Methods @@ -45,31 +26,6 @@ NewSchedulerStatusWithDefaults instantiates a new SchedulerStatus object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetStatus - -`func (o *SchedulerStatus) GetStatus() HealthStatus` - -GetStatus returns the Status field if non-nil, zero value otherwise. - -### GetStatusOk - -`func (o *SchedulerStatus) GetStatusOk() (*HealthStatus, bool)` - -GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStatus - -`func (o *SchedulerStatus) SetStatus(v HealthStatus)` - -SetStatus sets Status field to given value. - -### HasStatus - -`func (o *SchedulerStatus) HasStatus() bool` - -HasStatus returns a boolean if a field has been set. - ### GetLatestSchedulerHeartbeat `func (o *SchedulerStatus) GetLatestSchedulerHeartbeat() string` @@ -105,6 +61,41 @@ HasLatestSchedulerHeartbeat returns a boolean if a field has been set. `func (o *SchedulerStatus) UnsetLatestSchedulerHeartbeat()` UnsetLatestSchedulerHeartbeat ensures that no value is present for LatestSchedulerHeartbeat, not even an explicit nil +### GetStatus + +`func (o *SchedulerStatus) GetStatus() HealthStatus` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *SchedulerStatus) GetStatusOk() (*HealthStatus, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *SchedulerStatus) SetStatus(v HealthStatus)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *SchedulerStatus) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### SetStatusNil + +`func (o *SchedulerStatus) SetStatusNil(b bool)` + + SetStatusNil sets the value for Status to be an explicit nil + +### UnsetStatus +`func (o *SchedulerStatus) UnsetStatus()` + +UnsetStatus ensures that no value is present for Status, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/SetDagRunNote.md b/airflow/docs/SetDagRunNote.md index 64f74f9..2119b40 100644 --- a/airflow/docs/SetDagRunNote.md +++ b/airflow/docs/SetDagRunNote.md @@ -1,22 +1,3 @@ - - # SetDagRunNote ## Properties diff --git a/airflow/docs/SetTaskInstanceNote.md b/airflow/docs/SetTaskInstanceNote.md index f97c47b..f1a58a1 100644 --- a/airflow/docs/SetTaskInstanceNote.md +++ b/airflow/docs/SetTaskInstanceNote.md @@ -1,22 +1,3 @@ - - # SetTaskInstanceNote ## Properties diff --git a/airflow/docs/Tag.md b/airflow/docs/Tag.md index 2a39a38..3f123c2 100644 --- a/airflow/docs/Tag.md +++ b/airflow/docs/Tag.md @@ -1,22 +1,3 @@ - - # Tag ## Properties diff --git a/airflow/docs/Task.md b/airflow/docs/Task.md index d0f1f67..7cd44a0 100644 --- a/airflow/docs/Task.md +++ b/airflow/docs/Task.md @@ -1,22 +1,3 @@ - - # Task ## Properties @@ -24,29 +5,32 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **ClassRef** | Pointer to [**ClassReference**](ClassReference.md) | | [optional] -**TaskId** | Pointer to **string** | | [optional] [readonly] -**Owner** | Pointer to **string** | | [optional] [readonly] -**StartDate** | Pointer to **time.Time** | | [optional] [readonly] -**EndDate** | Pointer to **NullableTime** | | [optional] [readonly] -**TriggerRule** | Pointer to [**TriggerRule**](TriggerRule.md) | | [optional] -**ExtraLinks** | Pointer to [**[]TaskExtraLinks**](TaskExtraLinks.md) | | [optional] [readonly] **DependsOnPast** | Pointer to **bool** | | [optional] [readonly] +**DocMd** | Pointer to **NullableString** | Task documentation in markdown. *New in version 2.10.0* | [optional] [readonly] +**DownstreamTaskIds** | Pointer to **[]string** | | [optional] [readonly] +**EndDate** | Pointer to **NullableTime** | | [optional] [readonly] +**ExecutionTimeout** | Pointer to [**NullableTimeDelta**](TimeDelta.md) | | [optional] +**Executor** | Pointer to **NullableString** | | [optional] [readonly] +**ExtraLinks** | Pointer to [**[]TaskExtraLinksInner**](TaskExtraLinksInner.md) | | [optional] [readonly] **IsMapped** | Pointer to **bool** | | [optional] [readonly] -**WaitForDownstream** | Pointer to **bool** | | [optional] [readonly] -**Retries** | Pointer to **float32** | | [optional] [readonly] -**Queue** | Pointer to **NullableString** | | [optional] [readonly] +**Owner** | Pointer to **string** | | [optional] [readonly] **Pool** | Pointer to **string** | | [optional] [readonly] **PoolSlots** | Pointer to **float32** | | [optional] [readonly] -**ExecutionTimeout** | Pointer to [**TimeDelta**](TimeDelta.md) | | [optional] -**RetryDelay** | Pointer to [**TimeDelta**](TimeDelta.md) | | [optional] -**RetryExponentialBackoff** | Pointer to **bool** | | [optional] [readonly] **PriorityWeight** | Pointer to **float32** | | [optional] [readonly] -**WeightRule** | Pointer to [**WeightRule**](WeightRule.md) | | [optional] +**Queue** | Pointer to **NullableString** | | [optional] [readonly] +**Retries** | Pointer to **float32** | | [optional] [readonly] +**RetryDelay** | Pointer to [**NullableTimeDelta**](TimeDelta.md) | | [optional] +**RetryExponentialBackoff** | Pointer to **bool** | | [optional] [readonly] +**StartDate** | Pointer to **NullableTime** | | [optional] [readonly] +**SubDag** | Pointer to [**DAG**](DAG.md) | | [optional] +**TaskDisplayName** | Pointer to **string** | | [optional] [readonly] +**TaskId** | Pointer to **string** | | [optional] [readonly] +**TemplateFields** | Pointer to **[]string** | | [optional] [readonly] +**TriggerRule** | Pointer to [**TriggerRule**](TriggerRule.md) | | [optional] **UiColor** | Pointer to **string** | Color in hexadecimal notation. | [optional] **UiFgcolor** | Pointer to **string** | Color in hexadecimal notation. | [optional] -**TemplateFields** | Pointer to **[]string** | | [optional] [readonly] -**SubDag** | Pointer to [**DAG**](DAG.md) | | [optional] -**DownstreamTaskIds** | Pointer to **[]string** | | [optional] [readonly] +**WaitForDownstream** | Pointer to **bool** | | [optional] [readonly] +**WeightRule** | Pointer to [**WeightRule**](WeightRule.md) | | [optional] ## Methods @@ -92,80 +76,90 @@ SetClassRef sets ClassRef field to given value. HasClassRef returns a boolean if a field has been set. -### GetTaskId +### GetDependsOnPast -`func (o *Task) GetTaskId() string` +`func (o *Task) GetDependsOnPast() bool` -GetTaskId returns the TaskId field if non-nil, zero value otherwise. +GetDependsOnPast returns the DependsOnPast field if non-nil, zero value otherwise. -### GetTaskIdOk +### GetDependsOnPastOk -`func (o *Task) GetTaskIdOk() (*string, bool)` +`func (o *Task) GetDependsOnPastOk() (*bool, bool)` -GetTaskIdOk returns a tuple with the TaskId field if it's non-nil, zero value otherwise +GetDependsOnPastOk returns a tuple with the DependsOnPast field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTaskId +### SetDependsOnPast -`func (o *Task) SetTaskId(v string)` +`func (o *Task) SetDependsOnPast(v bool)` -SetTaskId sets TaskId field to given value. +SetDependsOnPast sets DependsOnPast field to given value. -### HasTaskId +### HasDependsOnPast -`func (o *Task) HasTaskId() bool` +`func (o *Task) HasDependsOnPast() bool` -HasTaskId returns a boolean if a field has been set. +HasDependsOnPast returns a boolean if a field has been set. -### GetOwner +### GetDocMd -`func (o *Task) GetOwner() string` +`func (o *Task) GetDocMd() string` -GetOwner returns the Owner field if non-nil, zero value otherwise. +GetDocMd returns the DocMd field if non-nil, zero value otherwise. -### GetOwnerOk +### GetDocMdOk -`func (o *Task) GetOwnerOk() (*string, bool)` +`func (o *Task) GetDocMdOk() (*string, bool)` -GetOwnerOk returns a tuple with the Owner field if it's non-nil, zero value otherwise +GetDocMdOk returns a tuple with the DocMd field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetOwner +### SetDocMd -`func (o *Task) SetOwner(v string)` +`func (o *Task) SetDocMd(v string)` -SetOwner sets Owner field to given value. +SetDocMd sets DocMd field to given value. -### HasOwner +### HasDocMd -`func (o *Task) HasOwner() bool` +`func (o *Task) HasDocMd() bool` -HasOwner returns a boolean if a field has been set. +HasDocMd returns a boolean if a field has been set. -### GetStartDate +### SetDocMdNil -`func (o *Task) GetStartDate() time.Time` +`func (o *Task) SetDocMdNil(b bool)` -GetStartDate returns the StartDate field if non-nil, zero value otherwise. + SetDocMdNil sets the value for DocMd to be an explicit nil -### GetStartDateOk +### UnsetDocMd +`func (o *Task) UnsetDocMd()` -`func (o *Task) GetStartDateOk() (*time.Time, bool)` +UnsetDocMd ensures that no value is present for DocMd, not even an explicit nil +### GetDownstreamTaskIds -GetStartDateOk returns a tuple with the StartDate field if it's non-nil, zero value otherwise +`func (o *Task) GetDownstreamTaskIds() []string` + +GetDownstreamTaskIds returns the DownstreamTaskIds field if non-nil, zero value otherwise. + +### GetDownstreamTaskIdsOk + +`func (o *Task) GetDownstreamTaskIdsOk() (*[]string, bool)` + +GetDownstreamTaskIdsOk returns a tuple with the DownstreamTaskIds field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetStartDate +### SetDownstreamTaskIds -`func (o *Task) SetStartDate(v time.Time)` +`func (o *Task) SetDownstreamTaskIds(v []string)` -SetStartDate sets StartDate field to given value. +SetDownstreamTaskIds sets DownstreamTaskIds field to given value. -### HasStartDate +### HasDownstreamTaskIds -`func (o *Task) HasStartDate() bool` +`func (o *Task) HasDownstreamTaskIds() bool` -HasStartDate returns a boolean if a field has been set. +HasDownstreamTaskIds returns a boolean if a field has been set. ### GetEndDate @@ -202,80 +196,100 @@ HasEndDate returns a boolean if a field has been set. `func (o *Task) UnsetEndDate()` UnsetEndDate ensures that no value is present for EndDate, not even an explicit nil -### GetTriggerRule +### GetExecutionTimeout -`func (o *Task) GetTriggerRule() TriggerRule` +`func (o *Task) GetExecutionTimeout() TimeDelta` -GetTriggerRule returns the TriggerRule field if non-nil, zero value otherwise. +GetExecutionTimeout returns the ExecutionTimeout field if non-nil, zero value otherwise. -### GetTriggerRuleOk +### GetExecutionTimeoutOk -`func (o *Task) GetTriggerRuleOk() (*TriggerRule, bool)` +`func (o *Task) GetExecutionTimeoutOk() (*TimeDelta, bool)` -GetTriggerRuleOk returns a tuple with the TriggerRule field if it's non-nil, zero value otherwise +GetExecutionTimeoutOk returns a tuple with the ExecutionTimeout field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTriggerRule +### SetExecutionTimeout -`func (o *Task) SetTriggerRule(v TriggerRule)` +`func (o *Task) SetExecutionTimeout(v TimeDelta)` -SetTriggerRule sets TriggerRule field to given value. +SetExecutionTimeout sets ExecutionTimeout field to given value. -### HasTriggerRule +### HasExecutionTimeout -`func (o *Task) HasTriggerRule() bool` +`func (o *Task) HasExecutionTimeout() bool` -HasTriggerRule returns a boolean if a field has been set. +HasExecutionTimeout returns a boolean if a field has been set. -### GetExtraLinks +### SetExecutionTimeoutNil -`func (o *Task) GetExtraLinks() []TaskExtraLinks` +`func (o *Task) SetExecutionTimeoutNil(b bool)` -GetExtraLinks returns the ExtraLinks field if non-nil, zero value otherwise. + SetExecutionTimeoutNil sets the value for ExecutionTimeout to be an explicit nil -### GetExtraLinksOk +### UnsetExecutionTimeout +`func (o *Task) UnsetExecutionTimeout()` -`func (o *Task) GetExtraLinksOk() (*[]TaskExtraLinks, bool)` +UnsetExecutionTimeout ensures that no value is present for ExecutionTimeout, not even an explicit nil +### GetExecutor -GetExtraLinksOk returns a tuple with the ExtraLinks field if it's non-nil, zero value otherwise +`func (o *Task) GetExecutor() string` + +GetExecutor returns the Executor field if non-nil, zero value otherwise. + +### GetExecutorOk + +`func (o *Task) GetExecutorOk() (*string, bool)` + +GetExecutorOk returns a tuple with the Executor field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetExtraLinks +### SetExecutor -`func (o *Task) SetExtraLinks(v []TaskExtraLinks)` +`func (o *Task) SetExecutor(v string)` -SetExtraLinks sets ExtraLinks field to given value. +SetExecutor sets Executor field to given value. -### HasExtraLinks +### HasExecutor -`func (o *Task) HasExtraLinks() bool` +`func (o *Task) HasExecutor() bool` -HasExtraLinks returns a boolean if a field has been set. +HasExecutor returns a boolean if a field has been set. -### GetDependsOnPast +### SetExecutorNil -`func (o *Task) GetDependsOnPast() bool` +`func (o *Task) SetExecutorNil(b bool)` -GetDependsOnPast returns the DependsOnPast field if non-nil, zero value otherwise. + SetExecutorNil sets the value for Executor to be an explicit nil -### GetDependsOnPastOk +### UnsetExecutor +`func (o *Task) UnsetExecutor()` -`func (o *Task) GetDependsOnPastOk() (*bool, bool)` +UnsetExecutor ensures that no value is present for Executor, not even an explicit nil +### GetExtraLinks -GetDependsOnPastOk returns a tuple with the DependsOnPast field if it's non-nil, zero value otherwise +`func (o *Task) GetExtraLinks() []TaskExtraLinksInner` + +GetExtraLinks returns the ExtraLinks field if non-nil, zero value otherwise. + +### GetExtraLinksOk + +`func (o *Task) GetExtraLinksOk() (*[]TaskExtraLinksInner, bool)` + +GetExtraLinksOk returns a tuple with the ExtraLinks field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDependsOnPast +### SetExtraLinks -`func (o *Task) SetDependsOnPast(v bool)` +`func (o *Task) SetExtraLinks(v []TaskExtraLinksInner)` -SetDependsOnPast sets DependsOnPast field to given value. +SetExtraLinks sets ExtraLinks field to given value. -### HasDependsOnPast +### HasExtraLinks -`func (o *Task) HasDependsOnPast() bool` +`func (o *Task) HasExtraLinks() bool` -HasDependsOnPast returns a boolean if a field has been set. +HasExtraLinks returns a boolean if a field has been set. ### GetIsMapped @@ -302,91 +316,31 @@ SetIsMapped sets IsMapped field to given value. HasIsMapped returns a boolean if a field has been set. -### GetWaitForDownstream - -`func (o *Task) GetWaitForDownstream() bool` - -GetWaitForDownstream returns the WaitForDownstream field if non-nil, zero value otherwise. - -### GetWaitForDownstreamOk - -`func (o *Task) GetWaitForDownstreamOk() (*bool, bool)` - -GetWaitForDownstreamOk returns a tuple with the WaitForDownstream field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetWaitForDownstream - -`func (o *Task) SetWaitForDownstream(v bool)` - -SetWaitForDownstream sets WaitForDownstream field to given value. - -### HasWaitForDownstream - -`func (o *Task) HasWaitForDownstream() bool` - -HasWaitForDownstream returns a boolean if a field has been set. - -### GetRetries - -`func (o *Task) GetRetries() float32` - -GetRetries returns the Retries field if non-nil, zero value otherwise. - -### GetRetriesOk - -`func (o *Task) GetRetriesOk() (*float32, bool)` - -GetRetriesOk returns a tuple with the Retries field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRetries - -`func (o *Task) SetRetries(v float32)` - -SetRetries sets Retries field to given value. - -### HasRetries - -`func (o *Task) HasRetries() bool` - -HasRetries returns a boolean if a field has been set. - -### GetQueue +### GetOwner -`func (o *Task) GetQueue() string` +`func (o *Task) GetOwner() string` -GetQueue returns the Queue field if non-nil, zero value otherwise. +GetOwner returns the Owner field if non-nil, zero value otherwise. -### GetQueueOk +### GetOwnerOk -`func (o *Task) GetQueueOk() (*string, bool)` +`func (o *Task) GetOwnerOk() (*string, bool)` -GetQueueOk returns a tuple with the Queue field if it's non-nil, zero value otherwise +GetOwnerOk returns a tuple with the Owner field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetQueue - -`func (o *Task) SetQueue(v string)` - -SetQueue sets Queue field to given value. - -### HasQueue - -`func (o *Task) HasQueue() bool` +### SetOwner -HasQueue returns a boolean if a field has been set. +`func (o *Task) SetOwner(v string)` -### SetQueueNil +SetOwner sets Owner field to given value. -`func (o *Task) SetQueueNil(b bool)` +### HasOwner - SetQueueNil sets the value for Queue to be an explicit nil +`func (o *Task) HasOwner() bool` -### UnsetQueue -`func (o *Task) UnsetQueue()` +HasOwner returns a boolean if a field has been set. -UnsetQueue ensures that no value is present for Queue, not even an explicit nil ### GetPool `func (o *Task) GetPool() string` @@ -437,30 +391,90 @@ SetPoolSlots sets PoolSlots field to given value. HasPoolSlots returns a boolean if a field has been set. -### GetExecutionTimeout +### GetPriorityWeight -`func (o *Task) GetExecutionTimeout() TimeDelta` +`func (o *Task) GetPriorityWeight() float32` -GetExecutionTimeout returns the ExecutionTimeout field if non-nil, zero value otherwise. +GetPriorityWeight returns the PriorityWeight field if non-nil, zero value otherwise. -### GetExecutionTimeoutOk +### GetPriorityWeightOk -`func (o *Task) GetExecutionTimeoutOk() (*TimeDelta, bool)` +`func (o *Task) GetPriorityWeightOk() (*float32, bool)` -GetExecutionTimeoutOk returns a tuple with the ExecutionTimeout field if it's non-nil, zero value otherwise +GetPriorityWeightOk returns a tuple with the PriorityWeight field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetExecutionTimeout +### SetPriorityWeight -`func (o *Task) SetExecutionTimeout(v TimeDelta)` +`func (o *Task) SetPriorityWeight(v float32)` -SetExecutionTimeout sets ExecutionTimeout field to given value. +SetPriorityWeight sets PriorityWeight field to given value. -### HasExecutionTimeout +### HasPriorityWeight -`func (o *Task) HasExecutionTimeout() bool` +`func (o *Task) HasPriorityWeight() bool` -HasExecutionTimeout returns a boolean if a field has been set. +HasPriorityWeight returns a boolean if a field has been set. + +### GetQueue + +`func (o *Task) GetQueue() string` + +GetQueue returns the Queue field if non-nil, zero value otherwise. + +### GetQueueOk + +`func (o *Task) GetQueueOk() (*string, bool)` + +GetQueueOk returns a tuple with the Queue field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQueue + +`func (o *Task) SetQueue(v string)` + +SetQueue sets Queue field to given value. + +### HasQueue + +`func (o *Task) HasQueue() bool` + +HasQueue returns a boolean if a field has been set. + +### SetQueueNil + +`func (o *Task) SetQueueNil(b bool)` + + SetQueueNil sets the value for Queue to be an explicit nil + +### UnsetQueue +`func (o *Task) UnsetQueue()` + +UnsetQueue ensures that no value is present for Queue, not even an explicit nil +### GetRetries + +`func (o *Task) GetRetries() float32` + +GetRetries returns the Retries field if non-nil, zero value otherwise. + +### GetRetriesOk + +`func (o *Task) GetRetriesOk() (*float32, bool)` + +GetRetriesOk returns a tuple with the Retries field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRetries + +`func (o *Task) SetRetries(v float32)` + +SetRetries sets Retries field to given value. + +### HasRetries + +`func (o *Task) HasRetries() bool` + +HasRetries returns a boolean if a field has been set. ### GetRetryDelay @@ -487,6 +501,16 @@ SetRetryDelay sets RetryDelay field to given value. HasRetryDelay returns a boolean if a field has been set. +### SetRetryDelayNil + +`func (o *Task) SetRetryDelayNil(b bool)` + + SetRetryDelayNil sets the value for RetryDelay to be an explicit nil + +### UnsetRetryDelay +`func (o *Task) UnsetRetryDelay()` + +UnsetRetryDelay ensures that no value is present for RetryDelay, not even an explicit nil ### GetRetryExponentialBackoff `func (o *Task) GetRetryExponentialBackoff() bool` @@ -512,105 +536,115 @@ SetRetryExponentialBackoff sets RetryExponentialBackoff field to given value. HasRetryExponentialBackoff returns a boolean if a field has been set. -### GetPriorityWeight +### GetStartDate -`func (o *Task) GetPriorityWeight() float32` +`func (o *Task) GetStartDate() time.Time` -GetPriorityWeight returns the PriorityWeight field if non-nil, zero value otherwise. +GetStartDate returns the StartDate field if non-nil, zero value otherwise. -### GetPriorityWeightOk +### GetStartDateOk -`func (o *Task) GetPriorityWeightOk() (*float32, bool)` +`func (o *Task) GetStartDateOk() (*time.Time, bool)` -GetPriorityWeightOk returns a tuple with the PriorityWeight field if it's non-nil, zero value otherwise +GetStartDateOk returns a tuple with the StartDate field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetPriorityWeight +### SetStartDate -`func (o *Task) SetPriorityWeight(v float32)` +`func (o *Task) SetStartDate(v time.Time)` -SetPriorityWeight sets PriorityWeight field to given value. +SetStartDate sets StartDate field to given value. -### HasPriorityWeight +### HasStartDate -`func (o *Task) HasPriorityWeight() bool` +`func (o *Task) HasStartDate() bool` -HasPriorityWeight returns a boolean if a field has been set. +HasStartDate returns a boolean if a field has been set. -### GetWeightRule +### SetStartDateNil -`func (o *Task) GetWeightRule() WeightRule` +`func (o *Task) SetStartDateNil(b bool)` -GetWeightRule returns the WeightRule field if non-nil, zero value otherwise. + SetStartDateNil sets the value for StartDate to be an explicit nil -### GetWeightRuleOk +### UnsetStartDate +`func (o *Task) UnsetStartDate()` -`func (o *Task) GetWeightRuleOk() (*WeightRule, bool)` +UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil +### GetSubDag -GetWeightRuleOk returns a tuple with the WeightRule field if it's non-nil, zero value otherwise +`func (o *Task) GetSubDag() DAG` + +GetSubDag returns the SubDag field if non-nil, zero value otherwise. + +### GetSubDagOk + +`func (o *Task) GetSubDagOk() (*DAG, bool)` + +GetSubDagOk returns a tuple with the SubDag field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetWeightRule +### SetSubDag -`func (o *Task) SetWeightRule(v WeightRule)` +`func (o *Task) SetSubDag(v DAG)` -SetWeightRule sets WeightRule field to given value. +SetSubDag sets SubDag field to given value. -### HasWeightRule +### HasSubDag -`func (o *Task) HasWeightRule() bool` +`func (o *Task) HasSubDag() bool` -HasWeightRule returns a boolean if a field has been set. +HasSubDag returns a boolean if a field has been set. -### GetUiColor +### GetTaskDisplayName -`func (o *Task) GetUiColor() string` +`func (o *Task) GetTaskDisplayName() string` -GetUiColor returns the UiColor field if non-nil, zero value otherwise. +GetTaskDisplayName returns the TaskDisplayName field if non-nil, zero value otherwise. -### GetUiColorOk +### GetTaskDisplayNameOk -`func (o *Task) GetUiColorOk() (*string, bool)` +`func (o *Task) GetTaskDisplayNameOk() (*string, bool)` -GetUiColorOk returns a tuple with the UiColor field if it's non-nil, zero value otherwise +GetTaskDisplayNameOk returns a tuple with the TaskDisplayName field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetUiColor +### SetTaskDisplayName -`func (o *Task) SetUiColor(v string)` +`func (o *Task) SetTaskDisplayName(v string)` -SetUiColor sets UiColor field to given value. +SetTaskDisplayName sets TaskDisplayName field to given value. -### HasUiColor +### HasTaskDisplayName -`func (o *Task) HasUiColor() bool` +`func (o *Task) HasTaskDisplayName() bool` -HasUiColor returns a boolean if a field has been set. +HasTaskDisplayName returns a boolean if a field has been set. -### GetUiFgcolor +### GetTaskId -`func (o *Task) GetUiFgcolor() string` +`func (o *Task) GetTaskId() string` -GetUiFgcolor returns the UiFgcolor field if non-nil, zero value otherwise. +GetTaskId returns the TaskId field if non-nil, zero value otherwise. -### GetUiFgcolorOk +### GetTaskIdOk -`func (o *Task) GetUiFgcolorOk() (*string, bool)` +`func (o *Task) GetTaskIdOk() (*string, bool)` -GetUiFgcolorOk returns a tuple with the UiFgcolor field if it's non-nil, zero value otherwise +GetTaskIdOk returns a tuple with the TaskId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetUiFgcolor +### SetTaskId -`func (o *Task) SetUiFgcolor(v string)` +`func (o *Task) SetTaskId(v string)` -SetUiFgcolor sets UiFgcolor field to given value. +SetTaskId sets TaskId field to given value. -### HasUiFgcolor +### HasTaskId -`func (o *Task) HasUiFgcolor() bool` +`func (o *Task) HasTaskId() bool` -HasUiFgcolor returns a boolean if a field has been set. +HasTaskId returns a boolean if a field has been set. ### GetTemplateFields @@ -637,55 +671,130 @@ SetTemplateFields sets TemplateFields field to given value. HasTemplateFields returns a boolean if a field has been set. -### GetSubDag +### GetTriggerRule -`func (o *Task) GetSubDag() DAG` +`func (o *Task) GetTriggerRule() TriggerRule` -GetSubDag returns the SubDag field if non-nil, zero value otherwise. +GetTriggerRule returns the TriggerRule field if non-nil, zero value otherwise. -### GetSubDagOk +### GetTriggerRuleOk -`func (o *Task) GetSubDagOk() (*DAG, bool)` +`func (o *Task) GetTriggerRuleOk() (*TriggerRule, bool)` -GetSubDagOk returns a tuple with the SubDag field if it's non-nil, zero value otherwise +GetTriggerRuleOk returns a tuple with the TriggerRule field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetSubDag +### SetTriggerRule -`func (o *Task) SetSubDag(v DAG)` +`func (o *Task) SetTriggerRule(v TriggerRule)` -SetSubDag sets SubDag field to given value. +SetTriggerRule sets TriggerRule field to given value. -### HasSubDag +### HasTriggerRule -`func (o *Task) HasSubDag() bool` +`func (o *Task) HasTriggerRule() bool` -HasSubDag returns a boolean if a field has been set. +HasTriggerRule returns a boolean if a field has been set. -### GetDownstreamTaskIds +### GetUiColor -`func (o *Task) GetDownstreamTaskIds() []string` +`func (o *Task) GetUiColor() string` -GetDownstreamTaskIds returns the DownstreamTaskIds field if non-nil, zero value otherwise. +GetUiColor returns the UiColor field if non-nil, zero value otherwise. -### GetDownstreamTaskIdsOk +### GetUiColorOk -`func (o *Task) GetDownstreamTaskIdsOk() (*[]string, bool)` +`func (o *Task) GetUiColorOk() (*string, bool)` -GetDownstreamTaskIdsOk returns a tuple with the DownstreamTaskIds field if it's non-nil, zero value otherwise +GetUiColorOk returns a tuple with the UiColor field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDownstreamTaskIds +### SetUiColor -`func (o *Task) SetDownstreamTaskIds(v []string)` +`func (o *Task) SetUiColor(v string)` -SetDownstreamTaskIds sets DownstreamTaskIds field to given value. +SetUiColor sets UiColor field to given value. -### HasDownstreamTaskIds +### HasUiColor -`func (o *Task) HasDownstreamTaskIds() bool` +`func (o *Task) HasUiColor() bool` -HasDownstreamTaskIds returns a boolean if a field has been set. +HasUiColor returns a boolean if a field has been set. + +### GetUiFgcolor + +`func (o *Task) GetUiFgcolor() string` + +GetUiFgcolor returns the UiFgcolor field if non-nil, zero value otherwise. + +### GetUiFgcolorOk + +`func (o *Task) GetUiFgcolorOk() (*string, bool)` + +GetUiFgcolorOk returns a tuple with the UiFgcolor field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUiFgcolor + +`func (o *Task) SetUiFgcolor(v string)` + +SetUiFgcolor sets UiFgcolor field to given value. + +### HasUiFgcolor + +`func (o *Task) HasUiFgcolor() bool` + +HasUiFgcolor returns a boolean if a field has been set. + +### GetWaitForDownstream + +`func (o *Task) GetWaitForDownstream() bool` + +GetWaitForDownstream returns the WaitForDownstream field if non-nil, zero value otherwise. + +### GetWaitForDownstreamOk + +`func (o *Task) GetWaitForDownstreamOk() (*bool, bool)` + +GetWaitForDownstreamOk returns a tuple with the WaitForDownstream field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWaitForDownstream + +`func (o *Task) SetWaitForDownstream(v bool)` + +SetWaitForDownstream sets WaitForDownstream field to given value. + +### HasWaitForDownstream + +`func (o *Task) HasWaitForDownstream() bool` + +HasWaitForDownstream returns a boolean if a field has been set. + +### GetWeightRule + +`func (o *Task) GetWeightRule() WeightRule` + +GetWeightRule returns the WeightRule field if non-nil, zero value otherwise. + +### GetWeightRuleOk + +`func (o *Task) GetWeightRuleOk() (*WeightRule, bool)` + +GetWeightRuleOk returns a tuple with the WeightRule field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWeightRule + +`func (o *Task) SetWeightRule(v WeightRule)` + +SetWeightRule sets WeightRule field to given value. + +### HasWeightRule + +`func (o *Task) HasWeightRule() bool` + +HasWeightRule returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/TaskCollection.md b/airflow/docs/TaskCollection.md index e372209..80e0320 100644 --- a/airflow/docs/TaskCollection.md +++ b/airflow/docs/TaskCollection.md @@ -1,22 +1,3 @@ - - # TaskCollection ## Properties diff --git a/airflow/docs/TaskExtraLinksInner.md b/airflow/docs/TaskExtraLinksInner.md new file mode 100644 index 0000000..542549d --- /dev/null +++ b/airflow/docs/TaskExtraLinksInner.md @@ -0,0 +1,56 @@ +# TaskExtraLinksInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassRef** | Pointer to [**ClassReference**](ClassReference.md) | | [optional] + +## Methods + +### NewTaskExtraLinksInner + +`func NewTaskExtraLinksInner() *TaskExtraLinksInner` + +NewTaskExtraLinksInner instantiates a new TaskExtraLinksInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTaskExtraLinksInnerWithDefaults + +`func NewTaskExtraLinksInnerWithDefaults() *TaskExtraLinksInner` + +NewTaskExtraLinksInnerWithDefaults instantiates a new TaskExtraLinksInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetClassRef + +`func (o *TaskExtraLinksInner) GetClassRef() ClassReference` + +GetClassRef returns the ClassRef field if non-nil, zero value otherwise. + +### GetClassRefOk + +`func (o *TaskExtraLinksInner) GetClassRefOk() (*ClassReference, bool)` + +GetClassRefOk returns a tuple with the ClassRef field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClassRef + +`func (o *TaskExtraLinksInner) SetClassRef(v ClassReference)` + +SetClassRef sets ClassRef field to given value. + +### HasClassRef + +`func (o *TaskExtraLinksInner) HasClassRef() bool` + +HasClassRef returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/docs/TaskFailedDependency.md b/airflow/docs/TaskFailedDependency.md new file mode 100644 index 0000000..a0af8da --- /dev/null +++ b/airflow/docs/TaskFailedDependency.md @@ -0,0 +1,82 @@ +# TaskFailedDependency + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | | [optional] +**Reason** | Pointer to **string** | | [optional] + +## Methods + +### NewTaskFailedDependency + +`func NewTaskFailedDependency() *TaskFailedDependency` + +NewTaskFailedDependency instantiates a new TaskFailedDependency object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTaskFailedDependencyWithDefaults + +`func NewTaskFailedDependencyWithDefaults() *TaskFailedDependency` + +NewTaskFailedDependencyWithDefaults instantiates a new TaskFailedDependency object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *TaskFailedDependency) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *TaskFailedDependency) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *TaskFailedDependency) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *TaskFailedDependency) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetReason + +`func (o *TaskFailedDependency) GetReason() string` + +GetReason returns the Reason field if non-nil, zero value otherwise. + +### GetReasonOk + +`func (o *TaskFailedDependency) GetReasonOk() (*string, bool)` + +GetReasonOk returns a tuple with the Reason field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReason + +`func (o *TaskFailedDependency) SetReason(v string)` + +SetReason sets Reason field to given value. + +### HasReason + +`func (o *TaskFailedDependency) HasReason() bool` + +HasReason returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/docs/TaskInstance.md b/airflow/docs/TaskInstance.md index 1a748de..fc844a5 100644 --- a/airflow/docs/TaskInstance.md +++ b/airflow/docs/TaskInstance.md @@ -1,54 +1,38 @@ - - # TaskInstance ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TaskId** | Pointer to **string** | | [optional] **DagId** | Pointer to **string** | | [optional] **DagRunId** | Pointer to **string** | The DagRun ID for this task instance *New in version 2.3.0* | [optional] -**ExecutionDate** | Pointer to **string** | | [optional] -**StartDate** | Pointer to **NullableString** | | [optional] -**EndDate** | Pointer to **NullableString** | | [optional] **Duration** | Pointer to **NullableFloat32** | | [optional] -**State** | Pointer to [**TaskState**](TaskState.md) | | [optional] -**TryNumber** | Pointer to **int32** | | [optional] +**EndDate** | Pointer to **NullableString** | | [optional] +**ExecutionDate** | Pointer to **string** | | [optional] +**Executor** | Pointer to **NullableString** | Executor the task is configured to run on or None (which indicates the default executor) *New in version 2.10.0* | [optional] +**ExecutorConfig** | Pointer to **string** | | [optional] +**Hostname** | Pointer to **string** | | [optional] **MapIndex** | Pointer to **int32** | | [optional] **MaxTries** | Pointer to **int32** | | [optional] -**Hostname** | Pointer to **string** | | [optional] -**Unixname** | Pointer to **string** | | [optional] +**Note** | Pointer to **NullableString** | Contains manually entered notes by the user about the TaskInstance. *New in version 2.5.0* | [optional] +**Operator** | Pointer to **NullableString** | *Changed in version 2.1.1*&#58; Field becomes nullable. | [optional] +**Pid** | Pointer to **NullableInt32** | | [optional] **Pool** | Pointer to **string** | | [optional] **PoolSlots** | Pointer to **int32** | | [optional] -**Queue** | Pointer to **NullableString** | | [optional] **PriorityWeight** | Pointer to **NullableInt32** | | [optional] -**Operator** | Pointer to **NullableString** | *Changed in version 2.1.1*&#58; Field becomes nullable. | [optional] -**QueuedWhen** | Pointer to **NullableString** | | [optional] -**Pid** | Pointer to **NullableInt32** | | [optional] -**ExecutorConfig** | Pointer to **string** | | [optional] -**SlaMiss** | Pointer to [**NullableSLAMiss**](SLAMiss.md) | | [optional] +**Queue** | Pointer to **NullableString** | | [optional] +**QueuedWhen** | Pointer to **NullableString** | The datetime that the task enter the state QUEUE, also known as queue_at | [optional] **RenderedFields** | Pointer to **map[string]interface{}** | JSON object describing rendered fields. *New in version 2.3.0* | [optional] -**Trigger** | Pointer to [**Trigger**](Trigger.md) | | [optional] -**TriggererJob** | Pointer to [**Job**](Job.md) | | [optional] -**Note** | Pointer to **NullableString** | Contains manually entered notes by the user about the TaskInstance. *New in version 2.5.0* | [optional] +**RenderedMapIndex** | Pointer to **NullableString** | Rendered name of an expanded task instance, if the task is mapped. *New in version 2.9.0* | [optional] +**SlaMiss** | Pointer to [**NullableSLAMiss**](SLAMiss.md) | | [optional] +**StartDate** | Pointer to **NullableString** | | [optional] +**State** | Pointer to [**NullableTaskState**](TaskState.md) | | [optional] +**TaskDisplayName** | Pointer to **string** | Human centric display text for the task. *New in version 2.9.0* | [optional] +**TaskId** | Pointer to **string** | | [optional] +**Trigger** | Pointer to [**NullableTrigger**](Trigger.md) | | [optional] +**TriggererJob** | Pointer to [**NullableJob**](Job.md) | | [optional] +**TryNumber** | Pointer to **int32** | | [optional] +**Unixname** | Pointer to **string** | | [optional] ## Methods @@ -69,31 +53,6 @@ NewTaskInstanceWithDefaults instantiates a new TaskInstance object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetTaskId - -`func (o *TaskInstance) GetTaskId() string` - -GetTaskId returns the TaskId field if non-nil, zero value otherwise. - -### GetTaskIdOk - -`func (o *TaskInstance) GetTaskIdOk() (*string, bool)` - -GetTaskIdOk returns a tuple with the TaskId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTaskId - -`func (o *TaskInstance) SetTaskId(v string)` - -SetTaskId sets TaskId field to given value. - -### HasTaskId - -`func (o *TaskInstance) HasTaskId() bool` - -HasTaskId returns a boolean if a field has been set. - ### GetDagId `func (o *TaskInstance) GetDagId() string` @@ -144,66 +103,41 @@ SetDagRunId sets DagRunId field to given value. HasDagRunId returns a boolean if a field has been set. -### GetExecutionDate - -`func (o *TaskInstance) GetExecutionDate() string` - -GetExecutionDate returns the ExecutionDate field if non-nil, zero value otherwise. - -### GetExecutionDateOk - -`func (o *TaskInstance) GetExecutionDateOk() (*string, bool)` - -GetExecutionDateOk returns a tuple with the ExecutionDate field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetExecutionDate - -`func (o *TaskInstance) SetExecutionDate(v string)` - -SetExecutionDate sets ExecutionDate field to given value. - -### HasExecutionDate - -`func (o *TaskInstance) HasExecutionDate() bool` - -HasExecutionDate returns a boolean if a field has been set. - -### GetStartDate +### GetDuration -`func (o *TaskInstance) GetStartDate() string` +`func (o *TaskInstance) GetDuration() float32` -GetStartDate returns the StartDate field if non-nil, zero value otherwise. +GetDuration returns the Duration field if non-nil, zero value otherwise. -### GetStartDateOk +### GetDurationOk -`func (o *TaskInstance) GetStartDateOk() (*string, bool)` +`func (o *TaskInstance) GetDurationOk() (*float32, bool)` -GetStartDateOk returns a tuple with the StartDate field if it's non-nil, zero value otherwise +GetDurationOk returns a tuple with the Duration field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetStartDate +### SetDuration -`func (o *TaskInstance) SetStartDate(v string)` +`func (o *TaskInstance) SetDuration(v float32)` -SetStartDate sets StartDate field to given value. +SetDuration sets Duration field to given value. -### HasStartDate +### HasDuration -`func (o *TaskInstance) HasStartDate() bool` +`func (o *TaskInstance) HasDuration() bool` -HasStartDate returns a boolean if a field has been set. +HasDuration returns a boolean if a field has been set. -### SetStartDateNil +### SetDurationNil -`func (o *TaskInstance) SetStartDateNil(b bool)` +`func (o *TaskInstance) SetDurationNil(b bool)` - SetStartDateNil sets the value for StartDate to be an explicit nil + SetDurationNil sets the value for Duration to be an explicit nil -### UnsetStartDate -`func (o *TaskInstance) UnsetStartDate()` +### UnsetDuration +`func (o *TaskInstance) UnsetDuration()` -UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil +UnsetDuration ensures that no value is present for Duration, not even an explicit nil ### GetEndDate `func (o *TaskInstance) GetEndDate() string` @@ -239,90 +173,115 @@ HasEndDate returns a boolean if a field has been set. `func (o *TaskInstance) UnsetEndDate()` UnsetEndDate ensures that no value is present for EndDate, not even an explicit nil -### GetDuration +### GetExecutionDate -`func (o *TaskInstance) GetDuration() float32` +`func (o *TaskInstance) GetExecutionDate() string` -GetDuration returns the Duration field if non-nil, zero value otherwise. +GetExecutionDate returns the ExecutionDate field if non-nil, zero value otherwise. -### GetDurationOk +### GetExecutionDateOk -`func (o *TaskInstance) GetDurationOk() (*float32, bool)` +`func (o *TaskInstance) GetExecutionDateOk() (*string, bool)` -GetDurationOk returns a tuple with the Duration field if it's non-nil, zero value otherwise +GetExecutionDateOk returns a tuple with the ExecutionDate field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDuration +### SetExecutionDate -`func (o *TaskInstance) SetDuration(v float32)` +`func (o *TaskInstance) SetExecutionDate(v string)` -SetDuration sets Duration field to given value. +SetExecutionDate sets ExecutionDate field to given value. -### HasDuration +### HasExecutionDate -`func (o *TaskInstance) HasDuration() bool` +`func (o *TaskInstance) HasExecutionDate() bool` -HasDuration returns a boolean if a field has been set. +HasExecutionDate returns a boolean if a field has been set. -### SetDurationNil +### GetExecutor -`func (o *TaskInstance) SetDurationNil(b bool)` +`func (o *TaskInstance) GetExecutor() string` - SetDurationNil sets the value for Duration to be an explicit nil +GetExecutor returns the Executor field if non-nil, zero value otherwise. -### UnsetDuration -`func (o *TaskInstance) UnsetDuration()` +### GetExecutorOk -UnsetDuration ensures that no value is present for Duration, not even an explicit nil -### GetState +`func (o *TaskInstance) GetExecutorOk() (*string, bool)` -`func (o *TaskInstance) GetState() TaskState` +GetExecutorOk returns a tuple with the Executor field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. -GetState returns the State field if non-nil, zero value otherwise. +### SetExecutor -### GetStateOk +`func (o *TaskInstance) SetExecutor(v string)` -`func (o *TaskInstance) GetStateOk() (*TaskState, bool)` +SetExecutor sets Executor field to given value. -GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +### HasExecutor + +`func (o *TaskInstance) HasExecutor() bool` + +HasExecutor returns a boolean if a field has been set. + +### SetExecutorNil + +`func (o *TaskInstance) SetExecutorNil(b bool)` + + SetExecutorNil sets the value for Executor to be an explicit nil + +### UnsetExecutor +`func (o *TaskInstance) UnsetExecutor()` + +UnsetExecutor ensures that no value is present for Executor, not even an explicit nil +### GetExecutorConfig + +`func (o *TaskInstance) GetExecutorConfig() string` + +GetExecutorConfig returns the ExecutorConfig field if non-nil, zero value otherwise. + +### GetExecutorConfigOk + +`func (o *TaskInstance) GetExecutorConfigOk() (*string, bool)` + +GetExecutorConfigOk returns a tuple with the ExecutorConfig field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetState +### SetExecutorConfig -`func (o *TaskInstance) SetState(v TaskState)` +`func (o *TaskInstance) SetExecutorConfig(v string)` -SetState sets State field to given value. +SetExecutorConfig sets ExecutorConfig field to given value. -### HasState +### HasExecutorConfig -`func (o *TaskInstance) HasState() bool` +`func (o *TaskInstance) HasExecutorConfig() bool` -HasState returns a boolean if a field has been set. +HasExecutorConfig returns a boolean if a field has been set. -### GetTryNumber +### GetHostname -`func (o *TaskInstance) GetTryNumber() int32` +`func (o *TaskInstance) GetHostname() string` -GetTryNumber returns the TryNumber field if non-nil, zero value otherwise. +GetHostname returns the Hostname field if non-nil, zero value otherwise. -### GetTryNumberOk +### GetHostnameOk -`func (o *TaskInstance) GetTryNumberOk() (*int32, bool)` +`func (o *TaskInstance) GetHostnameOk() (*string, bool)` -GetTryNumberOk returns a tuple with the TryNumber field if it's non-nil, zero value otherwise +GetHostnameOk returns a tuple with the Hostname field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTryNumber +### SetHostname -`func (o *TaskInstance) SetTryNumber(v int32)` +`func (o *TaskInstance) SetHostname(v string)` -SetTryNumber sets TryNumber field to given value. +SetHostname sets Hostname field to given value. -### HasTryNumber +### HasHostname -`func (o *TaskInstance) HasTryNumber() bool` +`func (o *TaskInstance) HasHostname() bool` -HasTryNumber returns a boolean if a field has been set. +HasHostname returns a boolean if a field has been set. ### GetMapIndex @@ -374,56 +333,111 @@ SetMaxTries sets MaxTries field to given value. HasMaxTries returns a boolean if a field has been set. -### GetHostname +### GetNote -`func (o *TaskInstance) GetHostname() string` +`func (o *TaskInstance) GetNote() string` -GetHostname returns the Hostname field if non-nil, zero value otherwise. +GetNote returns the Note field if non-nil, zero value otherwise. -### GetHostnameOk +### GetNoteOk -`func (o *TaskInstance) GetHostnameOk() (*string, bool)` +`func (o *TaskInstance) GetNoteOk() (*string, bool)` -GetHostnameOk returns a tuple with the Hostname field if it's non-nil, zero value otherwise +GetNoteOk returns a tuple with the Note field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetHostname +### SetNote -`func (o *TaskInstance) SetHostname(v string)` +`func (o *TaskInstance) SetNote(v string)` -SetHostname sets Hostname field to given value. +SetNote sets Note field to given value. -### HasHostname +### HasNote -`func (o *TaskInstance) HasHostname() bool` +`func (o *TaskInstance) HasNote() bool` -HasHostname returns a boolean if a field has been set. +HasNote returns a boolean if a field has been set. -### GetUnixname +### SetNoteNil -`func (o *TaskInstance) GetUnixname() string` +`func (o *TaskInstance) SetNoteNil(b bool)` -GetUnixname returns the Unixname field if non-nil, zero value otherwise. + SetNoteNil sets the value for Note to be an explicit nil -### GetUnixnameOk +### UnsetNote +`func (o *TaskInstance) UnsetNote()` -`func (o *TaskInstance) GetUnixnameOk() (*string, bool)` +UnsetNote ensures that no value is present for Note, not even an explicit nil +### GetOperator -GetUnixnameOk returns a tuple with the Unixname field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. +`func (o *TaskInstance) GetOperator() string` -### SetUnixname +GetOperator returns the Operator field if non-nil, zero value otherwise. -`func (o *TaskInstance) SetUnixname(v string)` +### GetOperatorOk -SetUnixname sets Unixname field to given value. +`func (o *TaskInstance) GetOperatorOk() (*string, bool)` -### HasUnixname +GetOperatorOk returns a tuple with the Operator field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. -`func (o *TaskInstance) HasUnixname() bool` +### SetOperator -HasUnixname returns a boolean if a field has been set. +`func (o *TaskInstance) SetOperator(v string)` +SetOperator sets Operator field to given value. + +### HasOperator + +`func (o *TaskInstance) HasOperator() bool` + +HasOperator returns a boolean if a field has been set. + +### SetOperatorNil + +`func (o *TaskInstance) SetOperatorNil(b bool)` + + SetOperatorNil sets the value for Operator to be an explicit nil + +### UnsetOperator +`func (o *TaskInstance) UnsetOperator()` + +UnsetOperator ensures that no value is present for Operator, not even an explicit nil +### GetPid + +`func (o *TaskInstance) GetPid() int32` + +GetPid returns the Pid field if non-nil, zero value otherwise. + +### GetPidOk + +`func (o *TaskInstance) GetPidOk() (*int32, bool)` + +GetPidOk returns a tuple with the Pid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPid + +`func (o *TaskInstance) SetPid(v int32)` + +SetPid sets Pid field to given value. + +### HasPid + +`func (o *TaskInstance) HasPid() bool` + +HasPid returns a boolean if a field has been set. + +### SetPidNil + +`func (o *TaskInstance) SetPidNil(b bool)` + + SetPidNil sets the value for Pid to be an explicit nil + +### UnsetPid +`func (o *TaskInstance) UnsetPid()` + +UnsetPid ensures that no value is present for Pid, not even an explicit nil ### GetPool `func (o *TaskInstance) GetPool() string` @@ -474,41 +488,6 @@ SetPoolSlots sets PoolSlots field to given value. HasPoolSlots returns a boolean if a field has been set. -### GetQueue - -`func (o *TaskInstance) GetQueue() string` - -GetQueue returns the Queue field if non-nil, zero value otherwise. - -### GetQueueOk - -`func (o *TaskInstance) GetQueueOk() (*string, bool)` - -GetQueueOk returns a tuple with the Queue field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetQueue - -`func (o *TaskInstance) SetQueue(v string)` - -SetQueue sets Queue field to given value. - -### HasQueue - -`func (o *TaskInstance) HasQueue() bool` - -HasQueue returns a boolean if a field has been set. - -### SetQueueNil - -`func (o *TaskInstance) SetQueueNil(b bool)` - - SetQueueNil sets the value for Queue to be an explicit nil - -### UnsetQueue -`func (o *TaskInstance) UnsetQueue()` - -UnsetQueue ensures that no value is present for Queue, not even an explicit nil ### GetPriorityWeight `func (o *TaskInstance) GetPriorityWeight() int32` @@ -544,41 +523,41 @@ HasPriorityWeight returns a boolean if a field has been set. `func (o *TaskInstance) UnsetPriorityWeight()` UnsetPriorityWeight ensures that no value is present for PriorityWeight, not even an explicit nil -### GetOperator +### GetQueue -`func (o *TaskInstance) GetOperator() string` +`func (o *TaskInstance) GetQueue() string` -GetOperator returns the Operator field if non-nil, zero value otherwise. +GetQueue returns the Queue field if non-nil, zero value otherwise. -### GetOperatorOk +### GetQueueOk -`func (o *TaskInstance) GetOperatorOk() (*string, bool)` +`func (o *TaskInstance) GetQueueOk() (*string, bool)` -GetOperatorOk returns a tuple with the Operator field if it's non-nil, zero value otherwise +GetQueueOk returns a tuple with the Queue field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetOperator +### SetQueue -`func (o *TaskInstance) SetOperator(v string)` +`func (o *TaskInstance) SetQueue(v string)` -SetOperator sets Operator field to given value. +SetQueue sets Queue field to given value. -### HasOperator +### HasQueue -`func (o *TaskInstance) HasOperator() bool` +`func (o *TaskInstance) HasQueue() bool` -HasOperator returns a boolean if a field has been set. +HasQueue returns a boolean if a field has been set. -### SetOperatorNil +### SetQueueNil -`func (o *TaskInstance) SetOperatorNil(b bool)` +`func (o *TaskInstance) SetQueueNil(b bool)` - SetOperatorNil sets the value for Operator to be an explicit nil + SetQueueNil sets the value for Queue to be an explicit nil -### UnsetOperator -`func (o *TaskInstance) UnsetOperator()` +### UnsetQueue +`func (o *TaskInstance) UnsetQueue()` -UnsetOperator ensures that no value is present for Operator, not even an explicit nil +UnsetQueue ensures that no value is present for Queue, not even an explicit nil ### GetQueuedWhen `func (o *TaskInstance) GetQueuedWhen() string` @@ -614,66 +593,66 @@ HasQueuedWhen returns a boolean if a field has been set. `func (o *TaskInstance) UnsetQueuedWhen()` UnsetQueuedWhen ensures that no value is present for QueuedWhen, not even an explicit nil -### GetPid +### GetRenderedFields -`func (o *TaskInstance) GetPid() int32` +`func (o *TaskInstance) GetRenderedFields() map[string]interface{}` -GetPid returns the Pid field if non-nil, zero value otherwise. +GetRenderedFields returns the RenderedFields field if non-nil, zero value otherwise. -### GetPidOk +### GetRenderedFieldsOk -`func (o *TaskInstance) GetPidOk() (*int32, bool)` +`func (o *TaskInstance) GetRenderedFieldsOk() (*map[string]interface{}, bool)` -GetPidOk returns a tuple with the Pid field if it's non-nil, zero value otherwise +GetRenderedFieldsOk returns a tuple with the RenderedFields field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetPid +### SetRenderedFields -`func (o *TaskInstance) SetPid(v int32)` +`func (o *TaskInstance) SetRenderedFields(v map[string]interface{})` -SetPid sets Pid field to given value. +SetRenderedFields sets RenderedFields field to given value. -### HasPid +### HasRenderedFields -`func (o *TaskInstance) HasPid() bool` +`func (o *TaskInstance) HasRenderedFields() bool` -HasPid returns a boolean if a field has been set. +HasRenderedFields returns a boolean if a field has been set. -### SetPidNil +### GetRenderedMapIndex -`func (o *TaskInstance) SetPidNil(b bool)` +`func (o *TaskInstance) GetRenderedMapIndex() string` - SetPidNil sets the value for Pid to be an explicit nil +GetRenderedMapIndex returns the RenderedMapIndex field if non-nil, zero value otherwise. -### UnsetPid -`func (o *TaskInstance) UnsetPid()` +### GetRenderedMapIndexOk -UnsetPid ensures that no value is present for Pid, not even an explicit nil -### GetExecutorConfig +`func (o *TaskInstance) GetRenderedMapIndexOk() (*string, bool)` -`func (o *TaskInstance) GetExecutorConfig() string` +GetRenderedMapIndexOk returns a tuple with the RenderedMapIndex field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. -GetExecutorConfig returns the ExecutorConfig field if non-nil, zero value otherwise. +### SetRenderedMapIndex -### GetExecutorConfigOk +`func (o *TaskInstance) SetRenderedMapIndex(v string)` -`func (o *TaskInstance) GetExecutorConfigOk() (*string, bool)` +SetRenderedMapIndex sets RenderedMapIndex field to given value. -GetExecutorConfigOk returns a tuple with the ExecutorConfig field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. +### HasRenderedMapIndex -### SetExecutorConfig +`func (o *TaskInstance) HasRenderedMapIndex() bool` -`func (o *TaskInstance) SetExecutorConfig(v string)` +HasRenderedMapIndex returns a boolean if a field has been set. -SetExecutorConfig sets ExecutorConfig field to given value. +### SetRenderedMapIndexNil -### HasExecutorConfig +`func (o *TaskInstance) SetRenderedMapIndexNil(b bool)` -`func (o *TaskInstance) HasExecutorConfig() bool` + SetRenderedMapIndexNil sets the value for RenderedMapIndex to be an explicit nil -HasExecutorConfig returns a boolean if a field has been set. +### UnsetRenderedMapIndex +`func (o *TaskInstance) UnsetRenderedMapIndex()` +UnsetRenderedMapIndex ensures that no value is present for RenderedMapIndex, not even an explicit nil ### GetSlaMiss `func (o *TaskInstance) GetSlaMiss() SLAMiss` @@ -709,30 +688,125 @@ HasSlaMiss returns a boolean if a field has been set. `func (o *TaskInstance) UnsetSlaMiss()` UnsetSlaMiss ensures that no value is present for SlaMiss, not even an explicit nil -### GetRenderedFields +### GetStartDate -`func (o *TaskInstance) GetRenderedFields() map[string]interface{}` +`func (o *TaskInstance) GetStartDate() string` -GetRenderedFields returns the RenderedFields field if non-nil, zero value otherwise. +GetStartDate returns the StartDate field if non-nil, zero value otherwise. -### GetRenderedFieldsOk +### GetStartDateOk -`func (o *TaskInstance) GetRenderedFieldsOk() (*map[string]interface{}, bool)` +`func (o *TaskInstance) GetStartDateOk() (*string, bool)` -GetRenderedFieldsOk returns a tuple with the RenderedFields field if it's non-nil, zero value otherwise +GetStartDateOk returns a tuple with the StartDate field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetRenderedFields +### SetStartDate -`func (o *TaskInstance) SetRenderedFields(v map[string]interface{})` +`func (o *TaskInstance) SetStartDate(v string)` -SetRenderedFields sets RenderedFields field to given value. +SetStartDate sets StartDate field to given value. -### HasRenderedFields +### HasStartDate -`func (o *TaskInstance) HasRenderedFields() bool` +`func (o *TaskInstance) HasStartDate() bool` -HasRenderedFields returns a boolean if a field has been set. +HasStartDate returns a boolean if a field has been set. + +### SetStartDateNil + +`func (o *TaskInstance) SetStartDateNil(b bool)` + + SetStartDateNil sets the value for StartDate to be an explicit nil + +### UnsetStartDate +`func (o *TaskInstance) UnsetStartDate()` + +UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil +### GetState + +`func (o *TaskInstance) GetState() TaskState` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *TaskInstance) GetStateOk() (*TaskState, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *TaskInstance) SetState(v TaskState)` + +SetState sets State field to given value. + +### HasState + +`func (o *TaskInstance) HasState() bool` + +HasState returns a boolean if a field has been set. + +### SetStateNil + +`func (o *TaskInstance) SetStateNil(b bool)` + + SetStateNil sets the value for State to be an explicit nil + +### UnsetState +`func (o *TaskInstance) UnsetState()` + +UnsetState ensures that no value is present for State, not even an explicit nil +### GetTaskDisplayName + +`func (o *TaskInstance) GetTaskDisplayName() string` + +GetTaskDisplayName returns the TaskDisplayName field if non-nil, zero value otherwise. + +### GetTaskDisplayNameOk + +`func (o *TaskInstance) GetTaskDisplayNameOk() (*string, bool)` + +GetTaskDisplayNameOk returns a tuple with the TaskDisplayName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTaskDisplayName + +`func (o *TaskInstance) SetTaskDisplayName(v string)` + +SetTaskDisplayName sets TaskDisplayName field to given value. + +### HasTaskDisplayName + +`func (o *TaskInstance) HasTaskDisplayName() bool` + +HasTaskDisplayName returns a boolean if a field has been set. + +### GetTaskId + +`func (o *TaskInstance) GetTaskId() string` + +GetTaskId returns the TaskId field if non-nil, zero value otherwise. + +### GetTaskIdOk + +`func (o *TaskInstance) GetTaskIdOk() (*string, bool)` + +GetTaskIdOk returns a tuple with the TaskId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTaskId + +`func (o *TaskInstance) SetTaskId(v string)` + +SetTaskId sets TaskId field to given value. + +### HasTaskId + +`func (o *TaskInstance) HasTaskId() bool` + +HasTaskId returns a boolean if a field has been set. ### GetTrigger @@ -759,6 +833,16 @@ SetTrigger sets Trigger field to given value. HasTrigger returns a boolean if a field has been set. +### SetTriggerNil + +`func (o *TaskInstance) SetTriggerNil(b bool)` + + SetTriggerNil sets the value for Trigger to be an explicit nil + +### UnsetTrigger +`func (o *TaskInstance) UnsetTrigger()` + +UnsetTrigger ensures that no value is present for Trigger, not even an explicit nil ### GetTriggererJob `func (o *TaskInstance) GetTriggererJob() Job` @@ -784,41 +868,66 @@ SetTriggererJob sets TriggererJob field to given value. HasTriggererJob returns a boolean if a field has been set. -### GetNote +### SetTriggererJobNil -`func (o *TaskInstance) GetNote() string` +`func (o *TaskInstance) SetTriggererJobNil(b bool)` -GetNote returns the Note field if non-nil, zero value otherwise. + SetTriggererJobNil sets the value for TriggererJob to be an explicit nil -### GetNoteOk +### UnsetTriggererJob +`func (o *TaskInstance) UnsetTriggererJob()` -`func (o *TaskInstance) GetNoteOk() (*string, bool)` +UnsetTriggererJob ensures that no value is present for TriggererJob, not even an explicit nil +### GetTryNumber -GetNoteOk returns a tuple with the Note field if it's non-nil, zero value otherwise +`func (o *TaskInstance) GetTryNumber() int32` + +GetTryNumber returns the TryNumber field if non-nil, zero value otherwise. + +### GetTryNumberOk + +`func (o *TaskInstance) GetTryNumberOk() (*int32, bool)` + +GetTryNumberOk returns a tuple with the TryNumber field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetNote +### SetTryNumber -`func (o *TaskInstance) SetNote(v string)` +`func (o *TaskInstance) SetTryNumber(v int32)` -SetNote sets Note field to given value. +SetTryNumber sets TryNumber field to given value. -### HasNote +### HasTryNumber -`func (o *TaskInstance) HasNote() bool` +`func (o *TaskInstance) HasTryNumber() bool` -HasNote returns a boolean if a field has been set. +HasTryNumber returns a boolean if a field has been set. -### SetNoteNil +### GetUnixname -`func (o *TaskInstance) SetNoteNil(b bool)` +`func (o *TaskInstance) GetUnixname() string` - SetNoteNil sets the value for Note to be an explicit nil +GetUnixname returns the Unixname field if non-nil, zero value otherwise. -### UnsetNote -`func (o *TaskInstance) UnsetNote()` +### GetUnixnameOk + +`func (o *TaskInstance) GetUnixnameOk() (*string, bool)` + +GetUnixnameOk returns a tuple with the Unixname field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUnixname + +`func (o *TaskInstance) SetUnixname(v string)` + +SetUnixname sets Unixname field to given value. + +### HasUnixname + +`func (o *TaskInstance) HasUnixname() bool` + +HasUnixname returns a boolean if a field has been set. -UnsetNote ensures that no value is present for Note, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/TaskInstanceApi.md b/airflow/docs/TaskInstanceApi.md index a7e01a0..69e5dfb 100644 --- a/airflow/docs/TaskInstanceApi.md +++ b/airflow/docs/TaskInstanceApi.md @@ -1,43 +1,32 @@ - - -# \TaskInstanceApi - -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**GetExtraLinks**](TaskInstanceApi.md#GetExtraLinks) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/links | List extra links -[**GetLog**](TaskInstanceApi.md#GetLog) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/logs/{task_try_number} | Get logs -[**GetMappedTaskInstance**](TaskInstanceApi.md#GetMappedTaskInstance) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index} | Get a mapped task instance -[**GetMappedTaskInstances**](TaskInstanceApi.md#GetMappedTaskInstances) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/listMapped | List mapped task instances -[**GetTaskInstance**](TaskInstanceApi.md#GetTaskInstance) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id} | Get a task instance -[**GetTaskInstances**](TaskInstanceApi.md#GetTaskInstances) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances | List task instances -[**GetTaskInstancesBatch**](TaskInstanceApi.md#GetTaskInstancesBatch) | **Post** /dags/~/dagRuns/~/taskInstances/list | List task instances (batch) -[**PatchMappedTaskInstance**](TaskInstanceApi.md#PatchMappedTaskInstance) | **Patch** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index} | Updates the state of a mapped task instance -[**PatchTaskInstance**](TaskInstanceApi.md#PatchTaskInstance) | **Patch** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id} | Updates the state of a task instance +[**GetExtraLinks**](TaskInstanceAPI.md#GetExtraLinks) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/links | List extra links +[**GetLog**](TaskInstanceAPI.md#GetLog) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/logs/{task_try_number} | Get logs +[**GetMappedTaskInstance**](TaskInstanceAPI.md#GetMappedTaskInstance) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index} | Get a mapped task instance +[**GetMappedTaskInstanceDependencies**](TaskInstanceAPI.md#GetMappedTaskInstanceDependencies) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}/dependencies | Get task dependencies blocking task from getting scheduled. +[**GetMappedTaskInstanceTries**](TaskInstanceAPI.md#GetMappedTaskInstanceTries) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}/tries | List mapped task instance tries +[**GetMappedTaskInstanceTryDetails**](TaskInstanceAPI.md#GetMappedTaskInstanceTryDetails) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}/tries/{task_try_number} | get mapped taskinstance try +[**GetMappedTaskInstances**](TaskInstanceAPI.md#GetMappedTaskInstances) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/listMapped | List mapped task instances +[**GetTaskInstance**](TaskInstanceAPI.md#GetTaskInstance) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id} | Get a task instance +[**GetTaskInstanceDependencies**](TaskInstanceAPI.md#GetTaskInstanceDependencies) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/dependencies | Get task dependencies blocking task from getting scheduled. +[**GetTaskInstanceTries**](TaskInstanceAPI.md#GetTaskInstanceTries) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/tries | List task instance tries +[**GetTaskInstanceTryDetails**](TaskInstanceAPI.md#GetTaskInstanceTryDetails) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/tries/{task_try_number} | get taskinstance try +[**GetTaskInstances**](TaskInstanceAPI.md#GetTaskInstances) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances | List task instances +[**GetTaskInstancesBatch**](TaskInstanceAPI.md#GetTaskInstancesBatch) | **Post** /dags/~/dagRuns/~/taskInstances/list | List task instances (batch) +[**PatchMappedTaskInstance**](TaskInstanceAPI.md#PatchMappedTaskInstance) | **Patch** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index} | Updates the state of a mapped task instance +[**PatchTaskInstance**](TaskInstanceAPI.md#PatchTaskInstance) | **Patch** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id} | Updates the state of a task instance +[**SetMappedTaskInstanceNote**](TaskInstanceAPI.md#SetMappedTaskInstanceNote) | **Patch** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/{map_index}/setNote | Update the TaskInstance note. +[**SetTaskInstanceNote**](TaskInstanceAPI.md#SetTaskInstanceNote) | **Patch** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/setNote | Update the TaskInstance note. ## GetExtraLinks -> ExtraLinkCollection GetExtraLinks(ctx, dagId, dagRunId, taskId).Execute() +> ExtraLinkCollection GetExtraLinks(ctx, dagId, dagRunId, taskId).MapIndex(mapIndex).Execute() List extra links @@ -49,26 +38,27 @@ List extra links package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - dagRunId := "dagRunId_example" // string | The DAG run ID. - taskId := "taskId_example" // string | The task ID. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.TaskInstanceApi.GetExtraLinks(context.Background(), dagId, dagRunId, taskId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceApi.GetExtraLinks``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetExtraLinks`: ExtraLinkCollection - fmt.Fprintf(os.Stdout, "Response from `TaskInstanceApi.GetExtraLinks`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + taskId := "taskId_example" // string | The task ID. + mapIndex := int32(56) // int32 | Filter on map index for mapped task. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TaskInstanceAPI.GetExtraLinks(context.Background(), dagId, dagRunId, taskId).MapIndex(mapIndex).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceAPI.GetExtraLinks``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetExtraLinks`: ExtraLinkCollection + fmt.Fprintf(os.Stdout, "Response from `TaskInstanceAPI.GetExtraLinks`: %v\n", resp) } ``` @@ -92,6 +82,7 @@ Name | Type | Description | Notes + **mapIndex** | **int32** | Filter on map index for mapped task. | ### Return type @@ -99,7 +90,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -113,7 +104,7 @@ Name | Type | Description | Notes ## GetLog -> InlineResponse200 GetLog(ctx, dagId, dagRunId, taskId, taskTryNumber).FullContent(fullContent).MapIndex(mapIndex).Token(token).Execute() +> GetLog200Response GetLog(ctx, dagId, dagRunId, taskId, taskTryNumber).FullContent(fullContent).MapIndex(mapIndex).Token(token).Execute() Get logs @@ -125,30 +116,30 @@ Get logs package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - dagRunId := "dagRunId_example" // string | The DAG run ID. - taskId := "taskId_example" // string | The task ID. - taskTryNumber := int32(56) // int32 | The task try number. - fullContent := true // bool | A full content will be returned. By default, only the first fragment will be returned. (optional) - mapIndex := int32(56) // int32 | Filter on map index for mapped task. (optional) - token := "token_example" // string | A token that allows you to continue fetching logs. If passed, it will specify the location from which the download should be continued. (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.TaskInstanceApi.GetLog(context.Background(), dagId, dagRunId, taskId, taskTryNumber).FullContent(fullContent).MapIndex(mapIndex).Token(token).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceApi.GetLog``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetLog`: InlineResponse200 - fmt.Fprintf(os.Stdout, "Response from `TaskInstanceApi.GetLog`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + taskId := "taskId_example" // string | The task ID. + taskTryNumber := int32(56) // int32 | The task try number. + fullContent := true // bool | A full content will be returned. By default, only the first fragment will be returned. (optional) + mapIndex := int32(56) // int32 | Filter on map index for mapped task. (optional) + token := "token_example" // string | A token that allows you to continue fetching logs. If passed, it will specify the location from which the download should be continued. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TaskInstanceAPI.GetLog(context.Background(), dagId, dagRunId, taskId, taskTryNumber).FullContent(fullContent).MapIndex(mapIndex).Token(token).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceAPI.GetLog``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetLog`: GetLog200Response + fmt.Fprintf(os.Stdout, "Response from `TaskInstanceAPI.GetLog`: %v\n", resp) } ``` @@ -180,11 +171,11 @@ Name | Type | Description | Notes ### Return type -[**InlineResponse200**](InlineResponse200.md) +[**GetLog200Response**](GetLog200Response.md) ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -210,27 +201,27 @@ Get a mapped task instance package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - dagRunId := "dagRunId_example" // string | The DAG run ID. - taskId := "taskId_example" // string | The task ID. - mapIndex := int32(56) // int32 | The map index. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.TaskInstanceApi.GetMappedTaskInstance(context.Background(), dagId, dagRunId, taskId, mapIndex).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceApi.GetMappedTaskInstance``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetMappedTaskInstance`: TaskInstance - fmt.Fprintf(os.Stdout, "Response from `TaskInstanceApi.GetMappedTaskInstance`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + taskId := "taskId_example" // string | The task ID. + mapIndex := int32(56) // int32 | The map index. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TaskInstanceAPI.GetMappedTaskInstance(context.Background(), dagId, dagRunId, taskId, mapIndex).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceAPI.GetMappedTaskInstance``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetMappedTaskInstance`: TaskInstance + fmt.Fprintf(os.Stdout, "Response from `TaskInstanceAPI.GetMappedTaskInstance`: %v\n", resp) } ``` @@ -263,7 +254,253 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetMappedTaskInstanceDependencies + +> TaskInstanceDependencyCollection GetMappedTaskInstanceDependencies(ctx, dagId, dagRunId, taskId, mapIndex).Execute() + +Get task dependencies blocking task from getting scheduled. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./airflow" +) + +func main() { + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + taskId := "taskId_example" // string | The task ID. + mapIndex := int32(56) // int32 | The map index. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TaskInstanceAPI.GetMappedTaskInstanceDependencies(context.Background(), dagId, dagRunId, taskId, mapIndex).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceAPI.GetMappedTaskInstanceDependencies``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetMappedTaskInstanceDependencies`: TaskInstanceDependencyCollection + fmt.Fprintf(os.Stdout, "Response from `TaskInstanceAPI.GetMappedTaskInstanceDependencies`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**dagId** | **string** | The DAG ID. | +**dagRunId** | **string** | The DAG run ID. | +**taskId** | **string** | The task ID. | +**mapIndex** | **int32** | The map index. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetMappedTaskInstanceDependenciesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + +### Return type + +[**TaskInstanceDependencyCollection**](TaskInstanceDependencyCollection.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetMappedTaskInstanceTries + +> TaskInstanceHistoryCollection GetMappedTaskInstanceTries(ctx, dagId, dagRunId, taskId, mapIndex).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() + +List mapped task instance tries + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./airflow" +) + +func main() { + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + taskId := "taskId_example" // string | The task ID. + mapIndex := int32(56) // int32 | The map index. + limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) + offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) + orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TaskInstanceAPI.GetMappedTaskInstanceTries(context.Background(), dagId, dagRunId, taskId, mapIndex).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceAPI.GetMappedTaskInstanceTries``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetMappedTaskInstanceTries`: TaskInstanceHistoryCollection + fmt.Fprintf(os.Stdout, "Response from `TaskInstanceAPI.GetMappedTaskInstanceTries`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**dagId** | **string** | The DAG ID. | +**dagRunId** | **string** | The DAG run ID. | +**taskId** | **string** | The task ID. | +**mapIndex** | **int32** | The map index. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetMappedTaskInstanceTriesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + **limit** | **int32** | The numbers of items to return. | [default to 100] + **offset** | **int32** | The number of items to skip before starting to collect the result set. | + **orderBy** | **string** | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* | + +### Return type + +[**TaskInstanceHistoryCollection**](TaskInstanceHistoryCollection.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetMappedTaskInstanceTryDetails + +> TaskInstanceHistory GetMappedTaskInstanceTryDetails(ctx, dagId, dagRunId, taskId, mapIndex, taskTryNumber).Execute() + +get mapped taskinstance try + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./airflow" +) + +func main() { + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + taskId := "taskId_example" // string | The task ID. + mapIndex := int32(56) // int32 | The map index. + taskTryNumber := int32(56) // int32 | The task try number. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TaskInstanceAPI.GetMappedTaskInstanceTryDetails(context.Background(), dagId, dagRunId, taskId, mapIndex, taskTryNumber).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceAPI.GetMappedTaskInstanceTryDetails``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetMappedTaskInstanceTryDetails`: TaskInstanceHistory + fmt.Fprintf(os.Stdout, "Response from `TaskInstanceAPI.GetMappedTaskInstanceTryDetails`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**dagId** | **string** | The DAG ID. | +**dagRunId** | **string** | The DAG run ID. | +**taskId** | **string** | The task ID. | +**mapIndex** | **int32** | The map index. | +**taskTryNumber** | **int32** | The task try number. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetMappedTaskInstanceTryDetailsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + + +### Return type + +[**TaskInstanceHistory**](TaskInstanceHistory.md) + +### Authorization + +No authorization required ### HTTP request headers @@ -277,7 +514,7 @@ Name | Type | Description | Notes ## GetMappedTaskInstances -> TaskInstanceCollection GetMappedTaskInstances(ctx, dagId, dagRunId, taskId).Limit(limit).Offset(offset).ExecutionDateGte(executionDateGte).ExecutionDateLte(executionDateLte).StartDateGte(startDateGte).StartDateLte(startDateLte).EndDateGte(endDateGte).EndDateLte(endDateLte).DurationGte(durationGte).DurationLte(durationLte).State(state).Pool(pool).Queue(queue).OrderBy(orderBy).Execute() +> TaskInstanceCollection GetMappedTaskInstances(ctx, dagId, dagRunId, taskId).Limit(limit).Offset(offset).ExecutionDateGte(executionDateGte).ExecutionDateLte(executionDateLte).StartDateGte(startDateGte).StartDateLte(startDateLte).EndDateGte(endDateGte).EndDateLte(endDateLte).UpdatedAtGte(updatedAtGte).UpdatedAtLte(updatedAtLte).DurationGte(durationGte).DurationLte(durationLte).State(state).Pool(pool).Queue(queue).Executor(executor).OrderBy(orderBy).Execute() List mapped task instances @@ -289,41 +526,44 @@ List mapped task instances package main import ( - "context" - "fmt" - "os" + "context" + "fmt" + "os" "time" - openapiclient "./openapi" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - dagRunId := "dagRunId_example" // string | The DAG run ID. - taskId := "taskId_example" // string | The task ID. - limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) - offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) - executionDateGte := time.Now() // time.Time | Returns objects greater or equal to the specified date. This can be combined with execution_date_lte parameter to receive only the selected period. (optional) - executionDateLte := time.Now() // time.Time | Returns objects less than or equal to the specified date. This can be combined with execution_date_gte parameter to receive only the selected period. (optional) - startDateGte := time.Now() // time.Time | Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. (optional) - startDateLte := time.Now() // time.Time | Returns objects less or equal the specified date. This can be combined with start_date_gte parameter to receive only the selected period. (optional) - endDateGte := time.Now() // time.Time | Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. (optional) - endDateLte := time.Now() // time.Time | Returns objects less than or equal to the specified date. This can be combined with start_date_gte parameter to receive only the selected period. (optional) - durationGte := float32(8.14) // float32 | Returns objects greater than or equal to the specified values. This can be combined with duration_lte parameter to receive only the selected period. (optional) - durationLte := float32(8.14) // float32 | Returns objects less than or equal to the specified values. This can be combined with duration_gte parameter to receive only the selected range. (optional) - state := []string{"Inner_example"} // []string | The value can be repeated to retrieve multiple matching values (OR condition). (optional) - pool := []string{"Inner_example"} // []string | The value can be repeated to retrieve multiple matching values (OR condition). (optional) - queue := []string{"Inner_example"} // []string | The value can be repeated to retrieve multiple matching values (OR condition). (optional) - orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.TaskInstanceApi.GetMappedTaskInstances(context.Background(), dagId, dagRunId, taskId).Limit(limit).Offset(offset).ExecutionDateGte(executionDateGte).ExecutionDateLte(executionDateLte).StartDateGte(startDateGte).StartDateLte(startDateLte).EndDateGte(endDateGte).EndDateLte(endDateLte).DurationGte(durationGte).DurationLte(durationLte).State(state).Pool(pool).Queue(queue).OrderBy(orderBy).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceApi.GetMappedTaskInstances``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetMappedTaskInstances`: TaskInstanceCollection - fmt.Fprintf(os.Stdout, "Response from `TaskInstanceApi.GetMappedTaskInstances`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + taskId := "taskId_example" // string | The task ID. + limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) + offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) + executionDateGte := time.Now() // time.Time | Returns objects greater or equal to the specified date. This can be combined with execution_date_lte parameter to receive only the selected period. (optional) + executionDateLte := time.Now() // time.Time | Returns objects less than or equal to the specified date. This can be combined with execution_date_gte parameter to receive only the selected period. (optional) + startDateGte := time.Now() // time.Time | Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. (optional) + startDateLte := time.Now() // time.Time | Returns objects less or equal the specified date. This can be combined with start_date_gte parameter to receive only the selected period. (optional) + endDateGte := time.Now() // time.Time | Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. (optional) + endDateLte := time.Now() // time.Time | Returns objects less than or equal to the specified date. This can be combined with start_date_gte parameter to receive only the selected period. (optional) + updatedAtGte := time.Now() // time.Time | Returns objects greater or equal the specified date. This can be combined with updated_at_lte parameter to receive only the selected period. *New in version 2.6.0* (optional) + updatedAtLte := time.Now() // time.Time | Returns objects less or equal the specified date. This can be combined with updated_at_gte parameter to receive only the selected period. *New in version 2.6.0* (optional) + durationGte := float32(8.14) // float32 | Returns objects greater than or equal to the specified values. This can be combined with duration_lte parameter to receive only the selected period. (optional) + durationLte := float32(8.14) // float32 | Returns objects less than or equal to the specified values. This can be combined with duration_gte parameter to receive only the selected range. (optional) + state := []string{"Inner_example"} // []string | The value can be repeated to retrieve multiple matching values (OR condition). (optional) + pool := []string{"Inner_example"} // []string | The value can be repeated to retrieve multiple matching values (OR condition). (optional) + queue := []string{"Inner_example"} // []string | The value can be repeated to retrieve multiple matching values (OR condition). (optional) + executor := []string{"Inner_example"} // []string | The value can be repeated to retrieve multiple matching values (OR condition). (optional) + orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TaskInstanceAPI.GetMappedTaskInstances(context.Background(), dagId, dagRunId, taskId).Limit(limit).Offset(offset).ExecutionDateGte(executionDateGte).ExecutionDateLte(executionDateLte).StartDateGte(startDateGte).StartDateLte(startDateLte).EndDateGte(endDateGte).EndDateLte(endDateLte).UpdatedAtGte(updatedAtGte).UpdatedAtLte(updatedAtLte).DurationGte(durationGte).DurationLte(durationLte).State(state).Pool(pool).Queue(queue).Executor(executor).OrderBy(orderBy).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceAPI.GetMappedTaskInstances``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetMappedTaskInstances`: TaskInstanceCollection + fmt.Fprintf(os.Stdout, "Response from `TaskInstanceAPI.GetMappedTaskInstances`: %v\n", resp) } ``` @@ -355,11 +595,14 @@ Name | Type | Description | Notes **startDateLte** | **time.Time** | Returns objects less or equal the specified date. This can be combined with start_date_gte parameter to receive only the selected period. | **endDateGte** | **time.Time** | Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. | **endDateLte** | **time.Time** | Returns objects less than or equal to the specified date. This can be combined with start_date_gte parameter to receive only the selected period. | + **updatedAtGte** | **time.Time** | Returns objects greater or equal the specified date. This can be combined with updated_at_lte parameter to receive only the selected period. *New in version 2.6.0* | + **updatedAtLte** | **time.Time** | Returns objects less or equal the specified date. This can be combined with updated_at_gte parameter to receive only the selected period. *New in version 2.6.0* | **durationGte** | **float32** | Returns objects greater than or equal to the specified values. This can be combined with duration_lte parameter to receive only the selected period. | **durationLte** | **float32** | Returns objects less than or equal to the specified values. This can be combined with duration_gte parameter to receive only the selected range. | **state** | **[]string** | The value can be repeated to retrieve multiple matching values (OR condition). | **pool** | **[]string** | The value can be repeated to retrieve multiple matching values (OR condition). | **queue** | **[]string** | The value can be repeated to retrieve multiple matching values (OR condition). | + **executor** | **[]string** | The value can be repeated to retrieve multiple matching values (OR condition). | **orderBy** | **string** | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* | ### Return type @@ -368,7 +611,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -392,26 +635,26 @@ Get a task instance package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - dagRunId := "dagRunId_example" // string | The DAG run ID. - taskId := "taskId_example" // string | The task ID. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.TaskInstanceApi.GetTaskInstance(context.Background(), dagId, dagRunId, taskId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceApi.GetTaskInstance``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetTaskInstance`: TaskInstance - fmt.Fprintf(os.Stdout, "Response from `TaskInstanceApi.GetTaskInstance`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + taskId := "taskId_example" // string | The task ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TaskInstanceAPI.GetTaskInstance(context.Background(), dagId, dagRunId, taskId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceAPI.GetTaskInstance``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetTaskInstance`: TaskInstance + fmt.Fprintf(os.Stdout, "Response from `TaskInstanceAPI.GetTaskInstance`: %v\n", resp) } ``` @@ -442,7 +685,244 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetTaskInstanceDependencies + +> TaskInstanceDependencyCollection GetTaskInstanceDependencies(ctx, dagId, dagRunId, taskId).Execute() + +Get task dependencies blocking task from getting scheduled. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./airflow" +) + +func main() { + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + taskId := "taskId_example" // string | The task ID. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TaskInstanceAPI.GetTaskInstanceDependencies(context.Background(), dagId, dagRunId, taskId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceAPI.GetTaskInstanceDependencies``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetTaskInstanceDependencies`: TaskInstanceDependencyCollection + fmt.Fprintf(os.Stdout, "Response from `TaskInstanceAPI.GetTaskInstanceDependencies`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**dagId** | **string** | The DAG ID. | +**dagRunId** | **string** | The DAG run ID. | +**taskId** | **string** | The task ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetTaskInstanceDependenciesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + +### Return type + +[**TaskInstanceDependencyCollection**](TaskInstanceDependencyCollection.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetTaskInstanceTries + +> TaskInstanceHistoryCollection GetTaskInstanceTries(ctx, dagId, dagRunId, taskId).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() + +List task instance tries + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./airflow" +) + +func main() { + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + taskId := "taskId_example" // string | The task ID. + limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) + offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) + orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TaskInstanceAPI.GetTaskInstanceTries(context.Background(), dagId, dagRunId, taskId).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceAPI.GetTaskInstanceTries``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetTaskInstanceTries`: TaskInstanceHistoryCollection + fmt.Fprintf(os.Stdout, "Response from `TaskInstanceAPI.GetTaskInstanceTries`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**dagId** | **string** | The DAG ID. | +**dagRunId** | **string** | The DAG run ID. | +**taskId** | **string** | The task ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetTaskInstanceTriesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **limit** | **int32** | The numbers of items to return. | [default to 100] + **offset** | **int32** | The number of items to skip before starting to collect the result set. | + **orderBy** | **string** | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* | + +### Return type + +[**TaskInstanceHistoryCollection**](TaskInstanceHistoryCollection.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetTaskInstanceTryDetails + +> TaskInstanceHistory GetTaskInstanceTryDetails(ctx, dagId, dagRunId, taskId, taskTryNumber).Execute() + +get taskinstance try + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./airflow" +) + +func main() { + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + taskId := "taskId_example" // string | The task ID. + taskTryNumber := int32(56) // int32 | The task try number. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TaskInstanceAPI.GetTaskInstanceTryDetails(context.Background(), dagId, dagRunId, taskId, taskTryNumber).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceAPI.GetTaskInstanceTryDetails``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetTaskInstanceTryDetails`: TaskInstanceHistory + fmt.Fprintf(os.Stdout, "Response from `TaskInstanceAPI.GetTaskInstanceTryDetails`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**dagId** | **string** | The DAG ID. | +**dagRunId** | **string** | The DAG run ID. | +**taskId** | **string** | The task ID. | +**taskTryNumber** | **int32** | The task try number. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetTaskInstanceTryDetailsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + +### Return type + +[**TaskInstanceHistory**](TaskInstanceHistory.md) + +### Authorization + +No authorization required ### HTTP request headers @@ -456,7 +936,7 @@ Name | Type | Description | Notes ## GetTaskInstances -> TaskInstanceCollection GetTaskInstances(ctx, dagId, dagRunId).ExecutionDateGte(executionDateGte).ExecutionDateLte(executionDateLte).StartDateGte(startDateGte).StartDateLte(startDateLte).EndDateGte(endDateGte).EndDateLte(endDateLte).DurationGte(durationGte).DurationLte(durationLte).State(state).Pool(pool).Queue(queue).Limit(limit).Offset(offset).Execute() +> TaskInstanceCollection GetTaskInstances(ctx, dagId, dagRunId).ExecutionDateGte(executionDateGte).ExecutionDateLte(executionDateLte).StartDateGte(startDateGte).StartDateLte(startDateLte).EndDateGte(endDateGte).EndDateLte(endDateLte).UpdatedAtGte(updatedAtGte).UpdatedAtLte(updatedAtLte).DurationGte(durationGte).DurationLte(durationLte).State(state).Pool(pool).Queue(queue).Executor(executor).Limit(limit).Offset(offset).Execute() List task instances @@ -468,39 +948,42 @@ List task instances package main import ( - "context" - "fmt" - "os" + "context" + "fmt" + "os" "time" - openapiclient "./openapi" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - dagRunId := "dagRunId_example" // string | The DAG run ID. - executionDateGte := time.Now() // time.Time | Returns objects greater or equal to the specified date. This can be combined with execution_date_lte parameter to receive only the selected period. (optional) - executionDateLte := time.Now() // time.Time | Returns objects less than or equal to the specified date. This can be combined with execution_date_gte parameter to receive only the selected period. (optional) - startDateGte := time.Now() // time.Time | Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. (optional) - startDateLte := time.Now() // time.Time | Returns objects less or equal the specified date. This can be combined with start_date_gte parameter to receive only the selected period. (optional) - endDateGte := time.Now() // time.Time | Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. (optional) - endDateLte := time.Now() // time.Time | Returns objects less than or equal to the specified date. This can be combined with start_date_gte parameter to receive only the selected period. (optional) - durationGte := float32(8.14) // float32 | Returns objects greater than or equal to the specified values. This can be combined with duration_lte parameter to receive only the selected period. (optional) - durationLte := float32(8.14) // float32 | Returns objects less than or equal to the specified values. This can be combined with duration_gte parameter to receive only the selected range. (optional) - state := []string{"Inner_example"} // []string | The value can be repeated to retrieve multiple matching values (OR condition). (optional) - pool := []string{"Inner_example"} // []string | The value can be repeated to retrieve multiple matching values (OR condition). (optional) - queue := []string{"Inner_example"} // []string | The value can be repeated to retrieve multiple matching values (OR condition). (optional) - limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) - offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.TaskInstanceApi.GetTaskInstances(context.Background(), dagId, dagRunId).ExecutionDateGte(executionDateGte).ExecutionDateLte(executionDateLte).StartDateGte(startDateGte).StartDateLte(startDateLte).EndDateGte(endDateGte).EndDateLte(endDateLte).DurationGte(durationGte).DurationLte(durationLte).State(state).Pool(pool).Queue(queue).Limit(limit).Offset(offset).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceApi.GetTaskInstances``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetTaskInstances`: TaskInstanceCollection - fmt.Fprintf(os.Stdout, "Response from `TaskInstanceApi.GetTaskInstances`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + executionDateGte := time.Now() // time.Time | Returns objects greater or equal to the specified date. This can be combined with execution_date_lte parameter to receive only the selected period. (optional) + executionDateLte := time.Now() // time.Time | Returns objects less than or equal to the specified date. This can be combined with execution_date_gte parameter to receive only the selected period. (optional) + startDateGte := time.Now() // time.Time | Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. (optional) + startDateLte := time.Now() // time.Time | Returns objects less or equal the specified date. This can be combined with start_date_gte parameter to receive only the selected period. (optional) + endDateGte := time.Now() // time.Time | Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. (optional) + endDateLte := time.Now() // time.Time | Returns objects less than or equal to the specified date. This can be combined with start_date_gte parameter to receive only the selected period. (optional) + updatedAtGte := time.Now() // time.Time | Returns objects greater or equal the specified date. This can be combined with updated_at_lte parameter to receive only the selected period. *New in version 2.6.0* (optional) + updatedAtLte := time.Now() // time.Time | Returns objects less or equal the specified date. This can be combined with updated_at_gte parameter to receive only the selected period. *New in version 2.6.0* (optional) + durationGte := float32(8.14) // float32 | Returns objects greater than or equal to the specified values. This can be combined with duration_lte parameter to receive only the selected period. (optional) + durationLte := float32(8.14) // float32 | Returns objects less than or equal to the specified values. This can be combined with duration_gte parameter to receive only the selected range. (optional) + state := []string{"Inner_example"} // []string | The value can be repeated to retrieve multiple matching values (OR condition). (optional) + pool := []string{"Inner_example"} // []string | The value can be repeated to retrieve multiple matching values (OR condition). (optional) + queue := []string{"Inner_example"} // []string | The value can be repeated to retrieve multiple matching values (OR condition). (optional) + executor := []string{"Inner_example"} // []string | The value can be repeated to retrieve multiple matching values (OR condition). (optional) + limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) + offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TaskInstanceAPI.GetTaskInstances(context.Background(), dagId, dagRunId).ExecutionDateGte(executionDateGte).ExecutionDateLte(executionDateLte).StartDateGte(startDateGte).StartDateLte(startDateLte).EndDateGte(endDateGte).EndDateLte(endDateLte).UpdatedAtGte(updatedAtGte).UpdatedAtLte(updatedAtLte).DurationGte(durationGte).DurationLte(durationLte).State(state).Pool(pool).Queue(queue).Executor(executor).Limit(limit).Offset(offset).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceAPI.GetTaskInstances``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetTaskInstances`: TaskInstanceCollection + fmt.Fprintf(os.Stdout, "Response from `TaskInstanceAPI.GetTaskInstances`: %v\n", resp) } ``` @@ -528,11 +1011,14 @@ Name | Type | Description | Notes **startDateLte** | **time.Time** | Returns objects less or equal the specified date. This can be combined with start_date_gte parameter to receive only the selected period. | **endDateGte** | **time.Time** | Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. | **endDateLte** | **time.Time** | Returns objects less than or equal to the specified date. This can be combined with start_date_gte parameter to receive only the selected period. | + **updatedAtGte** | **time.Time** | Returns objects greater or equal the specified date. This can be combined with updated_at_lte parameter to receive only the selected period. *New in version 2.6.0* | + **updatedAtLte** | **time.Time** | Returns objects less or equal the specified date. This can be combined with updated_at_gte parameter to receive only the selected period. *New in version 2.6.0* | **durationGte** | **float32** | Returns objects greater than or equal to the specified values. This can be combined with duration_lte parameter to receive only the selected period. | **durationLte** | **float32** | Returns objects less than or equal to the specified values. This can be combined with duration_gte parameter to receive only the selected range. | **state** | **[]string** | The value can be repeated to retrieve multiple matching values (OR condition). | **pool** | **[]string** | The value can be repeated to retrieve multiple matching values (OR condition). | **queue** | **[]string** | The value can be repeated to retrieve multiple matching values (OR condition). | + **executor** | **[]string** | The value can be repeated to retrieve multiple matching values (OR condition). | **limit** | **int32** | The numbers of items to return. | [default to 100] **offset** | **int32** | The number of items to skip before starting to collect the result set. | @@ -542,7 +1028,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -568,24 +1054,24 @@ List task instances (batch) package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - listTaskInstanceForm := *openapiclient.NewListTaskInstanceForm() // ListTaskInstanceForm | - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.TaskInstanceApi.GetTaskInstancesBatch(context.Background()).ListTaskInstanceForm(listTaskInstanceForm).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceApi.GetTaskInstancesBatch``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetTaskInstancesBatch`: TaskInstanceCollection - fmt.Fprintf(os.Stdout, "Response from `TaskInstanceApi.GetTaskInstancesBatch`: %v\n", resp) + listTaskInstanceForm := *openapiclient.NewListTaskInstanceForm() // ListTaskInstanceForm | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TaskInstanceAPI.GetTaskInstancesBatch(context.Background()).ListTaskInstanceForm(listTaskInstanceForm).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceAPI.GetTaskInstancesBatch``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetTaskInstancesBatch`: TaskInstanceCollection + fmt.Fprintf(os.Stdout, "Response from `TaskInstanceAPI.GetTaskInstancesBatch`: %v\n", resp) } ``` @@ -608,7 +1094,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -634,28 +1120,28 @@ Updates the state of a mapped task instance package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - dagRunId := "dagRunId_example" // string | The DAG run ID. - taskId := "taskId_example" // string | The task ID. - mapIndex := int32(56) // int32 | The map index. - updateTaskInstance := *openapiclient.NewUpdateTaskInstance() // UpdateTaskInstance | Parameters of action (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.TaskInstanceApi.PatchMappedTaskInstance(context.Background(), dagId, dagRunId, taskId, mapIndex).UpdateTaskInstance(updateTaskInstance).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceApi.PatchMappedTaskInstance``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PatchMappedTaskInstance`: TaskInstanceReference - fmt.Fprintf(os.Stdout, "Response from `TaskInstanceApi.PatchMappedTaskInstance`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + taskId := "taskId_example" // string | The task ID. + mapIndex := int32(56) // int32 | The map index. + updateTaskInstance := *openapiclient.NewUpdateTaskInstance() // UpdateTaskInstance | Parameters of action (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TaskInstanceAPI.PatchMappedTaskInstance(context.Background(), dagId, dagRunId, taskId, mapIndex).UpdateTaskInstance(updateTaskInstance).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceAPI.PatchMappedTaskInstance``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PatchMappedTaskInstance`: TaskInstanceReference + fmt.Fprintf(os.Stdout, "Response from `TaskInstanceAPI.PatchMappedTaskInstance`: %v\n", resp) } ``` @@ -689,7 +1175,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -715,27 +1201,27 @@ Updates the state of a task instance package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - dagRunId := "dagRunId_example" // string | The DAG run ID. - taskId := "taskId_example" // string | The task ID. - updateTaskInstance := *openapiclient.NewUpdateTaskInstance() // UpdateTaskInstance | Parameters of action - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.TaskInstanceApi.PatchTaskInstance(context.Background(), dagId, dagRunId, taskId).UpdateTaskInstance(updateTaskInstance).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceApi.PatchTaskInstance``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PatchTaskInstance`: TaskInstanceReference - fmt.Fprintf(os.Stdout, "Response from `TaskInstanceApi.PatchTaskInstance`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + taskId := "taskId_example" // string | The task ID. + updateTaskInstance := *openapiclient.NewUpdateTaskInstance() // UpdateTaskInstance | Parameters of action + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TaskInstanceAPI.PatchTaskInstance(context.Background(), dagId, dagRunId, taskId).UpdateTaskInstance(updateTaskInstance).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceAPI.PatchTaskInstance``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PatchTaskInstance`: TaskInstanceReference + fmt.Fprintf(os.Stdout, "Response from `TaskInstanceAPI.PatchTaskInstance`: %v\n", resp) } ``` @@ -767,7 +1253,166 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## SetMappedTaskInstanceNote + +> TaskInstance SetMappedTaskInstanceNote(ctx, dagId, dagRunId, taskId, mapIndex).SetTaskInstanceNote(setTaskInstanceNote).Execute() + +Update the TaskInstance note. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./airflow" +) + +func main() { + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + taskId := "taskId_example" // string | The task ID. + mapIndex := int32(56) // int32 | The map index. + setTaskInstanceNote := *openapiclient.NewSetTaskInstanceNote("Note_example") // SetTaskInstanceNote | Parameters of set Task Instance note. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TaskInstanceAPI.SetMappedTaskInstanceNote(context.Background(), dagId, dagRunId, taskId, mapIndex).SetTaskInstanceNote(setTaskInstanceNote).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceAPI.SetMappedTaskInstanceNote``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `SetMappedTaskInstanceNote`: TaskInstance + fmt.Fprintf(os.Stdout, "Response from `TaskInstanceAPI.SetMappedTaskInstanceNote`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**dagId** | **string** | The DAG ID. | +**dagRunId** | **string** | The DAG run ID. | +**taskId** | **string** | The task ID. | +**mapIndex** | **int32** | The map index. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiSetMappedTaskInstanceNoteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + **setTaskInstanceNote** | [**SetTaskInstanceNote**](SetTaskInstanceNote.md) | Parameters of set Task Instance note. | + +### Return type + +[**TaskInstance**](TaskInstance.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## SetTaskInstanceNote + +> TaskInstance SetTaskInstanceNote(ctx, dagId, dagRunId, taskId).SetTaskInstanceNote(setTaskInstanceNote).Execute() + +Update the TaskInstance note. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./airflow" +) + +func main() { + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + taskId := "taskId_example" // string | The task ID. + setTaskInstanceNote := *openapiclient.NewSetTaskInstanceNote("Note_example") // SetTaskInstanceNote | Parameters of set Task Instance note. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.TaskInstanceAPI.SetTaskInstanceNote(context.Background(), dagId, dagRunId, taskId).SetTaskInstanceNote(setTaskInstanceNote).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TaskInstanceAPI.SetTaskInstanceNote``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `SetTaskInstanceNote`: TaskInstance + fmt.Fprintf(os.Stdout, "Response from `TaskInstanceAPI.SetTaskInstanceNote`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**dagId** | **string** | The DAG ID. | +**dagRunId** | **string** | The DAG run ID. | +**taskId** | **string** | The task ID. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiSetTaskInstanceNoteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **setTaskInstanceNote** | [**SetTaskInstanceNote**](SetTaskInstanceNote.md) | Parameters of set Task Instance note. | + +### Return type + +[**TaskInstance**](TaskInstance.md) + +### Authorization + +No authorization required ### HTTP request headers diff --git a/airflow/docs/TaskInstanceCollection.md b/airflow/docs/TaskInstanceCollection.md index de636fb..a5941be 100644 --- a/airflow/docs/TaskInstanceCollection.md +++ b/airflow/docs/TaskInstanceCollection.md @@ -1,30 +1,11 @@ - - # TaskInstanceCollection ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] **TaskInstances** | Pointer to [**[]TaskInstance**](TaskInstance.md) | | [optional] -**TotalEntries** | Pointer to **int32** | Count of objects in the current result set. | [optional] ## Methods @@ -45,55 +26,55 @@ NewTaskInstanceCollectionWithDefaults instantiates a new TaskInstanceCollection This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetTaskInstances +### GetTotalEntries -`func (o *TaskInstanceCollection) GetTaskInstances() []TaskInstance` +`func (o *TaskInstanceCollection) GetTotalEntries() int32` -GetTaskInstances returns the TaskInstances field if non-nil, zero value otherwise. +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. -### GetTaskInstancesOk +### GetTotalEntriesOk -`func (o *TaskInstanceCollection) GetTaskInstancesOk() (*[]TaskInstance, bool)` +`func (o *TaskInstanceCollection) GetTotalEntriesOk() (*int32, bool)` -GetTaskInstancesOk returns a tuple with the TaskInstances field if it's non-nil, zero value otherwise +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTaskInstances +### SetTotalEntries -`func (o *TaskInstanceCollection) SetTaskInstances(v []TaskInstance)` +`func (o *TaskInstanceCollection) SetTotalEntries(v int32)` -SetTaskInstances sets TaskInstances field to given value. +SetTotalEntries sets TotalEntries field to given value. -### HasTaskInstances +### HasTotalEntries -`func (o *TaskInstanceCollection) HasTaskInstances() bool` +`func (o *TaskInstanceCollection) HasTotalEntries() bool` -HasTaskInstances returns a boolean if a field has been set. +HasTotalEntries returns a boolean if a field has been set. -### GetTotalEntries +### GetTaskInstances -`func (o *TaskInstanceCollection) GetTotalEntries() int32` +`func (o *TaskInstanceCollection) GetTaskInstances() []TaskInstance` -GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. +GetTaskInstances returns the TaskInstances field if non-nil, zero value otherwise. -### GetTotalEntriesOk +### GetTaskInstancesOk -`func (o *TaskInstanceCollection) GetTotalEntriesOk() (*int32, bool)` +`func (o *TaskInstanceCollection) GetTaskInstancesOk() (*[]TaskInstance, bool)` -GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +GetTaskInstancesOk returns a tuple with the TaskInstances field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTotalEntries +### SetTaskInstances -`func (o *TaskInstanceCollection) SetTotalEntries(v int32)` +`func (o *TaskInstanceCollection) SetTaskInstances(v []TaskInstance)` -SetTotalEntries sets TotalEntries field to given value. +SetTaskInstances sets TaskInstances field to given value. -### HasTotalEntries +### HasTaskInstances -`func (o *TaskInstanceCollection) HasTotalEntries() bool` +`func (o *TaskInstanceCollection) HasTaskInstances() bool` -HasTotalEntries returns a boolean if a field has been set. +HasTaskInstances returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/TaskInstanceDependencyCollection.md b/airflow/docs/TaskInstanceDependencyCollection.md new file mode 100644 index 0000000..394306f --- /dev/null +++ b/airflow/docs/TaskInstanceDependencyCollection.md @@ -0,0 +1,56 @@ +# TaskInstanceDependencyCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Dependencies** | Pointer to [**[]TaskFailedDependency**](TaskFailedDependency.md) | | [optional] + +## Methods + +### NewTaskInstanceDependencyCollection + +`func NewTaskInstanceDependencyCollection() *TaskInstanceDependencyCollection` + +NewTaskInstanceDependencyCollection instantiates a new TaskInstanceDependencyCollection object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTaskInstanceDependencyCollectionWithDefaults + +`func NewTaskInstanceDependencyCollectionWithDefaults() *TaskInstanceDependencyCollection` + +NewTaskInstanceDependencyCollectionWithDefaults instantiates a new TaskInstanceDependencyCollection object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDependencies + +`func (o *TaskInstanceDependencyCollection) GetDependencies() []TaskFailedDependency` + +GetDependencies returns the Dependencies field if non-nil, zero value otherwise. + +### GetDependenciesOk + +`func (o *TaskInstanceDependencyCollection) GetDependenciesOk() (*[]TaskFailedDependency, bool)` + +GetDependenciesOk returns a tuple with the Dependencies field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDependencies + +`func (o *TaskInstanceDependencyCollection) SetDependencies(v []TaskFailedDependency)` + +SetDependencies sets Dependencies field to given value. + +### HasDependencies + +`func (o *TaskInstanceDependencyCollection) HasDependencies() bool` + +HasDependencies returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/docs/TaskInstanceHistory.md b/airflow/docs/TaskInstanceHistory.md new file mode 100644 index 0000000..5c1b0b8 --- /dev/null +++ b/airflow/docs/TaskInstanceHistory.md @@ -0,0 +1,702 @@ +# TaskInstanceHistory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DagId** | Pointer to **string** | | [optional] +**DagRunId** | Pointer to **string** | The DagRun ID for this task instance *New in version 2.3.0* | [optional] +**Duration** | Pointer to **NullableFloat32** | | [optional] +**EndDate** | Pointer to **NullableString** | | [optional] +**Executor** | Pointer to **NullableString** | Executor the task is configured to run on or None (which indicates the default executor) *New in version 2.10.0* | [optional] +**ExecutorConfig** | Pointer to **string** | | [optional] +**Hostname** | Pointer to **string** | | [optional] +**MapIndex** | Pointer to **int32** | | [optional] +**MaxTries** | Pointer to **int32** | | [optional] +**Operator** | Pointer to **NullableString** | *Changed in version 2.1.1*&#58; Field becomes nullable. | [optional] +**Pid** | Pointer to **NullableInt32** | | [optional] +**Pool** | Pointer to **string** | | [optional] +**PoolSlots** | Pointer to **int32** | | [optional] +**PriorityWeight** | Pointer to **NullableInt32** | | [optional] +**Queue** | Pointer to **NullableString** | | [optional] +**QueuedWhen** | Pointer to **NullableString** | The datetime that the task enter the state QUEUE, also known as queue_at | [optional] +**StartDate** | Pointer to **NullableString** | | [optional] +**State** | Pointer to [**NullableTaskState**](TaskState.md) | | [optional] +**TaskDisplayName** | Pointer to **string** | Human centric display text for the task. *New in version 2.9.0* | [optional] +**TaskId** | Pointer to **string** | | [optional] +**TryNumber** | Pointer to **int32** | | [optional] +**Unixname** | Pointer to **string** | | [optional] + +## Methods + +### NewTaskInstanceHistory + +`func NewTaskInstanceHistory() *TaskInstanceHistory` + +NewTaskInstanceHistory instantiates a new TaskInstanceHistory object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTaskInstanceHistoryWithDefaults + +`func NewTaskInstanceHistoryWithDefaults() *TaskInstanceHistory` + +NewTaskInstanceHistoryWithDefaults instantiates a new TaskInstanceHistory object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDagId + +`func (o *TaskInstanceHistory) GetDagId() string` + +GetDagId returns the DagId field if non-nil, zero value otherwise. + +### GetDagIdOk + +`func (o *TaskInstanceHistory) GetDagIdOk() (*string, bool)` + +GetDagIdOk returns a tuple with the DagId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDagId + +`func (o *TaskInstanceHistory) SetDagId(v string)` + +SetDagId sets DagId field to given value. + +### HasDagId + +`func (o *TaskInstanceHistory) HasDagId() bool` + +HasDagId returns a boolean if a field has been set. + +### GetDagRunId + +`func (o *TaskInstanceHistory) GetDagRunId() string` + +GetDagRunId returns the DagRunId field if non-nil, zero value otherwise. + +### GetDagRunIdOk + +`func (o *TaskInstanceHistory) GetDagRunIdOk() (*string, bool)` + +GetDagRunIdOk returns a tuple with the DagRunId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDagRunId + +`func (o *TaskInstanceHistory) SetDagRunId(v string)` + +SetDagRunId sets DagRunId field to given value. + +### HasDagRunId + +`func (o *TaskInstanceHistory) HasDagRunId() bool` + +HasDagRunId returns a boolean if a field has been set. + +### GetDuration + +`func (o *TaskInstanceHistory) GetDuration() float32` + +GetDuration returns the Duration field if non-nil, zero value otherwise. + +### GetDurationOk + +`func (o *TaskInstanceHistory) GetDurationOk() (*float32, bool)` + +GetDurationOk returns a tuple with the Duration field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDuration + +`func (o *TaskInstanceHistory) SetDuration(v float32)` + +SetDuration sets Duration field to given value. + +### HasDuration + +`func (o *TaskInstanceHistory) HasDuration() bool` + +HasDuration returns a boolean if a field has been set. + +### SetDurationNil + +`func (o *TaskInstanceHistory) SetDurationNil(b bool)` + + SetDurationNil sets the value for Duration to be an explicit nil + +### UnsetDuration +`func (o *TaskInstanceHistory) UnsetDuration()` + +UnsetDuration ensures that no value is present for Duration, not even an explicit nil +### GetEndDate + +`func (o *TaskInstanceHistory) GetEndDate() string` + +GetEndDate returns the EndDate field if non-nil, zero value otherwise. + +### GetEndDateOk + +`func (o *TaskInstanceHistory) GetEndDateOk() (*string, bool)` + +GetEndDateOk returns a tuple with the EndDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEndDate + +`func (o *TaskInstanceHistory) SetEndDate(v string)` + +SetEndDate sets EndDate field to given value. + +### HasEndDate + +`func (o *TaskInstanceHistory) HasEndDate() bool` + +HasEndDate returns a boolean if a field has been set. + +### SetEndDateNil + +`func (o *TaskInstanceHistory) SetEndDateNil(b bool)` + + SetEndDateNil sets the value for EndDate to be an explicit nil + +### UnsetEndDate +`func (o *TaskInstanceHistory) UnsetEndDate()` + +UnsetEndDate ensures that no value is present for EndDate, not even an explicit nil +### GetExecutor + +`func (o *TaskInstanceHistory) GetExecutor() string` + +GetExecutor returns the Executor field if non-nil, zero value otherwise. + +### GetExecutorOk + +`func (o *TaskInstanceHistory) GetExecutorOk() (*string, bool)` + +GetExecutorOk returns a tuple with the Executor field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExecutor + +`func (o *TaskInstanceHistory) SetExecutor(v string)` + +SetExecutor sets Executor field to given value. + +### HasExecutor + +`func (o *TaskInstanceHistory) HasExecutor() bool` + +HasExecutor returns a boolean if a field has been set. + +### SetExecutorNil + +`func (o *TaskInstanceHistory) SetExecutorNil(b bool)` + + SetExecutorNil sets the value for Executor to be an explicit nil + +### UnsetExecutor +`func (o *TaskInstanceHistory) UnsetExecutor()` + +UnsetExecutor ensures that no value is present for Executor, not even an explicit nil +### GetExecutorConfig + +`func (o *TaskInstanceHistory) GetExecutorConfig() string` + +GetExecutorConfig returns the ExecutorConfig field if non-nil, zero value otherwise. + +### GetExecutorConfigOk + +`func (o *TaskInstanceHistory) GetExecutorConfigOk() (*string, bool)` + +GetExecutorConfigOk returns a tuple with the ExecutorConfig field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExecutorConfig + +`func (o *TaskInstanceHistory) SetExecutorConfig(v string)` + +SetExecutorConfig sets ExecutorConfig field to given value. + +### HasExecutorConfig + +`func (o *TaskInstanceHistory) HasExecutorConfig() bool` + +HasExecutorConfig returns a boolean if a field has been set. + +### GetHostname + +`func (o *TaskInstanceHistory) GetHostname() string` + +GetHostname returns the Hostname field if non-nil, zero value otherwise. + +### GetHostnameOk + +`func (o *TaskInstanceHistory) GetHostnameOk() (*string, bool)` + +GetHostnameOk returns a tuple with the Hostname field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetHostname + +`func (o *TaskInstanceHistory) SetHostname(v string)` + +SetHostname sets Hostname field to given value. + +### HasHostname + +`func (o *TaskInstanceHistory) HasHostname() bool` + +HasHostname returns a boolean if a field has been set. + +### GetMapIndex + +`func (o *TaskInstanceHistory) GetMapIndex() int32` + +GetMapIndex returns the MapIndex field if non-nil, zero value otherwise. + +### GetMapIndexOk + +`func (o *TaskInstanceHistory) GetMapIndexOk() (*int32, bool)` + +GetMapIndexOk returns a tuple with the MapIndex field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMapIndex + +`func (o *TaskInstanceHistory) SetMapIndex(v int32)` + +SetMapIndex sets MapIndex field to given value. + +### HasMapIndex + +`func (o *TaskInstanceHistory) HasMapIndex() bool` + +HasMapIndex returns a boolean if a field has been set. + +### GetMaxTries + +`func (o *TaskInstanceHistory) GetMaxTries() int32` + +GetMaxTries returns the MaxTries field if non-nil, zero value otherwise. + +### GetMaxTriesOk + +`func (o *TaskInstanceHistory) GetMaxTriesOk() (*int32, bool)` + +GetMaxTriesOk returns a tuple with the MaxTries field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxTries + +`func (o *TaskInstanceHistory) SetMaxTries(v int32)` + +SetMaxTries sets MaxTries field to given value. + +### HasMaxTries + +`func (o *TaskInstanceHistory) HasMaxTries() bool` + +HasMaxTries returns a boolean if a field has been set. + +### GetOperator + +`func (o *TaskInstanceHistory) GetOperator() string` + +GetOperator returns the Operator field if non-nil, zero value otherwise. + +### GetOperatorOk + +`func (o *TaskInstanceHistory) GetOperatorOk() (*string, bool)` + +GetOperatorOk returns a tuple with the Operator field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOperator + +`func (o *TaskInstanceHistory) SetOperator(v string)` + +SetOperator sets Operator field to given value. + +### HasOperator + +`func (o *TaskInstanceHistory) HasOperator() bool` + +HasOperator returns a boolean if a field has been set. + +### SetOperatorNil + +`func (o *TaskInstanceHistory) SetOperatorNil(b bool)` + + SetOperatorNil sets the value for Operator to be an explicit nil + +### UnsetOperator +`func (o *TaskInstanceHistory) UnsetOperator()` + +UnsetOperator ensures that no value is present for Operator, not even an explicit nil +### GetPid + +`func (o *TaskInstanceHistory) GetPid() int32` + +GetPid returns the Pid field if non-nil, zero value otherwise. + +### GetPidOk + +`func (o *TaskInstanceHistory) GetPidOk() (*int32, bool)` + +GetPidOk returns a tuple with the Pid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPid + +`func (o *TaskInstanceHistory) SetPid(v int32)` + +SetPid sets Pid field to given value. + +### HasPid + +`func (o *TaskInstanceHistory) HasPid() bool` + +HasPid returns a boolean if a field has been set. + +### SetPidNil + +`func (o *TaskInstanceHistory) SetPidNil(b bool)` + + SetPidNil sets the value for Pid to be an explicit nil + +### UnsetPid +`func (o *TaskInstanceHistory) UnsetPid()` + +UnsetPid ensures that no value is present for Pid, not even an explicit nil +### GetPool + +`func (o *TaskInstanceHistory) GetPool() string` + +GetPool returns the Pool field if non-nil, zero value otherwise. + +### GetPoolOk + +`func (o *TaskInstanceHistory) GetPoolOk() (*string, bool)` + +GetPoolOk returns a tuple with the Pool field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPool + +`func (o *TaskInstanceHistory) SetPool(v string)` + +SetPool sets Pool field to given value. + +### HasPool + +`func (o *TaskInstanceHistory) HasPool() bool` + +HasPool returns a boolean if a field has been set. + +### GetPoolSlots + +`func (o *TaskInstanceHistory) GetPoolSlots() int32` + +GetPoolSlots returns the PoolSlots field if non-nil, zero value otherwise. + +### GetPoolSlotsOk + +`func (o *TaskInstanceHistory) GetPoolSlotsOk() (*int32, bool)` + +GetPoolSlotsOk returns a tuple with the PoolSlots field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPoolSlots + +`func (o *TaskInstanceHistory) SetPoolSlots(v int32)` + +SetPoolSlots sets PoolSlots field to given value. + +### HasPoolSlots + +`func (o *TaskInstanceHistory) HasPoolSlots() bool` + +HasPoolSlots returns a boolean if a field has been set. + +### GetPriorityWeight + +`func (o *TaskInstanceHistory) GetPriorityWeight() int32` + +GetPriorityWeight returns the PriorityWeight field if non-nil, zero value otherwise. + +### GetPriorityWeightOk + +`func (o *TaskInstanceHistory) GetPriorityWeightOk() (*int32, bool)` + +GetPriorityWeightOk returns a tuple with the PriorityWeight field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPriorityWeight + +`func (o *TaskInstanceHistory) SetPriorityWeight(v int32)` + +SetPriorityWeight sets PriorityWeight field to given value. + +### HasPriorityWeight + +`func (o *TaskInstanceHistory) HasPriorityWeight() bool` + +HasPriorityWeight returns a boolean if a field has been set. + +### SetPriorityWeightNil + +`func (o *TaskInstanceHistory) SetPriorityWeightNil(b bool)` + + SetPriorityWeightNil sets the value for PriorityWeight to be an explicit nil + +### UnsetPriorityWeight +`func (o *TaskInstanceHistory) UnsetPriorityWeight()` + +UnsetPriorityWeight ensures that no value is present for PriorityWeight, not even an explicit nil +### GetQueue + +`func (o *TaskInstanceHistory) GetQueue() string` + +GetQueue returns the Queue field if non-nil, zero value otherwise. + +### GetQueueOk + +`func (o *TaskInstanceHistory) GetQueueOk() (*string, bool)` + +GetQueueOk returns a tuple with the Queue field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQueue + +`func (o *TaskInstanceHistory) SetQueue(v string)` + +SetQueue sets Queue field to given value. + +### HasQueue + +`func (o *TaskInstanceHistory) HasQueue() bool` + +HasQueue returns a boolean if a field has been set. + +### SetQueueNil + +`func (o *TaskInstanceHistory) SetQueueNil(b bool)` + + SetQueueNil sets the value for Queue to be an explicit nil + +### UnsetQueue +`func (o *TaskInstanceHistory) UnsetQueue()` + +UnsetQueue ensures that no value is present for Queue, not even an explicit nil +### GetQueuedWhen + +`func (o *TaskInstanceHistory) GetQueuedWhen() string` + +GetQueuedWhen returns the QueuedWhen field if non-nil, zero value otherwise. + +### GetQueuedWhenOk + +`func (o *TaskInstanceHistory) GetQueuedWhenOk() (*string, bool)` + +GetQueuedWhenOk returns a tuple with the QueuedWhen field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQueuedWhen + +`func (o *TaskInstanceHistory) SetQueuedWhen(v string)` + +SetQueuedWhen sets QueuedWhen field to given value. + +### HasQueuedWhen + +`func (o *TaskInstanceHistory) HasQueuedWhen() bool` + +HasQueuedWhen returns a boolean if a field has been set. + +### SetQueuedWhenNil + +`func (o *TaskInstanceHistory) SetQueuedWhenNil(b bool)` + + SetQueuedWhenNil sets the value for QueuedWhen to be an explicit nil + +### UnsetQueuedWhen +`func (o *TaskInstanceHistory) UnsetQueuedWhen()` + +UnsetQueuedWhen ensures that no value is present for QueuedWhen, not even an explicit nil +### GetStartDate + +`func (o *TaskInstanceHistory) GetStartDate() string` + +GetStartDate returns the StartDate field if non-nil, zero value otherwise. + +### GetStartDateOk + +`func (o *TaskInstanceHistory) GetStartDateOk() (*string, bool)` + +GetStartDateOk returns a tuple with the StartDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartDate + +`func (o *TaskInstanceHistory) SetStartDate(v string)` + +SetStartDate sets StartDate field to given value. + +### HasStartDate + +`func (o *TaskInstanceHistory) HasStartDate() bool` + +HasStartDate returns a boolean if a field has been set. + +### SetStartDateNil + +`func (o *TaskInstanceHistory) SetStartDateNil(b bool)` + + SetStartDateNil sets the value for StartDate to be an explicit nil + +### UnsetStartDate +`func (o *TaskInstanceHistory) UnsetStartDate()` + +UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil +### GetState + +`func (o *TaskInstanceHistory) GetState() TaskState` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *TaskInstanceHistory) GetStateOk() (*TaskState, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *TaskInstanceHistory) SetState(v TaskState)` + +SetState sets State field to given value. + +### HasState + +`func (o *TaskInstanceHistory) HasState() bool` + +HasState returns a boolean if a field has been set. + +### SetStateNil + +`func (o *TaskInstanceHistory) SetStateNil(b bool)` + + SetStateNil sets the value for State to be an explicit nil + +### UnsetState +`func (o *TaskInstanceHistory) UnsetState()` + +UnsetState ensures that no value is present for State, not even an explicit nil +### GetTaskDisplayName + +`func (o *TaskInstanceHistory) GetTaskDisplayName() string` + +GetTaskDisplayName returns the TaskDisplayName field if non-nil, zero value otherwise. + +### GetTaskDisplayNameOk + +`func (o *TaskInstanceHistory) GetTaskDisplayNameOk() (*string, bool)` + +GetTaskDisplayNameOk returns a tuple with the TaskDisplayName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTaskDisplayName + +`func (o *TaskInstanceHistory) SetTaskDisplayName(v string)` + +SetTaskDisplayName sets TaskDisplayName field to given value. + +### HasTaskDisplayName + +`func (o *TaskInstanceHistory) HasTaskDisplayName() bool` + +HasTaskDisplayName returns a boolean if a field has been set. + +### GetTaskId + +`func (o *TaskInstanceHistory) GetTaskId() string` + +GetTaskId returns the TaskId field if non-nil, zero value otherwise. + +### GetTaskIdOk + +`func (o *TaskInstanceHistory) GetTaskIdOk() (*string, bool)` + +GetTaskIdOk returns a tuple with the TaskId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTaskId + +`func (o *TaskInstanceHistory) SetTaskId(v string)` + +SetTaskId sets TaskId field to given value. + +### HasTaskId + +`func (o *TaskInstanceHistory) HasTaskId() bool` + +HasTaskId returns a boolean if a field has been set. + +### GetTryNumber + +`func (o *TaskInstanceHistory) GetTryNumber() int32` + +GetTryNumber returns the TryNumber field if non-nil, zero value otherwise. + +### GetTryNumberOk + +`func (o *TaskInstanceHistory) GetTryNumberOk() (*int32, bool)` + +GetTryNumberOk returns a tuple with the TryNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTryNumber + +`func (o *TaskInstanceHistory) SetTryNumber(v int32)` + +SetTryNumber sets TryNumber field to given value. + +### HasTryNumber + +`func (o *TaskInstanceHistory) HasTryNumber() bool` + +HasTryNumber returns a boolean if a field has been set. + +### GetUnixname + +`func (o *TaskInstanceHistory) GetUnixname() string` + +GetUnixname returns the Unixname field if non-nil, zero value otherwise. + +### GetUnixnameOk + +`func (o *TaskInstanceHistory) GetUnixnameOk() (*string, bool)` + +GetUnixnameOk returns a tuple with the Unixname field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUnixname + +`func (o *TaskInstanceHistory) SetUnixname(v string)` + +SetUnixname sets Unixname field to given value. + +### HasUnixname + +`func (o *TaskInstanceHistory) HasUnixname() bool` + +HasUnixname returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/docs/TaskInstanceHistoryCollection.md b/airflow/docs/TaskInstanceHistoryCollection.md new file mode 100644 index 0000000..369f8b0 --- /dev/null +++ b/airflow/docs/TaskInstanceHistoryCollection.md @@ -0,0 +1,82 @@ +# TaskInstanceHistoryCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] +**TaskInstancesHistory** | Pointer to [**[]TaskInstanceHistory**](TaskInstanceHistory.md) | | [optional] + +## Methods + +### NewTaskInstanceHistoryCollection + +`func NewTaskInstanceHistoryCollection() *TaskInstanceHistoryCollection` + +NewTaskInstanceHistoryCollection instantiates a new TaskInstanceHistoryCollection object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTaskInstanceHistoryCollectionWithDefaults + +`func NewTaskInstanceHistoryCollectionWithDefaults() *TaskInstanceHistoryCollection` + +NewTaskInstanceHistoryCollectionWithDefaults instantiates a new TaskInstanceHistoryCollection object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotalEntries + +`func (o *TaskInstanceHistoryCollection) GetTotalEntries() int32` + +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. + +### GetTotalEntriesOk + +`func (o *TaskInstanceHistoryCollection) GetTotalEntriesOk() (*int32, bool)` + +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalEntries + +`func (o *TaskInstanceHistoryCollection) SetTotalEntries(v int32)` + +SetTotalEntries sets TotalEntries field to given value. + +### HasTotalEntries + +`func (o *TaskInstanceHistoryCollection) HasTotalEntries() bool` + +HasTotalEntries returns a boolean if a field has been set. + +### GetTaskInstancesHistory + +`func (o *TaskInstanceHistoryCollection) GetTaskInstancesHistory() []TaskInstanceHistory` + +GetTaskInstancesHistory returns the TaskInstancesHistory field if non-nil, zero value otherwise. + +### GetTaskInstancesHistoryOk + +`func (o *TaskInstanceHistoryCollection) GetTaskInstancesHistoryOk() (*[]TaskInstanceHistory, bool)` + +GetTaskInstancesHistoryOk returns a tuple with the TaskInstancesHistory field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTaskInstancesHistory + +`func (o *TaskInstanceHistoryCollection) SetTaskInstancesHistory(v []TaskInstanceHistory)` + +SetTaskInstancesHistory sets TaskInstancesHistory field to given value. + +### HasTaskInstancesHistory + +`func (o *TaskInstanceHistoryCollection) HasTaskInstancesHistory() bool` + +HasTaskInstancesHistory returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/docs/TaskInstanceReference.md b/airflow/docs/TaskInstanceReference.md index a667c2b..0451cbc 100644 --- a/airflow/docs/TaskInstanceReference.md +++ b/airflow/docs/TaskInstanceReference.md @@ -1,32 +1,13 @@ - - # TaskInstanceReference ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**TaskId** | Pointer to **string** | The task ID. | [optional] [readonly] **DagId** | Pointer to **string** | The DAG ID. | [optional] [readonly] -**ExecutionDate** | Pointer to **string** | | [optional] [readonly] **DagRunId** | Pointer to **string** | The DAG run ID. | [optional] [readonly] +**ExecutionDate** | Pointer to **string** | | [optional] [readonly] +**TaskId** | Pointer to **string** | The task ID. | [optional] [readonly] ## Methods @@ -47,55 +28,55 @@ NewTaskInstanceReferenceWithDefaults instantiates a new TaskInstanceReference ob This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetTaskId +### GetDagId -`func (o *TaskInstanceReference) GetTaskId() string` +`func (o *TaskInstanceReference) GetDagId() string` -GetTaskId returns the TaskId field if non-nil, zero value otherwise. +GetDagId returns the DagId field if non-nil, zero value otherwise. -### GetTaskIdOk +### GetDagIdOk -`func (o *TaskInstanceReference) GetTaskIdOk() (*string, bool)` +`func (o *TaskInstanceReference) GetDagIdOk() (*string, bool)` -GetTaskIdOk returns a tuple with the TaskId field if it's non-nil, zero value otherwise +GetDagIdOk returns a tuple with the DagId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTaskId +### SetDagId -`func (o *TaskInstanceReference) SetTaskId(v string)` +`func (o *TaskInstanceReference) SetDagId(v string)` -SetTaskId sets TaskId field to given value. +SetDagId sets DagId field to given value. -### HasTaskId +### HasDagId -`func (o *TaskInstanceReference) HasTaskId() bool` +`func (o *TaskInstanceReference) HasDagId() bool` -HasTaskId returns a boolean if a field has been set. +HasDagId returns a boolean if a field has been set. -### GetDagId +### GetDagRunId -`func (o *TaskInstanceReference) GetDagId() string` +`func (o *TaskInstanceReference) GetDagRunId() string` -GetDagId returns the DagId field if non-nil, zero value otherwise. +GetDagRunId returns the DagRunId field if non-nil, zero value otherwise. -### GetDagIdOk +### GetDagRunIdOk -`func (o *TaskInstanceReference) GetDagIdOk() (*string, bool)` +`func (o *TaskInstanceReference) GetDagRunIdOk() (*string, bool)` -GetDagIdOk returns a tuple with the DagId field if it's non-nil, zero value otherwise +GetDagRunIdOk returns a tuple with the DagRunId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDagId +### SetDagRunId -`func (o *TaskInstanceReference) SetDagId(v string)` +`func (o *TaskInstanceReference) SetDagRunId(v string)` -SetDagId sets DagId field to given value. +SetDagRunId sets DagRunId field to given value. -### HasDagId +### HasDagRunId -`func (o *TaskInstanceReference) HasDagId() bool` +`func (o *TaskInstanceReference) HasDagRunId() bool` -HasDagId returns a boolean if a field has been set. +HasDagRunId returns a boolean if a field has been set. ### GetExecutionDate @@ -122,30 +103,30 @@ SetExecutionDate sets ExecutionDate field to given value. HasExecutionDate returns a boolean if a field has been set. -### GetDagRunId +### GetTaskId -`func (o *TaskInstanceReference) GetDagRunId() string` +`func (o *TaskInstanceReference) GetTaskId() string` -GetDagRunId returns the DagRunId field if non-nil, zero value otherwise. +GetTaskId returns the TaskId field if non-nil, zero value otherwise. -### GetDagRunIdOk +### GetTaskIdOk -`func (o *TaskInstanceReference) GetDagRunIdOk() (*string, bool)` +`func (o *TaskInstanceReference) GetTaskIdOk() (*string, bool)` -GetDagRunIdOk returns a tuple with the DagRunId field if it's non-nil, zero value otherwise +GetTaskIdOk returns a tuple with the TaskId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDagRunId +### SetTaskId -`func (o *TaskInstanceReference) SetDagRunId(v string)` +`func (o *TaskInstanceReference) SetTaskId(v string)` -SetDagRunId sets DagRunId field to given value. +SetTaskId sets TaskId field to given value. -### HasDagRunId +### HasTaskId -`func (o *TaskInstanceReference) HasDagRunId() bool` +`func (o *TaskInstanceReference) HasTaskId() bool` -HasDagRunId returns a boolean if a field has been set. +HasTaskId returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/TaskInstanceReferenceCollection.md b/airflow/docs/TaskInstanceReferenceCollection.md index b83e103..a45c36b 100644 --- a/airflow/docs/TaskInstanceReferenceCollection.md +++ b/airflow/docs/TaskInstanceReferenceCollection.md @@ -1,22 +1,3 @@ - - # TaskInstanceReferenceCollection ## Properties diff --git a/airflow/docs/TaskOutletDatasetReference.md b/airflow/docs/TaskOutletDatasetReference.md index cf2efc7..da8251d 100644 --- a/airflow/docs/TaskOutletDatasetReference.md +++ b/airflow/docs/TaskOutletDatasetReference.md @@ -1,31 +1,12 @@ - - # TaskOutletDatasetReference ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**CreatedAt** | Pointer to **string** | The dataset creation time | [optional] **DagId** | Pointer to **NullableString** | The DAG ID that updates the dataset. | [optional] **TaskId** | Pointer to **NullableString** | The task ID that updates the dataset. | [optional] -**CreatedAt** | Pointer to **string** | The dataset creation time | [optional] **UpdatedAt** | Pointer to **string** | The dataset update time | [optional] ## Methods @@ -47,6 +28,31 @@ NewTaskOutletDatasetReferenceWithDefaults instantiates a new TaskOutletDatasetRe This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set +### GetCreatedAt + +`func (o *TaskOutletDatasetReference) GetCreatedAt() string` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *TaskOutletDatasetReference) GetCreatedAtOk() (*string, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *TaskOutletDatasetReference) SetCreatedAt(v string)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *TaskOutletDatasetReference) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + ### GetDagId `func (o *TaskOutletDatasetReference) GetDagId() string` @@ -117,31 +123,6 @@ HasTaskId returns a boolean if a field has been set. `func (o *TaskOutletDatasetReference) UnsetTaskId()` UnsetTaskId ensures that no value is present for TaskId, not even an explicit nil -### GetCreatedAt - -`func (o *TaskOutletDatasetReference) GetCreatedAt() string` - -GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. - -### GetCreatedAtOk - -`func (o *TaskOutletDatasetReference) GetCreatedAtOk() (*string, bool)` - -GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedAt - -`func (o *TaskOutletDatasetReference) SetCreatedAt(v string)` - -SetCreatedAt sets CreatedAt field to given value. - -### HasCreatedAt - -`func (o *TaskOutletDatasetReference) HasCreatedAt() bool` - -HasCreatedAt returns a boolean if a field has been set. - ### GetUpdatedAt `func (o *TaskOutletDatasetReference) GetUpdatedAt() string` diff --git a/airflow/docs/TaskState.md b/airflow/docs/TaskState.md index ae9b443..0d93122 100644 --- a/airflow/docs/TaskState.md +++ b/airflow/docs/TaskState.md @@ -1,22 +1,3 @@ - - # TaskState ## Enum diff --git a/airflow/docs/TimeDelta.md b/airflow/docs/TimeDelta.md index ad6f458..6741a7c 100644 --- a/airflow/docs/TimeDelta.md +++ b/airflow/docs/TimeDelta.md @@ -1,22 +1,3 @@ - - # TimeDelta ## Properties @@ -25,14 +6,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Type** | **string** | | **Days** | **int32** | | -**Seconds** | **int32** | | **Microseconds** | **int32** | | +**Seconds** | **int32** | | ## Methods ### NewTimeDelta -`func NewTimeDelta(type_ string, days int32, seconds int32, microseconds int32, ) *TimeDelta` +`func NewTimeDelta(type_ string, days int32, microseconds int32, seconds int32, ) *TimeDelta` NewTimeDelta instantiates a new TimeDelta object This constructor will assign default values to properties that have it defined, @@ -87,44 +68,44 @@ and a boolean to check if the value has been set. SetDays sets Days field to given value. -### GetSeconds +### GetMicroseconds -`func (o *TimeDelta) GetSeconds() int32` +`func (o *TimeDelta) GetMicroseconds() int32` -GetSeconds returns the Seconds field if non-nil, zero value otherwise. +GetMicroseconds returns the Microseconds field if non-nil, zero value otherwise. -### GetSecondsOk +### GetMicrosecondsOk -`func (o *TimeDelta) GetSecondsOk() (*int32, bool)` +`func (o *TimeDelta) GetMicrosecondsOk() (*int32, bool)` -GetSecondsOk returns a tuple with the Seconds field if it's non-nil, zero value otherwise +GetMicrosecondsOk returns a tuple with the Microseconds field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetSeconds +### SetMicroseconds -`func (o *TimeDelta) SetSeconds(v int32)` +`func (o *TimeDelta) SetMicroseconds(v int32)` -SetSeconds sets Seconds field to given value. +SetMicroseconds sets Microseconds field to given value. -### GetMicroseconds +### GetSeconds -`func (o *TimeDelta) GetMicroseconds() int32` +`func (o *TimeDelta) GetSeconds() int32` -GetMicroseconds returns the Microseconds field if non-nil, zero value otherwise. +GetSeconds returns the Seconds field if non-nil, zero value otherwise. -### GetMicrosecondsOk +### GetSecondsOk -`func (o *TimeDelta) GetMicrosecondsOk() (*int32, bool)` +`func (o *TimeDelta) GetSecondsOk() (*int32, bool)` -GetMicrosecondsOk returns a tuple with the Microseconds field if it's non-nil, zero value otherwise +GetSecondsOk returns a tuple with the Seconds field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetMicroseconds +### SetSeconds -`func (o *TimeDelta) SetMicroseconds(v int32)` +`func (o *TimeDelta) SetSeconds(v int32)` -SetMicroseconds sets Microseconds field to given value. +SetSeconds sets Seconds field to given value. diff --git a/airflow/docs/Trigger.md b/airflow/docs/Trigger.md index 30e6839..808c1d8 100644 --- a/airflow/docs/Trigger.md +++ b/airflow/docs/Trigger.md @@ -1,32 +1,13 @@ - - # Trigger ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | Pointer to **int32** | | [optional] **Classpath** | Pointer to **string** | | [optional] -**Kwargs** | Pointer to **string** | | [optional] **CreatedDate** | Pointer to **string** | | [optional] +**Id** | Pointer to **int32** | | [optional] +**Kwargs** | Pointer to **string** | | [optional] **TriggererId** | Pointer to **NullableInt32** | | [optional] ## Methods @@ -48,105 +29,105 @@ NewTriggerWithDefaults instantiates a new Trigger object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetId +### GetClasspath -`func (o *Trigger) GetId() int32` +`func (o *Trigger) GetClasspath() string` -GetId returns the Id field if non-nil, zero value otherwise. +GetClasspath returns the Classpath field if non-nil, zero value otherwise. -### GetIdOk +### GetClasspathOk -`func (o *Trigger) GetIdOk() (*int32, bool)` +`func (o *Trigger) GetClasspathOk() (*string, bool)` -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +GetClasspathOk returns a tuple with the Classpath field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetId +### SetClasspath -`func (o *Trigger) SetId(v int32)` +`func (o *Trigger) SetClasspath(v string)` -SetId sets Id field to given value. +SetClasspath sets Classpath field to given value. -### HasId +### HasClasspath -`func (o *Trigger) HasId() bool` +`func (o *Trigger) HasClasspath() bool` -HasId returns a boolean if a field has been set. +HasClasspath returns a boolean if a field has been set. -### GetClasspath +### GetCreatedDate -`func (o *Trigger) GetClasspath() string` +`func (o *Trigger) GetCreatedDate() string` -GetClasspath returns the Classpath field if non-nil, zero value otherwise. +GetCreatedDate returns the CreatedDate field if non-nil, zero value otherwise. -### GetClasspathOk +### GetCreatedDateOk -`func (o *Trigger) GetClasspathOk() (*string, bool)` +`func (o *Trigger) GetCreatedDateOk() (*string, bool)` -GetClasspathOk returns a tuple with the Classpath field if it's non-nil, zero value otherwise +GetCreatedDateOk returns a tuple with the CreatedDate field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetClasspath +### SetCreatedDate -`func (o *Trigger) SetClasspath(v string)` +`func (o *Trigger) SetCreatedDate(v string)` -SetClasspath sets Classpath field to given value. +SetCreatedDate sets CreatedDate field to given value. -### HasClasspath +### HasCreatedDate -`func (o *Trigger) HasClasspath() bool` +`func (o *Trigger) HasCreatedDate() bool` -HasClasspath returns a boolean if a field has been set. +HasCreatedDate returns a boolean if a field has been set. -### GetKwargs +### GetId -`func (o *Trigger) GetKwargs() string` +`func (o *Trigger) GetId() int32` -GetKwargs returns the Kwargs field if non-nil, zero value otherwise. +GetId returns the Id field if non-nil, zero value otherwise. -### GetKwargsOk +### GetIdOk -`func (o *Trigger) GetKwargsOk() (*string, bool)` +`func (o *Trigger) GetIdOk() (*int32, bool)` -GetKwargsOk returns a tuple with the Kwargs field if it's non-nil, zero value otherwise +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetKwargs +### SetId -`func (o *Trigger) SetKwargs(v string)` +`func (o *Trigger) SetId(v int32)` -SetKwargs sets Kwargs field to given value. +SetId sets Id field to given value. -### HasKwargs +### HasId -`func (o *Trigger) HasKwargs() bool` +`func (o *Trigger) HasId() bool` -HasKwargs returns a boolean if a field has been set. +HasId returns a boolean if a field has been set. -### GetCreatedDate +### GetKwargs -`func (o *Trigger) GetCreatedDate() string` +`func (o *Trigger) GetKwargs() string` -GetCreatedDate returns the CreatedDate field if non-nil, zero value otherwise. +GetKwargs returns the Kwargs field if non-nil, zero value otherwise. -### GetCreatedDateOk +### GetKwargsOk -`func (o *Trigger) GetCreatedDateOk() (*string, bool)` +`func (o *Trigger) GetKwargsOk() (*string, bool)` -GetCreatedDateOk returns a tuple with the CreatedDate field if it's non-nil, zero value otherwise +GetKwargsOk returns a tuple with the Kwargs field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetCreatedDate +### SetKwargs -`func (o *Trigger) SetCreatedDate(v string)` +`func (o *Trigger) SetKwargs(v string)` -SetCreatedDate sets CreatedDate field to given value. +SetKwargs sets Kwargs field to given value. -### HasCreatedDate +### HasKwargs -`func (o *Trigger) HasCreatedDate() bool` +`func (o *Trigger) HasKwargs() bool` -HasCreatedDate returns a boolean if a field has been set. +HasKwargs returns a boolean if a field has been set. ### GetTriggererId diff --git a/airflow/docs/TriggerRule.md b/airflow/docs/TriggerRule.md index 83c3bcc..37637a4 100644 --- a/airflow/docs/TriggerRule.md +++ b/airflow/docs/TriggerRule.md @@ -1,22 +1,3 @@ - - # TriggerRule ## Enum @@ -28,10 +9,14 @@ * `ALL_DONE` (value: `"all_done"`) +* `ALL_DONE_SETUP_SUCCESS` (value: `"all_done_setup_success"`) + * `ONE_SUCCESS` (value: `"one_success"`) * `ONE_FAILED` (value: `"one_failed"`) +* `ONE_DONE` (value: `"one_done"`) + * `NONE_FAILED` (value: `"none_failed"`) * `NONE_SKIPPED` (value: `"none_skipped"`) @@ -42,6 +27,10 @@ * `DUMMY` (value: `"dummy"`) +* `ALL_SKIPPED` (value: `"all_skipped"`) + +* `ALWAYS` (value: `"always"`) + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/TriggererStatus.md b/airflow/docs/TriggererStatus.md new file mode 100644 index 0000000..39c5374 --- /dev/null +++ b/airflow/docs/TriggererStatus.md @@ -0,0 +1,102 @@ +# TriggererStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LatestTriggererHeartbeat** | Pointer to **NullableString** | The time the triggerer last did a heartbeat. | [optional] [readonly] +**Status** | Pointer to [**NullableHealthStatus**](HealthStatus.md) | | [optional] + +## Methods + +### NewTriggererStatus + +`func NewTriggererStatus() *TriggererStatus` + +NewTriggererStatus instantiates a new TriggererStatus object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewTriggererStatusWithDefaults + +`func NewTriggererStatusWithDefaults() *TriggererStatus` + +NewTriggererStatusWithDefaults instantiates a new TriggererStatus object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLatestTriggererHeartbeat + +`func (o *TriggererStatus) GetLatestTriggererHeartbeat() string` + +GetLatestTriggererHeartbeat returns the LatestTriggererHeartbeat field if non-nil, zero value otherwise. + +### GetLatestTriggererHeartbeatOk + +`func (o *TriggererStatus) GetLatestTriggererHeartbeatOk() (*string, bool)` + +GetLatestTriggererHeartbeatOk returns a tuple with the LatestTriggererHeartbeat field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLatestTriggererHeartbeat + +`func (o *TriggererStatus) SetLatestTriggererHeartbeat(v string)` + +SetLatestTriggererHeartbeat sets LatestTriggererHeartbeat field to given value. + +### HasLatestTriggererHeartbeat + +`func (o *TriggererStatus) HasLatestTriggererHeartbeat() bool` + +HasLatestTriggererHeartbeat returns a boolean if a field has been set. + +### SetLatestTriggererHeartbeatNil + +`func (o *TriggererStatus) SetLatestTriggererHeartbeatNil(b bool)` + + SetLatestTriggererHeartbeatNil sets the value for LatestTriggererHeartbeat to be an explicit nil + +### UnsetLatestTriggererHeartbeat +`func (o *TriggererStatus) UnsetLatestTriggererHeartbeat()` + +UnsetLatestTriggererHeartbeat ensures that no value is present for LatestTriggererHeartbeat, not even an explicit nil +### GetStatus + +`func (o *TriggererStatus) GetStatus() HealthStatus` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *TriggererStatus) GetStatusOk() (*HealthStatus, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *TriggererStatus) SetStatus(v HealthStatus)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *TriggererStatus) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### SetStatusNil + +`func (o *TriggererStatus) SetStatusNil(b bool)` + + SetStatusNil sets the value for Status to be an explicit nil + +### UnsetStatus +`func (o *TriggererStatus) UnsetStatus()` + +UnsetStatus ensures that no value is present for Status, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/docs/UpdateDagRunState.md b/airflow/docs/UpdateDagRunState.md index c6ffb25..bbfdb61 100644 --- a/airflow/docs/UpdateDagRunState.md +++ b/airflow/docs/UpdateDagRunState.md @@ -1,22 +1,3 @@ - - # UpdateDagRunState ## Properties diff --git a/airflow/docs/UpdateTaskInstance.md b/airflow/docs/UpdateTaskInstance.md index 8b20d3e..9b14bf7 100644 --- a/airflow/docs/UpdateTaskInstance.md +++ b/airflow/docs/UpdateTaskInstance.md @@ -1,30 +1,11 @@ - - # UpdateTaskInstance ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**DryRun** | Pointer to **bool** | If set, don't actually run this operation. The response will contain the task instance planned to be affected, but won't be modified in any way. | [optional] [default to false] -**NewState** | Pointer to **string** | Expected new state. | [optional] +**DryRun** | Pointer to **bool** | If set, don't actually run this operation. The response will contain the task instance planned to be affected, but won't be modified in any way. | [optional] [default to true] +**NewState** | Pointer to [**UpdateTaskState**](UpdateTaskState.md) | | [optional] ## Methods @@ -72,20 +53,20 @@ HasDryRun returns a boolean if a field has been set. ### GetNewState -`func (o *UpdateTaskInstance) GetNewState() string` +`func (o *UpdateTaskInstance) GetNewState() UpdateTaskState` GetNewState returns the NewState field if non-nil, zero value otherwise. ### GetNewStateOk -`func (o *UpdateTaskInstance) GetNewStateOk() (*string, bool)` +`func (o *UpdateTaskInstance) GetNewStateOk() (*UpdateTaskState, bool)` GetNewStateOk returns a tuple with the NewState field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetNewState -`func (o *UpdateTaskInstance) SetNewState(v string)` +`func (o *UpdateTaskInstance) SetNewState(v UpdateTaskState)` SetNewState sets NewState field to given value. diff --git a/airflow/docs/UpdateTaskInstancesState.md b/airflow/docs/UpdateTaskInstancesState.md index 1318b66..5c09f8c 100644 --- a/airflow/docs/UpdateTaskInstancesState.md +++ b/airflow/docs/UpdateTaskInstancesState.md @@ -1,37 +1,18 @@ - - # UpdateTaskInstancesState ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**DagRunId** | Pointer to **string** | The task instance's DAG run ID. Either set this or execution_date but not both. *New in version 2.3.0* | [optional] **DryRun** | Pointer to **bool** | If set, don't actually run this operation. The response will contain a list of task instances planned to be affected, but won't be modified in any way. | [optional] [default to true] -**TaskId** | Pointer to **string** | The task ID. | [optional] **ExecutionDate** | Pointer to **string** | The execution date. Either set this or dag_run_id but not both. | [optional] -**DagRunId** | Pointer to **string** | The task instance's DAG run ID. Either set this or execution_date but not both. *New in version 2.3.0* | [optional] -**IncludeUpstream** | Pointer to **bool** | If set to true, upstream tasks are also affected. | [optional] **IncludeDownstream** | Pointer to **bool** | If set to true, downstream tasks are also affected. | [optional] **IncludeFuture** | Pointer to **bool** | If set to True, also tasks from future DAG Runs are affected. | [optional] **IncludePast** | Pointer to **bool** | If set to True, also tasks from past DAG Runs are affected. | [optional] -**NewState** | Pointer to **string** | Expected new state. | [optional] +**IncludeUpstream** | Pointer to **bool** | If set to true, upstream tasks are also affected. | [optional] +**NewState** | Pointer to [**UpdateTaskState**](UpdateTaskState.md) | | [optional] +**TaskId** | Pointer to **string** | The task ID. | [optional] ## Methods @@ -52,55 +33,55 @@ NewUpdateTaskInstancesStateWithDefaults instantiates a new UpdateTaskInstancesSt This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetDryRun +### GetDagRunId -`func (o *UpdateTaskInstancesState) GetDryRun() bool` +`func (o *UpdateTaskInstancesState) GetDagRunId() string` -GetDryRun returns the DryRun field if non-nil, zero value otherwise. +GetDagRunId returns the DagRunId field if non-nil, zero value otherwise. -### GetDryRunOk +### GetDagRunIdOk -`func (o *UpdateTaskInstancesState) GetDryRunOk() (*bool, bool)` +`func (o *UpdateTaskInstancesState) GetDagRunIdOk() (*string, bool)` -GetDryRunOk returns a tuple with the DryRun field if it's non-nil, zero value otherwise +GetDagRunIdOk returns a tuple with the DagRunId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDryRun +### SetDagRunId -`func (o *UpdateTaskInstancesState) SetDryRun(v bool)` +`func (o *UpdateTaskInstancesState) SetDagRunId(v string)` -SetDryRun sets DryRun field to given value. +SetDagRunId sets DagRunId field to given value. -### HasDryRun +### HasDagRunId -`func (o *UpdateTaskInstancesState) HasDryRun() bool` +`func (o *UpdateTaskInstancesState) HasDagRunId() bool` -HasDryRun returns a boolean if a field has been set. +HasDagRunId returns a boolean if a field has been set. -### GetTaskId +### GetDryRun -`func (o *UpdateTaskInstancesState) GetTaskId() string` +`func (o *UpdateTaskInstancesState) GetDryRun() bool` -GetTaskId returns the TaskId field if non-nil, zero value otherwise. +GetDryRun returns the DryRun field if non-nil, zero value otherwise. -### GetTaskIdOk +### GetDryRunOk -`func (o *UpdateTaskInstancesState) GetTaskIdOk() (*string, bool)` +`func (o *UpdateTaskInstancesState) GetDryRunOk() (*bool, bool)` -GetTaskIdOk returns a tuple with the TaskId field if it's non-nil, zero value otherwise +GetDryRunOk returns a tuple with the DryRun field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTaskId +### SetDryRun -`func (o *UpdateTaskInstancesState) SetTaskId(v string)` +`func (o *UpdateTaskInstancesState) SetDryRun(v bool)` -SetTaskId sets TaskId field to given value. +SetDryRun sets DryRun field to given value. -### HasTaskId +### HasDryRun -`func (o *UpdateTaskInstancesState) HasTaskId() bool` +`func (o *UpdateTaskInstancesState) HasDryRun() bool` -HasTaskId returns a boolean if a field has been set. +HasDryRun returns a boolean if a field has been set. ### GetExecutionDate @@ -127,56 +108,6 @@ SetExecutionDate sets ExecutionDate field to given value. HasExecutionDate returns a boolean if a field has been set. -### GetDagRunId - -`func (o *UpdateTaskInstancesState) GetDagRunId() string` - -GetDagRunId returns the DagRunId field if non-nil, zero value otherwise. - -### GetDagRunIdOk - -`func (o *UpdateTaskInstancesState) GetDagRunIdOk() (*string, bool)` - -GetDagRunIdOk returns a tuple with the DagRunId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDagRunId - -`func (o *UpdateTaskInstancesState) SetDagRunId(v string)` - -SetDagRunId sets DagRunId field to given value. - -### HasDagRunId - -`func (o *UpdateTaskInstancesState) HasDagRunId() bool` - -HasDagRunId returns a boolean if a field has been set. - -### GetIncludeUpstream - -`func (o *UpdateTaskInstancesState) GetIncludeUpstream() bool` - -GetIncludeUpstream returns the IncludeUpstream field if non-nil, zero value otherwise. - -### GetIncludeUpstreamOk - -`func (o *UpdateTaskInstancesState) GetIncludeUpstreamOk() (*bool, bool)` - -GetIncludeUpstreamOk returns a tuple with the IncludeUpstream field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetIncludeUpstream - -`func (o *UpdateTaskInstancesState) SetIncludeUpstream(v bool)` - -SetIncludeUpstream sets IncludeUpstream field to given value. - -### HasIncludeUpstream - -`func (o *UpdateTaskInstancesState) HasIncludeUpstream() bool` - -HasIncludeUpstream returns a boolean if a field has been set. - ### GetIncludeDownstream `func (o *UpdateTaskInstancesState) GetIncludeDownstream() bool` @@ -252,22 +183,47 @@ SetIncludePast sets IncludePast field to given value. HasIncludePast returns a boolean if a field has been set. +### GetIncludeUpstream + +`func (o *UpdateTaskInstancesState) GetIncludeUpstream() bool` + +GetIncludeUpstream returns the IncludeUpstream field if non-nil, zero value otherwise. + +### GetIncludeUpstreamOk + +`func (o *UpdateTaskInstancesState) GetIncludeUpstreamOk() (*bool, bool)` + +GetIncludeUpstreamOk returns a tuple with the IncludeUpstream field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIncludeUpstream + +`func (o *UpdateTaskInstancesState) SetIncludeUpstream(v bool)` + +SetIncludeUpstream sets IncludeUpstream field to given value. + +### HasIncludeUpstream + +`func (o *UpdateTaskInstancesState) HasIncludeUpstream() bool` + +HasIncludeUpstream returns a boolean if a field has been set. + ### GetNewState -`func (o *UpdateTaskInstancesState) GetNewState() string` +`func (o *UpdateTaskInstancesState) GetNewState() UpdateTaskState` GetNewState returns the NewState field if non-nil, zero value otherwise. ### GetNewStateOk -`func (o *UpdateTaskInstancesState) GetNewStateOk() (*string, bool)` +`func (o *UpdateTaskInstancesState) GetNewStateOk() (*UpdateTaskState, bool)` GetNewStateOk returns a tuple with the NewState field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetNewState -`func (o *UpdateTaskInstancesState) SetNewState(v string)` +`func (o *UpdateTaskInstancesState) SetNewState(v UpdateTaskState)` SetNewState sets NewState field to given value. @@ -277,6 +233,31 @@ SetNewState sets NewState field to given value. HasNewState returns a boolean if a field has been set. +### GetTaskId + +`func (o *UpdateTaskInstancesState) GetTaskId() string` + +GetTaskId returns the TaskId field if non-nil, zero value otherwise. + +### GetTaskIdOk + +`func (o *UpdateTaskInstancesState) GetTaskIdOk() (*string, bool)` + +GetTaskIdOk returns a tuple with the TaskId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTaskId + +`func (o *UpdateTaskInstancesState) SetTaskId(v string)` + +SetTaskId sets TaskId field to given value. + +### HasTaskId + +`func (o *UpdateTaskInstancesState) HasTaskId() bool` + +HasTaskId returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/UpdateTaskState.md b/airflow/docs/UpdateTaskState.md new file mode 100644 index 0000000..4ce463f --- /dev/null +++ b/airflow/docs/UpdateTaskState.md @@ -0,0 +1,15 @@ +# UpdateTaskState + +## Enum + + +* `SUCCESS` (value: `"success"`) + +* `FAILED` (value: `"failed"`) + +* `SKIPPED` (value: `"skipped"`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/docs/User.md b/airflow/docs/User.md index 098df6f..28830cd 100644 --- a/airflow/docs/User.md +++ b/airflow/docs/User.md @@ -1,39 +1,20 @@ - - # User ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**FirstName** | Pointer to **string** | The user's first name. *Changed in version 2.4.0*&#58; The requirement for this to be non-empty was removed. | [optional] -**LastName** | Pointer to **string** | The user's last name. *Changed in version 2.4.0*&#58; The requirement for this to be non-empty was removed. | [optional] -**Username** | Pointer to **string** | The username. *Changed in version 2.2.0*&#58; A minimum character length requirement ('minLength') is added. | [optional] -**Email** | Pointer to **string** | The user's email. *Changed in version 2.2.0*&#58; A minimum character length requirement ('minLength') is added. | [optional] **Active** | Pointer to **NullableBool** | Whether the user is active | [optional] [readonly] +**ChangedOn** | Pointer to **NullableString** | The date user was changed | [optional] [readonly] +**CreatedOn** | Pointer to **NullableString** | The date user was created | [optional] [readonly] +**Email** | Pointer to **string** | The user's email. *Changed in version 2.2.0*&#58; A minimum character length requirement ('minLength') is added. | [optional] +**FailedLoginCount** | Pointer to **NullableInt32** | The number of times the login failed | [optional] [readonly] +**FirstName** | Pointer to **string** | The user's first name. *Changed in version 2.4.0*&#58; The requirement for this to be non-empty was removed. | [optional] **LastLogin** | Pointer to **NullableString** | The last user login | [optional] [readonly] +**LastName** | Pointer to **string** | The user's last name. *Changed in version 2.4.0*&#58; The requirement for this to be non-empty was removed. | [optional] **LoginCount** | Pointer to **NullableInt32** | The login count | [optional] [readonly] -**FailedLoginCount** | Pointer to **NullableInt32** | The number of times the login failed | [optional] [readonly] -**Roles** | Pointer to [**[]UserCollectionItemRoles**](UserCollectionItemRoles.md) | User roles. *Changed in version 2.2.0*&#58; Field is no longer read-only. | [optional] -**CreatedOn** | Pointer to **NullableString** | The date user was created | [optional] [readonly] -**ChangedOn** | Pointer to **NullableString** | The date user was changed | [optional] [readonly] +**Roles** | Pointer to [**[]UserCollectionItemRolesInner**](UserCollectionItemRolesInner.md) | User roles. *Changed in version 2.2.0*&#58; Field is no longer read-only. | [optional] +**Username** | Pointer to **string** | The username. *Changed in version 2.2.0*&#58; A minimum character length requirement ('minLength') is added. | [optional] **Password** | Pointer to **string** | | [optional] ## Methods @@ -55,81 +36,111 @@ NewUserWithDefaults instantiates a new User object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetFirstName +### GetActive -`func (o *User) GetFirstName() string` +`func (o *User) GetActive() bool` -GetFirstName returns the FirstName field if non-nil, zero value otherwise. +GetActive returns the Active field if non-nil, zero value otherwise. -### GetFirstNameOk +### GetActiveOk -`func (o *User) GetFirstNameOk() (*string, bool)` +`func (o *User) GetActiveOk() (*bool, bool)` -GetFirstNameOk returns a tuple with the FirstName field if it's non-nil, zero value otherwise +GetActiveOk returns a tuple with the Active field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetFirstName +### SetActive -`func (o *User) SetFirstName(v string)` +`func (o *User) SetActive(v bool)` -SetFirstName sets FirstName field to given value. +SetActive sets Active field to given value. -### HasFirstName +### HasActive -`func (o *User) HasFirstName() bool` +`func (o *User) HasActive() bool` -HasFirstName returns a boolean if a field has been set. +HasActive returns a boolean if a field has been set. -### GetLastName +### SetActiveNil -`func (o *User) GetLastName() string` +`func (o *User) SetActiveNil(b bool)` -GetLastName returns the LastName field if non-nil, zero value otherwise. + SetActiveNil sets the value for Active to be an explicit nil -### GetLastNameOk +### UnsetActive +`func (o *User) UnsetActive()` -`func (o *User) GetLastNameOk() (*string, bool)` +UnsetActive ensures that no value is present for Active, not even an explicit nil +### GetChangedOn -GetLastNameOk returns a tuple with the LastName field if it's non-nil, zero value otherwise +`func (o *User) GetChangedOn() string` + +GetChangedOn returns the ChangedOn field if non-nil, zero value otherwise. + +### GetChangedOnOk + +`func (o *User) GetChangedOnOk() (*string, bool)` + +GetChangedOnOk returns a tuple with the ChangedOn field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetLastName +### SetChangedOn -`func (o *User) SetLastName(v string)` +`func (o *User) SetChangedOn(v string)` -SetLastName sets LastName field to given value. +SetChangedOn sets ChangedOn field to given value. -### HasLastName +### HasChangedOn -`func (o *User) HasLastName() bool` +`func (o *User) HasChangedOn() bool` -HasLastName returns a boolean if a field has been set. +HasChangedOn returns a boolean if a field has been set. -### GetUsername +### SetChangedOnNil -`func (o *User) GetUsername() string` +`func (o *User) SetChangedOnNil(b bool)` -GetUsername returns the Username field if non-nil, zero value otherwise. + SetChangedOnNil sets the value for ChangedOn to be an explicit nil -### GetUsernameOk +### UnsetChangedOn +`func (o *User) UnsetChangedOn()` -`func (o *User) GetUsernameOk() (*string, bool)` +UnsetChangedOn ensures that no value is present for ChangedOn, not even an explicit nil +### GetCreatedOn -GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +`func (o *User) GetCreatedOn() string` + +GetCreatedOn returns the CreatedOn field if non-nil, zero value otherwise. + +### GetCreatedOnOk + +`func (o *User) GetCreatedOnOk() (*string, bool)` + +GetCreatedOnOk returns a tuple with the CreatedOn field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetUsername +### SetCreatedOn -`func (o *User) SetUsername(v string)` +`func (o *User) SetCreatedOn(v string)` -SetUsername sets Username field to given value. +SetCreatedOn sets CreatedOn field to given value. -### HasUsername +### HasCreatedOn -`func (o *User) HasUsername() bool` +`func (o *User) HasCreatedOn() bool` -HasUsername returns a boolean if a field has been set. +HasCreatedOn returns a boolean if a field has been set. + +### SetCreatedOnNil + +`func (o *User) SetCreatedOnNil(b bool)` + + SetCreatedOnNil sets the value for CreatedOn to be an explicit nil + +### UnsetCreatedOn +`func (o *User) UnsetCreatedOn()` +UnsetCreatedOn ensures that no value is present for CreatedOn, not even an explicit nil ### GetEmail `func (o *User) GetEmail() string` @@ -155,41 +166,66 @@ SetEmail sets Email field to given value. HasEmail returns a boolean if a field has been set. -### GetActive +### GetFailedLoginCount -`func (o *User) GetActive() bool` +`func (o *User) GetFailedLoginCount() int32` -GetActive returns the Active field if non-nil, zero value otherwise. +GetFailedLoginCount returns the FailedLoginCount field if non-nil, zero value otherwise. -### GetActiveOk +### GetFailedLoginCountOk -`func (o *User) GetActiveOk() (*bool, bool)` +`func (o *User) GetFailedLoginCountOk() (*int32, bool)` -GetActiveOk returns a tuple with the Active field if it's non-nil, zero value otherwise +GetFailedLoginCountOk returns a tuple with the FailedLoginCount field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetActive +### SetFailedLoginCount -`func (o *User) SetActive(v bool)` +`func (o *User) SetFailedLoginCount(v int32)` -SetActive sets Active field to given value. +SetFailedLoginCount sets FailedLoginCount field to given value. -### HasActive +### HasFailedLoginCount -`func (o *User) HasActive() bool` +`func (o *User) HasFailedLoginCount() bool` -HasActive returns a boolean if a field has been set. +HasFailedLoginCount returns a boolean if a field has been set. -### SetActiveNil +### SetFailedLoginCountNil -`func (o *User) SetActiveNil(b bool)` +`func (o *User) SetFailedLoginCountNil(b bool)` - SetActiveNil sets the value for Active to be an explicit nil + SetFailedLoginCountNil sets the value for FailedLoginCount to be an explicit nil -### UnsetActive -`func (o *User) UnsetActive()` +### UnsetFailedLoginCount +`func (o *User) UnsetFailedLoginCount()` + +UnsetFailedLoginCount ensures that no value is present for FailedLoginCount, not even an explicit nil +### GetFirstName + +`func (o *User) GetFirstName() string` + +GetFirstName returns the FirstName field if non-nil, zero value otherwise. + +### GetFirstNameOk + +`func (o *User) GetFirstNameOk() (*string, bool)` + +GetFirstNameOk returns a tuple with the FirstName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirstName + +`func (o *User) SetFirstName(v string)` + +SetFirstName sets FirstName field to given value. + +### HasFirstName + +`func (o *User) HasFirstName() bool` + +HasFirstName returns a boolean if a field has been set. -UnsetActive ensures that no value is present for Active, not even an explicit nil ### GetLastLogin `func (o *User) GetLastLogin() string` @@ -225,6 +261,31 @@ HasLastLogin returns a boolean if a field has been set. `func (o *User) UnsetLastLogin()` UnsetLastLogin ensures that no value is present for LastLogin, not even an explicit nil +### GetLastName + +`func (o *User) GetLastName() string` + +GetLastName returns the LastName field if non-nil, zero value otherwise. + +### GetLastNameOk + +`func (o *User) GetLastNameOk() (*string, bool)` + +GetLastNameOk returns a tuple with the LastName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastName + +`func (o *User) SetLastName(v string)` + +SetLastName sets LastName field to given value. + +### HasLastName + +`func (o *User) HasLastName() bool` + +HasLastName returns a boolean if a field has been set. + ### GetLoginCount `func (o *User) GetLoginCount() int32` @@ -260,57 +321,22 @@ HasLoginCount returns a boolean if a field has been set. `func (o *User) UnsetLoginCount()` UnsetLoginCount ensures that no value is present for LoginCount, not even an explicit nil -### GetFailedLoginCount - -`func (o *User) GetFailedLoginCount() int32` - -GetFailedLoginCount returns the FailedLoginCount field if non-nil, zero value otherwise. - -### GetFailedLoginCountOk - -`func (o *User) GetFailedLoginCountOk() (*int32, bool)` - -GetFailedLoginCountOk returns a tuple with the FailedLoginCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFailedLoginCount - -`func (o *User) SetFailedLoginCount(v int32)` - -SetFailedLoginCount sets FailedLoginCount field to given value. - -### HasFailedLoginCount - -`func (o *User) HasFailedLoginCount() bool` - -HasFailedLoginCount returns a boolean if a field has been set. - -### SetFailedLoginCountNil - -`func (o *User) SetFailedLoginCountNil(b bool)` - - SetFailedLoginCountNil sets the value for FailedLoginCount to be an explicit nil - -### UnsetFailedLoginCount -`func (o *User) UnsetFailedLoginCount()` - -UnsetFailedLoginCount ensures that no value is present for FailedLoginCount, not even an explicit nil ### GetRoles -`func (o *User) GetRoles() []UserCollectionItemRoles` +`func (o *User) GetRoles() []UserCollectionItemRolesInner` GetRoles returns the Roles field if non-nil, zero value otherwise. ### GetRolesOk -`func (o *User) GetRolesOk() (*[]UserCollectionItemRoles, bool)` +`func (o *User) GetRolesOk() (*[]UserCollectionItemRolesInner, bool)` GetRolesOk returns a tuple with the Roles field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetRoles -`func (o *User) SetRoles(v []UserCollectionItemRoles)` +`func (o *User) SetRoles(v []UserCollectionItemRolesInner)` SetRoles sets Roles field to given value. @@ -320,76 +346,31 @@ SetRoles sets Roles field to given value. HasRoles returns a boolean if a field has been set. -### GetCreatedOn - -`func (o *User) GetCreatedOn() string` - -GetCreatedOn returns the CreatedOn field if non-nil, zero value otherwise. - -### GetCreatedOnOk - -`func (o *User) GetCreatedOnOk() (*string, bool)` - -GetCreatedOnOk returns a tuple with the CreatedOn field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedOn - -`func (o *User) SetCreatedOn(v string)` - -SetCreatedOn sets CreatedOn field to given value. - -### HasCreatedOn - -`func (o *User) HasCreatedOn() bool` - -HasCreatedOn returns a boolean if a field has been set. - -### SetCreatedOnNil - -`func (o *User) SetCreatedOnNil(b bool)` - - SetCreatedOnNil sets the value for CreatedOn to be an explicit nil - -### UnsetCreatedOn -`func (o *User) UnsetCreatedOn()` - -UnsetCreatedOn ensures that no value is present for CreatedOn, not even an explicit nil -### GetChangedOn +### GetUsername -`func (o *User) GetChangedOn() string` +`func (o *User) GetUsername() string` -GetChangedOn returns the ChangedOn field if non-nil, zero value otherwise. +GetUsername returns the Username field if non-nil, zero value otherwise. -### GetChangedOnOk +### GetUsernameOk -`func (o *User) GetChangedOnOk() (*string, bool)` +`func (o *User) GetUsernameOk() (*string, bool)` -GetChangedOnOk returns a tuple with the ChangedOn field if it's non-nil, zero value otherwise +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetChangedOn - -`func (o *User) SetChangedOn(v string)` - -SetChangedOn sets ChangedOn field to given value. - -### HasChangedOn - -`func (o *User) HasChangedOn() bool` +### SetUsername -HasChangedOn returns a boolean if a field has been set. +`func (o *User) SetUsername(v string)` -### SetChangedOnNil +SetUsername sets Username field to given value. -`func (o *User) SetChangedOnNil(b bool)` +### HasUsername - SetChangedOnNil sets the value for ChangedOn to be an explicit nil +`func (o *User) HasUsername() bool` -### UnsetChangedOn -`func (o *User) UnsetChangedOn()` +HasUsername returns a boolean if a field has been set. -UnsetChangedOn ensures that no value is present for ChangedOn, not even an explicit nil ### GetPassword `func (o *User) GetPassword() string` diff --git a/airflow/docs/UserApi.md b/airflow/docs/UserApi.md index 21da8fb..a5a6389 100644 --- a/airflow/docs/UserApi.md +++ b/airflow/docs/UserApi.md @@ -1,33 +1,14 @@ - - -# \UserApi - -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**DeleteUser**](UserApi.md#DeleteUser) | **Delete** /users/{username} | Delete a user -[**GetUser**](UserApi.md#GetUser) | **Get** /users/{username} | Get a user -[**GetUsers**](UserApi.md#GetUsers) | **Get** /users | List users -[**PatchUser**](UserApi.md#PatchUser) | **Patch** /users/{username} | Update a user -[**PostUser**](UserApi.md#PostUser) | **Post** /users | Create a user +[**DeleteUser**](UserAPI.md#DeleteUser) | **Delete** /users/{username} | Delete a user +[**GetUser**](UserAPI.md#GetUser) | **Get** /users/{username} | Get a user +[**GetUsers**](UserAPI.md#GetUsers) | **Get** /users | List users +[**PatchUser**](UserAPI.md#PatchUser) | **Patch** /users/{username} | Update a user +[**PostUser**](UserAPI.md#PostUser) | **Post** /users | Create a user @@ -45,22 +26,22 @@ Delete a user package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - username := "username_example" // string | The username of the user. *New in version 2.1.0* - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.DeleteUser(context.Background(), username).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserApi.DeleteUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + username := "username_example" // string | The username of the user. *New in version 2.1.0* + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.UserAPI.DeleteUser(context.Background(), username).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.DeleteUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -87,7 +68,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -113,24 +94,24 @@ Get a user package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - username := "username_example" // string | The username of the user. *New in version 2.1.0* - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.GetUser(context.Background(), username).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserApi.GetUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetUser`: UserCollectionItem - fmt.Fprintf(os.Stdout, "Response from `UserApi.GetUser`: %v\n", resp) + username := "username_example" // string | The username of the user. *New in version 2.1.0* + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserAPI.GetUser(context.Background(), username).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.GetUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetUser`: UserCollectionItem + fmt.Fprintf(os.Stdout, "Response from `UserAPI.GetUser`: %v\n", resp) } ``` @@ -157,7 +138,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -183,26 +164,26 @@ List users package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) - offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) - orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.GetUsers(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserApi.GetUsers``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetUsers`: UserCollection - fmt.Fprintf(os.Stdout, "Response from `UserApi.GetUsers`: %v\n", resp) + limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) + offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) + orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserAPI.GetUsers(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.GetUsers``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetUsers`: UserCollection + fmt.Fprintf(os.Stdout, "Response from `UserAPI.GetUsers`: %v\n", resp) } ``` @@ -227,7 +208,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -241,7 +222,7 @@ Name | Type | Description | Notes ## PatchUser -> Role PatchUser(ctx, username).User(user).UpdateMask(updateMask).Execute() +> UserCollectionItem PatchUser(ctx, username).User(user).UpdateMask(updateMask).Execute() Update a user @@ -253,26 +234,26 @@ Update a user package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - username := "username_example" // string | The username of the user. *New in version 2.1.0* - user := *openapiclient.NewUser() // User | - updateMask := []string{"Inner_example"} // []string | The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.PatchUser(context.Background(), username).User(user).UpdateMask(updateMask).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserApi.PatchUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PatchUser`: Role - fmt.Fprintf(os.Stdout, "Response from `UserApi.PatchUser`: %v\n", resp) + username := "username_example" // string | The username of the user. *New in version 2.1.0* + user := *openapiclient.NewUser() // User | + updateMask := []string{"Inner_example"} // []string | The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserAPI.PatchUser(context.Background(), username).User(user).UpdateMask(updateMask).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.PatchUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PatchUser`: UserCollectionItem + fmt.Fprintf(os.Stdout, "Response from `UserAPI.PatchUser`: %v\n", resp) } ``` @@ -297,11 +278,11 @@ Name | Type | Description | Notes ### Return type -[**Role**](Role.md) +[**UserCollectionItem**](UserCollectionItem.md) ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -327,24 +308,24 @@ Create a user package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - user := *openapiclient.NewUser() // User | - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.UserApi.PostUser(context.Background()).User(user).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserApi.PostUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PostUser`: User - fmt.Fprintf(os.Stdout, "Response from `UserApi.PostUser`: %v\n", resp) + user := *openapiclient.NewUser() // User | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserAPI.PostUser(context.Background()).User(user).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.PostUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PostUser`: User + fmt.Fprintf(os.Stdout, "Response from `UserAPI.PostUser`: %v\n", resp) } ``` @@ -367,7 +348,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers diff --git a/airflow/docs/UserCollection.md b/airflow/docs/UserCollection.md index bc04411..bb868e3 100644 --- a/airflow/docs/UserCollection.md +++ b/airflow/docs/UserCollection.md @@ -1,30 +1,11 @@ - - # UserCollection ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] **Users** | Pointer to [**[]UserCollectionItem**](UserCollectionItem.md) | | [optional] -**TotalEntries** | Pointer to **int32** | Count of objects in the current result set. | [optional] ## Methods @@ -45,55 +26,55 @@ NewUserCollectionWithDefaults instantiates a new UserCollection object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetUsers +### GetTotalEntries -`func (o *UserCollection) GetUsers() []UserCollectionItem` +`func (o *UserCollection) GetTotalEntries() int32` -GetUsers returns the Users field if non-nil, zero value otherwise. +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. -### GetUsersOk +### GetTotalEntriesOk -`func (o *UserCollection) GetUsersOk() (*[]UserCollectionItem, bool)` +`func (o *UserCollection) GetTotalEntriesOk() (*int32, bool)` -GetUsersOk returns a tuple with the Users field if it's non-nil, zero value otherwise +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetUsers +### SetTotalEntries -`func (o *UserCollection) SetUsers(v []UserCollectionItem)` +`func (o *UserCollection) SetTotalEntries(v int32)` -SetUsers sets Users field to given value. +SetTotalEntries sets TotalEntries field to given value. -### HasUsers +### HasTotalEntries -`func (o *UserCollection) HasUsers() bool` +`func (o *UserCollection) HasTotalEntries() bool` -HasUsers returns a boolean if a field has been set. +HasTotalEntries returns a boolean if a field has been set. -### GetTotalEntries +### GetUsers -`func (o *UserCollection) GetTotalEntries() int32` +`func (o *UserCollection) GetUsers() []UserCollectionItem` -GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. +GetUsers returns the Users field if non-nil, zero value otherwise. -### GetTotalEntriesOk +### GetUsersOk -`func (o *UserCollection) GetTotalEntriesOk() (*int32, bool)` +`func (o *UserCollection) GetUsersOk() (*[]UserCollectionItem, bool)` -GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +GetUsersOk returns a tuple with the Users field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTotalEntries +### SetUsers -`func (o *UserCollection) SetTotalEntries(v int32)` +`func (o *UserCollection) SetUsers(v []UserCollectionItem)` -SetTotalEntries sets TotalEntries field to given value. +SetUsers sets Users field to given value. -### HasTotalEntries +### HasUsers -`func (o *UserCollection) HasTotalEntries() bool` +`func (o *UserCollection) HasUsers() bool` -HasTotalEntries returns a boolean if a field has been set. +HasUsers returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/UserCollectionItem.md b/airflow/docs/UserCollectionItem.md index caca4c1..23c2064 100644 --- a/airflow/docs/UserCollectionItem.md +++ b/airflow/docs/UserCollectionItem.md @@ -1,39 +1,20 @@ - - # UserCollectionItem ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**FirstName** | Pointer to **string** | The user's first name. *Changed in version 2.4.0*&#58; The requirement for this to be non-empty was removed. | [optional] -**LastName** | Pointer to **string** | The user's last name. *Changed in version 2.4.0*&#58; The requirement for this to be non-empty was removed. | [optional] -**Username** | Pointer to **string** | The username. *Changed in version 2.2.0*&#58; A minimum character length requirement ('minLength') is added. | [optional] -**Email** | Pointer to **string** | The user's email. *Changed in version 2.2.0*&#58; A minimum character length requirement ('minLength') is added. | [optional] **Active** | Pointer to **NullableBool** | Whether the user is active | [optional] [readonly] +**ChangedOn** | Pointer to **NullableString** | The date user was changed | [optional] [readonly] +**CreatedOn** | Pointer to **NullableString** | The date user was created | [optional] [readonly] +**Email** | Pointer to **string** | The user's email. *Changed in version 2.2.0*&#58; A minimum character length requirement ('minLength') is added. | [optional] +**FailedLoginCount** | Pointer to **NullableInt32** | The number of times the login failed | [optional] [readonly] +**FirstName** | Pointer to **string** | The user's first name. *Changed in version 2.4.0*&#58; The requirement for this to be non-empty was removed. | [optional] **LastLogin** | Pointer to **NullableString** | The last user login | [optional] [readonly] +**LastName** | Pointer to **string** | The user's last name. *Changed in version 2.4.0*&#58; The requirement for this to be non-empty was removed. | [optional] **LoginCount** | Pointer to **NullableInt32** | The login count | [optional] [readonly] -**FailedLoginCount** | Pointer to **NullableInt32** | The number of times the login failed | [optional] [readonly] -**Roles** | Pointer to [**[]UserCollectionItemRoles**](UserCollectionItemRoles.md) | User roles. *Changed in version 2.2.0*&#58; Field is no longer read-only. | [optional] -**CreatedOn** | Pointer to **NullableString** | The date user was created | [optional] [readonly] -**ChangedOn** | Pointer to **NullableString** | The date user was changed | [optional] [readonly] +**Roles** | Pointer to [**[]UserCollectionItemRolesInner**](UserCollectionItemRolesInner.md) | User roles. *Changed in version 2.2.0*&#58; Field is no longer read-only. | [optional] +**Username** | Pointer to **string** | The username. *Changed in version 2.2.0*&#58; A minimum character length requirement ('minLength') is added. | [optional] ## Methods @@ -54,81 +35,111 @@ NewUserCollectionItemWithDefaults instantiates a new UserCollectionItem object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetFirstName +### GetActive -`func (o *UserCollectionItem) GetFirstName() string` +`func (o *UserCollectionItem) GetActive() bool` -GetFirstName returns the FirstName field if non-nil, zero value otherwise. +GetActive returns the Active field if non-nil, zero value otherwise. -### GetFirstNameOk +### GetActiveOk -`func (o *UserCollectionItem) GetFirstNameOk() (*string, bool)` +`func (o *UserCollectionItem) GetActiveOk() (*bool, bool)` -GetFirstNameOk returns a tuple with the FirstName field if it's non-nil, zero value otherwise +GetActiveOk returns a tuple with the Active field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetFirstName +### SetActive -`func (o *UserCollectionItem) SetFirstName(v string)` +`func (o *UserCollectionItem) SetActive(v bool)` -SetFirstName sets FirstName field to given value. +SetActive sets Active field to given value. -### HasFirstName +### HasActive -`func (o *UserCollectionItem) HasFirstName() bool` +`func (o *UserCollectionItem) HasActive() bool` -HasFirstName returns a boolean if a field has been set. +HasActive returns a boolean if a field has been set. -### GetLastName +### SetActiveNil -`func (o *UserCollectionItem) GetLastName() string` +`func (o *UserCollectionItem) SetActiveNil(b bool)` -GetLastName returns the LastName field if non-nil, zero value otherwise. + SetActiveNil sets the value for Active to be an explicit nil -### GetLastNameOk +### UnsetActive +`func (o *UserCollectionItem) UnsetActive()` -`func (o *UserCollectionItem) GetLastNameOk() (*string, bool)` +UnsetActive ensures that no value is present for Active, not even an explicit nil +### GetChangedOn -GetLastNameOk returns a tuple with the LastName field if it's non-nil, zero value otherwise +`func (o *UserCollectionItem) GetChangedOn() string` + +GetChangedOn returns the ChangedOn field if non-nil, zero value otherwise. + +### GetChangedOnOk + +`func (o *UserCollectionItem) GetChangedOnOk() (*string, bool)` + +GetChangedOnOk returns a tuple with the ChangedOn field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetLastName +### SetChangedOn -`func (o *UserCollectionItem) SetLastName(v string)` +`func (o *UserCollectionItem) SetChangedOn(v string)` -SetLastName sets LastName field to given value. +SetChangedOn sets ChangedOn field to given value. -### HasLastName +### HasChangedOn -`func (o *UserCollectionItem) HasLastName() bool` +`func (o *UserCollectionItem) HasChangedOn() bool` -HasLastName returns a boolean if a field has been set. +HasChangedOn returns a boolean if a field has been set. -### GetUsername +### SetChangedOnNil -`func (o *UserCollectionItem) GetUsername() string` +`func (o *UserCollectionItem) SetChangedOnNil(b bool)` -GetUsername returns the Username field if non-nil, zero value otherwise. + SetChangedOnNil sets the value for ChangedOn to be an explicit nil -### GetUsernameOk +### UnsetChangedOn +`func (o *UserCollectionItem) UnsetChangedOn()` -`func (o *UserCollectionItem) GetUsernameOk() (*string, bool)` +UnsetChangedOn ensures that no value is present for ChangedOn, not even an explicit nil +### GetCreatedOn -GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +`func (o *UserCollectionItem) GetCreatedOn() string` + +GetCreatedOn returns the CreatedOn field if non-nil, zero value otherwise. + +### GetCreatedOnOk + +`func (o *UserCollectionItem) GetCreatedOnOk() (*string, bool)` + +GetCreatedOnOk returns a tuple with the CreatedOn field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetUsername +### SetCreatedOn -`func (o *UserCollectionItem) SetUsername(v string)` +`func (o *UserCollectionItem) SetCreatedOn(v string)` -SetUsername sets Username field to given value. +SetCreatedOn sets CreatedOn field to given value. -### HasUsername +### HasCreatedOn -`func (o *UserCollectionItem) HasUsername() bool` +`func (o *UserCollectionItem) HasCreatedOn() bool` -HasUsername returns a boolean if a field has been set. +HasCreatedOn returns a boolean if a field has been set. + +### SetCreatedOnNil + +`func (o *UserCollectionItem) SetCreatedOnNil(b bool)` + + SetCreatedOnNil sets the value for CreatedOn to be an explicit nil + +### UnsetCreatedOn +`func (o *UserCollectionItem) UnsetCreatedOn()` +UnsetCreatedOn ensures that no value is present for CreatedOn, not even an explicit nil ### GetEmail `func (o *UserCollectionItem) GetEmail() string` @@ -154,41 +165,66 @@ SetEmail sets Email field to given value. HasEmail returns a boolean if a field has been set. -### GetActive +### GetFailedLoginCount -`func (o *UserCollectionItem) GetActive() bool` +`func (o *UserCollectionItem) GetFailedLoginCount() int32` -GetActive returns the Active field if non-nil, zero value otherwise. +GetFailedLoginCount returns the FailedLoginCount field if non-nil, zero value otherwise. -### GetActiveOk +### GetFailedLoginCountOk -`func (o *UserCollectionItem) GetActiveOk() (*bool, bool)` +`func (o *UserCollectionItem) GetFailedLoginCountOk() (*int32, bool)` -GetActiveOk returns a tuple with the Active field if it's non-nil, zero value otherwise +GetFailedLoginCountOk returns a tuple with the FailedLoginCount field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetActive +### SetFailedLoginCount -`func (o *UserCollectionItem) SetActive(v bool)` +`func (o *UserCollectionItem) SetFailedLoginCount(v int32)` -SetActive sets Active field to given value. +SetFailedLoginCount sets FailedLoginCount field to given value. -### HasActive +### HasFailedLoginCount -`func (o *UserCollectionItem) HasActive() bool` +`func (o *UserCollectionItem) HasFailedLoginCount() bool` -HasActive returns a boolean if a field has been set. +HasFailedLoginCount returns a boolean if a field has been set. -### SetActiveNil +### SetFailedLoginCountNil -`func (o *UserCollectionItem) SetActiveNil(b bool)` +`func (o *UserCollectionItem) SetFailedLoginCountNil(b bool)` - SetActiveNil sets the value for Active to be an explicit nil + SetFailedLoginCountNil sets the value for FailedLoginCount to be an explicit nil -### UnsetActive -`func (o *UserCollectionItem) UnsetActive()` +### UnsetFailedLoginCount +`func (o *UserCollectionItem) UnsetFailedLoginCount()` + +UnsetFailedLoginCount ensures that no value is present for FailedLoginCount, not even an explicit nil +### GetFirstName + +`func (o *UserCollectionItem) GetFirstName() string` + +GetFirstName returns the FirstName field if non-nil, zero value otherwise. + +### GetFirstNameOk + +`func (o *UserCollectionItem) GetFirstNameOk() (*string, bool)` + +GetFirstNameOk returns a tuple with the FirstName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirstName + +`func (o *UserCollectionItem) SetFirstName(v string)` + +SetFirstName sets FirstName field to given value. + +### HasFirstName + +`func (o *UserCollectionItem) HasFirstName() bool` + +HasFirstName returns a boolean if a field has been set. -UnsetActive ensures that no value is present for Active, not even an explicit nil ### GetLastLogin `func (o *UserCollectionItem) GetLastLogin() string` @@ -224,6 +260,31 @@ HasLastLogin returns a boolean if a field has been set. `func (o *UserCollectionItem) UnsetLastLogin()` UnsetLastLogin ensures that no value is present for LastLogin, not even an explicit nil +### GetLastName + +`func (o *UserCollectionItem) GetLastName() string` + +GetLastName returns the LastName field if non-nil, zero value otherwise. + +### GetLastNameOk + +`func (o *UserCollectionItem) GetLastNameOk() (*string, bool)` + +GetLastNameOk returns a tuple with the LastName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastName + +`func (o *UserCollectionItem) SetLastName(v string)` + +SetLastName sets LastName field to given value. + +### HasLastName + +`func (o *UserCollectionItem) HasLastName() bool` + +HasLastName returns a boolean if a field has been set. + ### GetLoginCount `func (o *UserCollectionItem) GetLoginCount() int32` @@ -259,57 +320,22 @@ HasLoginCount returns a boolean if a field has been set. `func (o *UserCollectionItem) UnsetLoginCount()` UnsetLoginCount ensures that no value is present for LoginCount, not even an explicit nil -### GetFailedLoginCount - -`func (o *UserCollectionItem) GetFailedLoginCount() int32` - -GetFailedLoginCount returns the FailedLoginCount field if non-nil, zero value otherwise. - -### GetFailedLoginCountOk - -`func (o *UserCollectionItem) GetFailedLoginCountOk() (*int32, bool)` - -GetFailedLoginCountOk returns a tuple with the FailedLoginCount field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetFailedLoginCount - -`func (o *UserCollectionItem) SetFailedLoginCount(v int32)` - -SetFailedLoginCount sets FailedLoginCount field to given value. - -### HasFailedLoginCount - -`func (o *UserCollectionItem) HasFailedLoginCount() bool` - -HasFailedLoginCount returns a boolean if a field has been set. - -### SetFailedLoginCountNil - -`func (o *UserCollectionItem) SetFailedLoginCountNil(b bool)` - - SetFailedLoginCountNil sets the value for FailedLoginCount to be an explicit nil - -### UnsetFailedLoginCount -`func (o *UserCollectionItem) UnsetFailedLoginCount()` - -UnsetFailedLoginCount ensures that no value is present for FailedLoginCount, not even an explicit nil ### GetRoles -`func (o *UserCollectionItem) GetRoles() []UserCollectionItemRoles` +`func (o *UserCollectionItem) GetRoles() []UserCollectionItemRolesInner` GetRoles returns the Roles field if non-nil, zero value otherwise. ### GetRolesOk -`func (o *UserCollectionItem) GetRolesOk() (*[]UserCollectionItemRoles, bool)` +`func (o *UserCollectionItem) GetRolesOk() (*[]UserCollectionItemRolesInner, bool)` GetRolesOk returns a tuple with the Roles field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetRoles -`func (o *UserCollectionItem) SetRoles(v []UserCollectionItemRoles)` +`func (o *UserCollectionItem) SetRoles(v []UserCollectionItemRolesInner)` SetRoles sets Roles field to given value. @@ -319,76 +345,31 @@ SetRoles sets Roles field to given value. HasRoles returns a boolean if a field has been set. -### GetCreatedOn - -`func (o *UserCollectionItem) GetCreatedOn() string` - -GetCreatedOn returns the CreatedOn field if non-nil, zero value otherwise. - -### GetCreatedOnOk - -`func (o *UserCollectionItem) GetCreatedOnOk() (*string, bool)` - -GetCreatedOnOk returns a tuple with the CreatedOn field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCreatedOn - -`func (o *UserCollectionItem) SetCreatedOn(v string)` - -SetCreatedOn sets CreatedOn field to given value. - -### HasCreatedOn - -`func (o *UserCollectionItem) HasCreatedOn() bool` - -HasCreatedOn returns a boolean if a field has been set. - -### SetCreatedOnNil - -`func (o *UserCollectionItem) SetCreatedOnNil(b bool)` - - SetCreatedOnNil sets the value for CreatedOn to be an explicit nil - -### UnsetCreatedOn -`func (o *UserCollectionItem) UnsetCreatedOn()` - -UnsetCreatedOn ensures that no value is present for CreatedOn, not even an explicit nil -### GetChangedOn +### GetUsername -`func (o *UserCollectionItem) GetChangedOn() string` +`func (o *UserCollectionItem) GetUsername() string` -GetChangedOn returns the ChangedOn field if non-nil, zero value otherwise. +GetUsername returns the Username field if non-nil, zero value otherwise. -### GetChangedOnOk +### GetUsernameOk -`func (o *UserCollectionItem) GetChangedOnOk() (*string, bool)` +`func (o *UserCollectionItem) GetUsernameOk() (*string, bool)` -GetChangedOnOk returns a tuple with the ChangedOn field if it's non-nil, zero value otherwise +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetChangedOn - -`func (o *UserCollectionItem) SetChangedOn(v string)` - -SetChangedOn sets ChangedOn field to given value. - -### HasChangedOn - -`func (o *UserCollectionItem) HasChangedOn() bool` +### SetUsername -HasChangedOn returns a boolean if a field has been set. +`func (o *UserCollectionItem) SetUsername(v string)` -### SetChangedOnNil +SetUsername sets Username field to given value. -`func (o *UserCollectionItem) SetChangedOnNil(b bool)` +### HasUsername - SetChangedOnNil sets the value for ChangedOn to be an explicit nil +`func (o *UserCollectionItem) HasUsername() bool` -### UnsetChangedOn -`func (o *UserCollectionItem) UnsetChangedOn()` +HasUsername returns a boolean if a field has been set. -UnsetChangedOn ensures that no value is present for ChangedOn, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/UserCollectionItemRolesInner.md b/airflow/docs/UserCollectionItemRolesInner.md new file mode 100644 index 0000000..96c9ebd --- /dev/null +++ b/airflow/docs/UserCollectionItemRolesInner.md @@ -0,0 +1,56 @@ +# UserCollectionItemRolesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewUserCollectionItemRolesInner + +`func NewUserCollectionItemRolesInner() *UserCollectionItemRolesInner` + +NewUserCollectionItemRolesInner instantiates a new UserCollectionItemRolesInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserCollectionItemRolesInnerWithDefaults + +`func NewUserCollectionItemRolesInnerWithDefaults() *UserCollectionItemRolesInner` + +NewUserCollectionItemRolesInnerWithDefaults instantiates a new UserCollectionItemRolesInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *UserCollectionItemRolesInner) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *UserCollectionItemRolesInner) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *UserCollectionItemRolesInner) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *UserCollectionItemRolesInner) HasName() bool` + +HasName returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/docs/Variable.md b/airflow/docs/Variable.md index 17228e3..86d077d 100644 --- a/airflow/docs/Variable.md +++ b/airflow/docs/Variable.md @@ -1,30 +1,11 @@ - - # Variable ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Key** | Pointer to **string** | | [optional] **Description** | Pointer to **NullableString** | The description of the variable. *New in version 2.4.0* | [optional] +**Key** | Pointer to **string** | | [optional] **Value** | Pointer to **string** | | [optional] ## Methods @@ -46,31 +27,6 @@ NewVariableWithDefaults instantiates a new Variable object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetKey - -`func (o *Variable) GetKey() string` - -GetKey returns the Key field if non-nil, zero value otherwise. - -### GetKeyOk - -`func (o *Variable) GetKeyOk() (*string, bool)` - -GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetKey - -`func (o *Variable) SetKey(v string)` - -SetKey sets Key field to given value. - -### HasKey - -`func (o *Variable) HasKey() bool` - -HasKey returns a boolean if a field has been set. - ### GetDescription `func (o *Variable) GetDescription() string` @@ -106,6 +62,31 @@ HasDescription returns a boolean if a field has been set. `func (o *Variable) UnsetDescription()` UnsetDescription ensures that no value is present for Description, not even an explicit nil +### GetKey + +`func (o *Variable) GetKey() string` + +GetKey returns the Key field if non-nil, zero value otherwise. + +### GetKeyOk + +`func (o *Variable) GetKeyOk() (*string, bool)` + +GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKey + +`func (o *Variable) SetKey(v string)` + +SetKey sets Key field to given value. + +### HasKey + +`func (o *Variable) HasKey() bool` + +HasKey returns a boolean if a field has been set. + ### GetValue `func (o *Variable) GetValue() string` diff --git a/airflow/docs/VariableApi.md b/airflow/docs/VariableApi.md index 50611cd..8b06a11 100644 --- a/airflow/docs/VariableApi.md +++ b/airflow/docs/VariableApi.md @@ -1,33 +1,14 @@ - - -# \VariableApi - -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**DeleteVariable**](VariableApi.md#DeleteVariable) | **Delete** /variables/{variable_key} | Delete a variable -[**GetVariable**](VariableApi.md#GetVariable) | **Get** /variables/{variable_key} | Get a variable -[**GetVariables**](VariableApi.md#GetVariables) | **Get** /variables | List variables -[**PatchVariable**](VariableApi.md#PatchVariable) | **Patch** /variables/{variable_key} | Update a variable -[**PostVariables**](VariableApi.md#PostVariables) | **Post** /variables | Create a variable +[**DeleteVariable**](VariableAPI.md#DeleteVariable) | **Delete** /variables/{variable_key} | Delete a variable +[**GetVariable**](VariableAPI.md#GetVariable) | **Get** /variables/{variable_key} | Get a variable +[**GetVariables**](VariableAPI.md#GetVariables) | **Get** /variables | List variables +[**PatchVariable**](VariableAPI.md#PatchVariable) | **Patch** /variables/{variable_key} | Update a variable +[**PostVariables**](VariableAPI.md#PostVariables) | **Post** /variables | Create a variable @@ -43,22 +24,22 @@ Delete a variable package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - variableKey := "variableKey_example" // string | The variable Key. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.VariableApi.DeleteVariable(context.Background(), variableKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `VariableApi.DeleteVariable``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + variableKey := "variableKey_example" // string | The variable Key. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.VariableAPI.DeleteVariable(context.Background(), variableKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VariableAPI.DeleteVariable``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -85,7 +66,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -111,24 +92,24 @@ Get a variable package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - variableKey := "variableKey_example" // string | The variable Key. - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.VariableApi.GetVariable(context.Background(), variableKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `VariableApi.GetVariable``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetVariable`: Variable - fmt.Fprintf(os.Stdout, "Response from `VariableApi.GetVariable`: %v\n", resp) + variableKey := "variableKey_example" // string | The variable Key. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VariableAPI.GetVariable(context.Background(), variableKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VariableAPI.GetVariable``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetVariable`: Variable + fmt.Fprintf(os.Stdout, "Response from `VariableAPI.GetVariable`: %v\n", resp) } ``` @@ -155,7 +136,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -181,26 +162,26 @@ List variables package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) - offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) - orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.VariableApi.GetVariables(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `VariableApi.GetVariables``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetVariables`: VariableCollection - fmt.Fprintf(os.Stdout, "Response from `VariableApi.GetVariables`: %v\n", resp) + limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) + offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) + orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VariableAPI.GetVariables(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VariableAPI.GetVariables``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetVariables`: VariableCollection + fmt.Fprintf(os.Stdout, "Response from `VariableAPI.GetVariables`: %v\n", resp) } ``` @@ -225,7 +206,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -251,26 +232,26 @@ Update a variable package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - variableKey := "variableKey_example" // string | The variable Key. - variable := *openapiclient.NewVariable() // Variable | - updateMask := []string{"Inner_example"} // []string | The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.VariableApi.PatchVariable(context.Background(), variableKey).Variable(variable).UpdateMask(updateMask).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `VariableApi.PatchVariable``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PatchVariable`: Variable - fmt.Fprintf(os.Stdout, "Response from `VariableApi.PatchVariable`: %v\n", resp) + variableKey := "variableKey_example" // string | The variable Key. + variable := *openapiclient.NewVariable() // Variable | + updateMask := []string{"Inner_example"} // []string | The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VariableAPI.PatchVariable(context.Background(), variableKey).Variable(variable).UpdateMask(updateMask).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VariableAPI.PatchVariable``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PatchVariable`: Variable + fmt.Fprintf(os.Stdout, "Response from `VariableAPI.PatchVariable`: %v\n", resp) } ``` @@ -299,7 +280,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -323,24 +304,24 @@ Create a variable package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - variable := *openapiclient.NewVariable() // Variable | - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.VariableApi.PostVariables(context.Background()).Variable(variable).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `VariableApi.PostVariables``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PostVariables`: Variable - fmt.Fprintf(os.Stdout, "Response from `VariableApi.PostVariables`: %v\n", resp) + variable := *openapiclient.NewVariable() // Variable | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.VariableAPI.PostVariables(context.Background()).Variable(variable).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `VariableAPI.PostVariables``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PostVariables`: Variable + fmt.Fprintf(os.Stdout, "Response from `VariableAPI.PostVariables`: %v\n", resp) } ``` @@ -363,7 +344,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers diff --git a/airflow/docs/VariableCollection.md b/airflow/docs/VariableCollection.md index 3991373..2bdd2e2 100644 --- a/airflow/docs/VariableCollection.md +++ b/airflow/docs/VariableCollection.md @@ -1,30 +1,11 @@ - - # VariableCollection ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] **Variables** | Pointer to [**[]VariableCollectionItem**](VariableCollectionItem.md) | | [optional] -**TotalEntries** | Pointer to **int32** | Count of objects in the current result set. | [optional] ## Methods @@ -45,55 +26,55 @@ NewVariableCollectionWithDefaults instantiates a new VariableCollection object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetVariables +### GetTotalEntries -`func (o *VariableCollection) GetVariables() []VariableCollectionItem` +`func (o *VariableCollection) GetTotalEntries() int32` -GetVariables returns the Variables field if non-nil, zero value otherwise. +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. -### GetVariablesOk +### GetTotalEntriesOk -`func (o *VariableCollection) GetVariablesOk() (*[]VariableCollectionItem, bool)` +`func (o *VariableCollection) GetTotalEntriesOk() (*int32, bool)` -GetVariablesOk returns a tuple with the Variables field if it's non-nil, zero value otherwise +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetVariables +### SetTotalEntries -`func (o *VariableCollection) SetVariables(v []VariableCollectionItem)` +`func (o *VariableCollection) SetTotalEntries(v int32)` -SetVariables sets Variables field to given value. +SetTotalEntries sets TotalEntries field to given value. -### HasVariables +### HasTotalEntries -`func (o *VariableCollection) HasVariables() bool` +`func (o *VariableCollection) HasTotalEntries() bool` -HasVariables returns a boolean if a field has been set. +HasTotalEntries returns a boolean if a field has been set. -### GetTotalEntries +### GetVariables -`func (o *VariableCollection) GetTotalEntries() int32` +`func (o *VariableCollection) GetVariables() []VariableCollectionItem` -GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. +GetVariables returns the Variables field if non-nil, zero value otherwise. -### GetTotalEntriesOk +### GetVariablesOk -`func (o *VariableCollection) GetTotalEntriesOk() (*int32, bool)` +`func (o *VariableCollection) GetVariablesOk() (*[]VariableCollectionItem, bool)` -GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +GetVariablesOk returns a tuple with the Variables field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTotalEntries +### SetVariables -`func (o *VariableCollection) SetTotalEntries(v int32)` +`func (o *VariableCollection) SetVariables(v []VariableCollectionItem)` -SetTotalEntries sets TotalEntries field to given value. +SetVariables sets Variables field to given value. -### HasTotalEntries +### HasVariables -`func (o *VariableCollection) HasTotalEntries() bool` +`func (o *VariableCollection) HasVariables() bool` -HasTotalEntries returns a boolean if a field has been set. +HasVariables returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/VariableCollectionItem.md b/airflow/docs/VariableCollectionItem.md index 287a154..522a809 100644 --- a/airflow/docs/VariableCollectionItem.md +++ b/airflow/docs/VariableCollectionItem.md @@ -1,30 +1,11 @@ - - # VariableCollectionItem ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Key** | Pointer to **string** | | [optional] **Description** | Pointer to **NullableString** | The description of the variable. *New in version 2.4.0* | [optional] +**Key** | Pointer to **string** | | [optional] ## Methods @@ -45,31 +26,6 @@ NewVariableCollectionItemWithDefaults instantiates a new VariableCollectionItem This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetKey - -`func (o *VariableCollectionItem) GetKey() string` - -GetKey returns the Key field if non-nil, zero value otherwise. - -### GetKeyOk - -`func (o *VariableCollectionItem) GetKeyOk() (*string, bool)` - -GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetKey - -`func (o *VariableCollectionItem) SetKey(v string)` - -SetKey sets Key field to given value. - -### HasKey - -`func (o *VariableCollectionItem) HasKey() bool` - -HasKey returns a boolean if a field has been set. - ### GetDescription `func (o *VariableCollectionItem) GetDescription() string` @@ -105,6 +61,31 @@ HasDescription returns a boolean if a field has been set. `func (o *VariableCollectionItem) UnsetDescription()` UnsetDescription ensures that no value is present for Description, not even an explicit nil +### GetKey + +`func (o *VariableCollectionItem) GetKey() string` + +GetKey returns the Key field if non-nil, zero value otherwise. + +### GetKeyOk + +`func (o *VariableCollectionItem) GetKeyOk() (*string, bool)` + +GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKey + +`func (o *VariableCollectionItem) SetKey(v string)` + +SetKey sets Key field to given value. + +### HasKey + +`func (o *VariableCollectionItem) HasKey() bool` + +HasKey returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/VersionInfo.md b/airflow/docs/VersionInfo.md index caeec32..5dd8f2a 100644 --- a/airflow/docs/VersionInfo.md +++ b/airflow/docs/VersionInfo.md @@ -1,30 +1,11 @@ - - # VersionInfo ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Version** | Pointer to **string** | The version of Airflow | [optional] **GitVersion** | Pointer to **NullableString** | The git version (including git commit hash) | [optional] +**Version** | Pointer to **string** | The version of Airflow | [optional] ## Methods @@ -45,31 +26,6 @@ NewVersionInfoWithDefaults instantiates a new VersionInfo object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetVersion - -`func (o *VersionInfo) GetVersion() string` - -GetVersion returns the Version field if non-nil, zero value otherwise. - -### GetVersionOk - -`func (o *VersionInfo) GetVersionOk() (*string, bool)` - -GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVersion - -`func (o *VersionInfo) SetVersion(v string)` - -SetVersion sets Version field to given value. - -### HasVersion - -`func (o *VersionInfo) HasVersion() bool` - -HasVersion returns a boolean if a field has been set. - ### GetGitVersion `func (o *VersionInfo) GetGitVersion() string` @@ -105,6 +61,31 @@ HasGitVersion returns a boolean if a field has been set. `func (o *VersionInfo) UnsetGitVersion()` UnsetGitVersion ensures that no value is present for GitVersion, not even an explicit nil +### GetVersion + +`func (o *VersionInfo) GetVersion() string` + +GetVersion returns the Version field if non-nil, zero value otherwise. + +### GetVersionOk + +`func (o *VersionInfo) GetVersionOk() (*string, bool)` + +GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersion + +`func (o *VersionInfo) SetVersion(v string)` + +SetVersion sets Version field to given value. + +### HasVersion + +`func (o *VersionInfo) HasVersion() bool` + +HasVersion returns a boolean if a field has been set. + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/WeightRule.md b/airflow/docs/WeightRule.md index f7dbc67..81f791c 100644 --- a/airflow/docs/WeightRule.md +++ b/airflow/docs/WeightRule.md @@ -1,22 +1,3 @@ - - # WeightRule ## Enum diff --git a/airflow/docs/XCom.md b/airflow/docs/XCom.md index 68e1873..6fb0288 100644 --- a/airflow/docs/XCom.md +++ b/airflow/docs/XCom.md @@ -1,34 +1,16 @@ - - # XCom ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Key** | Pointer to **string** | | [optional] -**Timestamp** | Pointer to **string** | | [optional] +**DagId** | Pointer to **string** | | [optional] **ExecutionDate** | Pointer to **string** | | [optional] +**Key** | Pointer to **string** | | [optional] +**MapIndex** | Pointer to **int32** | | [optional] **TaskId** | Pointer to **string** | | [optional] -**DagId** | Pointer to **string** | | [optional] -**Value** | Pointer to **string** | The value | [optional] +**Timestamp** | Pointer to **string** | | [optional] +**Value** | Pointer to **interface{}** | The value(s), | [optional] ## Methods @@ -49,80 +31,105 @@ NewXComWithDefaults instantiates a new XCom object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetKey +### GetDagId -`func (o *XCom) GetKey() string` +`func (o *XCom) GetDagId() string` -GetKey returns the Key field if non-nil, zero value otherwise. +GetDagId returns the DagId field if non-nil, zero value otherwise. -### GetKeyOk +### GetDagIdOk -`func (o *XCom) GetKeyOk() (*string, bool)` +`func (o *XCom) GetDagIdOk() (*string, bool)` -GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise +GetDagIdOk returns a tuple with the DagId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetKey +### SetDagId -`func (o *XCom) SetKey(v string)` +`func (o *XCom) SetDagId(v string)` -SetKey sets Key field to given value. +SetDagId sets DagId field to given value. -### HasKey +### HasDagId -`func (o *XCom) HasKey() bool` +`func (o *XCom) HasDagId() bool` -HasKey returns a boolean if a field has been set. +HasDagId returns a boolean if a field has been set. -### GetTimestamp +### GetExecutionDate -`func (o *XCom) GetTimestamp() string` +`func (o *XCom) GetExecutionDate() string` -GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. +GetExecutionDate returns the ExecutionDate field if non-nil, zero value otherwise. -### GetTimestampOk +### GetExecutionDateOk -`func (o *XCom) GetTimestampOk() (*string, bool)` +`func (o *XCom) GetExecutionDateOk() (*string, bool)` -GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise +GetExecutionDateOk returns a tuple with the ExecutionDate field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTimestamp +### SetExecutionDate -`func (o *XCom) SetTimestamp(v string)` +`func (o *XCom) SetExecutionDate(v string)` -SetTimestamp sets Timestamp field to given value. +SetExecutionDate sets ExecutionDate field to given value. -### HasTimestamp +### HasExecutionDate -`func (o *XCom) HasTimestamp() bool` +`func (o *XCom) HasExecutionDate() bool` -HasTimestamp returns a boolean if a field has been set. +HasExecutionDate returns a boolean if a field has been set. -### GetExecutionDate +### GetKey -`func (o *XCom) GetExecutionDate() string` +`func (o *XCom) GetKey() string` -GetExecutionDate returns the ExecutionDate field if non-nil, zero value otherwise. +GetKey returns the Key field if non-nil, zero value otherwise. -### GetExecutionDateOk +### GetKeyOk -`func (o *XCom) GetExecutionDateOk() (*string, bool)` +`func (o *XCom) GetKeyOk() (*string, bool)` -GetExecutionDateOk returns a tuple with the ExecutionDate field if it's non-nil, zero value otherwise +GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetExecutionDate +### SetKey -`func (o *XCom) SetExecutionDate(v string)` +`func (o *XCom) SetKey(v string)` -SetExecutionDate sets ExecutionDate field to given value. +SetKey sets Key field to given value. -### HasExecutionDate +### HasKey -`func (o *XCom) HasExecutionDate() bool` +`func (o *XCom) HasKey() bool` -HasExecutionDate returns a boolean if a field has been set. +HasKey returns a boolean if a field has been set. + +### GetMapIndex + +`func (o *XCom) GetMapIndex() int32` + +GetMapIndex returns the MapIndex field if non-nil, zero value otherwise. + +### GetMapIndexOk + +`func (o *XCom) GetMapIndexOk() (*int32, bool)` + +GetMapIndexOk returns a tuple with the MapIndex field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMapIndex + +`func (o *XCom) SetMapIndex(v int32)` + +SetMapIndex sets MapIndex field to given value. + +### HasMapIndex + +`func (o *XCom) HasMapIndex() bool` + +HasMapIndex returns a boolean if a field has been set. ### GetTaskId @@ -149,47 +156,47 @@ SetTaskId sets TaskId field to given value. HasTaskId returns a boolean if a field has been set. -### GetDagId +### GetTimestamp -`func (o *XCom) GetDagId() string` +`func (o *XCom) GetTimestamp() string` -GetDagId returns the DagId field if non-nil, zero value otherwise. +GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. -### GetDagIdOk +### GetTimestampOk -`func (o *XCom) GetDagIdOk() (*string, bool)` +`func (o *XCom) GetTimestampOk() (*string, bool)` -GetDagIdOk returns a tuple with the DagId field if it's non-nil, zero value otherwise +GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDagId +### SetTimestamp -`func (o *XCom) SetDagId(v string)` +`func (o *XCom) SetTimestamp(v string)` -SetDagId sets DagId field to given value. +SetTimestamp sets Timestamp field to given value. -### HasDagId +### HasTimestamp -`func (o *XCom) HasDagId() bool` +`func (o *XCom) HasTimestamp() bool` -HasDagId returns a boolean if a field has been set. +HasTimestamp returns a boolean if a field has been set. ### GetValue -`func (o *XCom) GetValue() string` +`func (o *XCom) GetValue() interface{}` GetValue returns the Value field if non-nil, zero value otherwise. ### GetValueOk -`func (o *XCom) GetValueOk() (*string, bool)` +`func (o *XCom) GetValueOk() (*interface{}, bool)` GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetValue -`func (o *XCom) SetValue(v string)` +`func (o *XCom) SetValue(v interface{})` SetValue sets Value field to given value. @@ -199,6 +206,16 @@ SetValue sets Value field to given value. HasValue returns a boolean if a field has been set. +### SetValueNil + +`func (o *XCom) SetValueNil(b bool)` + + SetValueNil sets the value for Value to be an explicit nil + +### UnsetValue +`func (o *XCom) UnsetValue()` + +UnsetValue ensures that no value is present for Value, not even an explicit nil [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/XComApi.md b/airflow/docs/XComApi.md index b977c4c..d86d67e 100644 --- a/airflow/docs/XComApi.md +++ b/airflow/docs/XComApi.md @@ -1,36 +1,17 @@ - - -# \XComApi - -All URIs are relative to *http://localhost/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- -[**GetXcomEntries**](XComApi.md#GetXcomEntries) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries | List XCom entries -[**GetXcomEntry**](XComApi.md#GetXcomEntry) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries/{xcom_key} | Get an XCom entry +[**GetXcomEntries**](XComAPI.md#GetXcomEntries) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries | List XCom entries +[**GetXcomEntry**](XComAPI.md#GetXcomEntry) | **Get** /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries/{xcom_key} | Get an XCom entry ## GetXcomEntries -> XComCollection GetXcomEntries(ctx, dagId, dagRunId, taskId).Limit(limit).Offset(offset).Execute() +> XComCollection GetXcomEntries(ctx, dagId, dagRunId, taskId).MapIndex(mapIndex).XcomKey(xcomKey).Limit(limit).Offset(offset).Execute() List XCom entries @@ -42,28 +23,30 @@ List XCom entries package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - dagRunId := "dagRunId_example" // string | The DAG run ID. - taskId := "taskId_example" // string | The task ID. - limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) - offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.XComApi.GetXcomEntries(context.Background(), dagId, dagRunId, taskId).Limit(limit).Offset(offset).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `XComApi.GetXcomEntries``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetXcomEntries`: XComCollection - fmt.Fprintf(os.Stdout, "Response from `XComApi.GetXcomEntries`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + taskId := "taskId_example" // string | The task ID. + mapIndex := int32(56) // int32 | Filter on map index for mapped task. (optional) + xcomKey := "xcomKey_example" // string | Only filter the XCom records which have the provided key. (optional) + limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) + offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.XComAPI.GetXcomEntries(context.Background(), dagId, dagRunId, taskId).MapIndex(mapIndex).XcomKey(xcomKey).Limit(limit).Offset(offset).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `XComAPI.GetXcomEntries``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetXcomEntries`: XComCollection + fmt.Fprintf(os.Stdout, "Response from `XComAPI.GetXcomEntries`: %v\n", resp) } ``` @@ -87,6 +70,8 @@ Name | Type | Description | Notes + **mapIndex** | **int32** | Filter on map index for mapped task. | + **xcomKey** | **string** | Only filter the XCom records which have the provided key. | **limit** | **int32** | The numbers of items to return. | [default to 100] **offset** | **int32** | The number of items to skip before starting to collect the result set. | @@ -96,7 +81,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers @@ -110,7 +95,7 @@ Name | Type | Description | Notes ## GetXcomEntry -> XCom GetXcomEntry(ctx, dagId, dagRunId, taskId, xcomKey).Deserialize(deserialize).Execute() +> XCom GetXcomEntry(ctx, dagId, dagRunId, taskId, xcomKey).MapIndex(mapIndex).Deserialize(deserialize).Stringify(stringify).Execute() Get an XCom entry @@ -120,28 +105,30 @@ Get an XCom entry package main import ( - "context" - "fmt" - "os" - openapiclient "./openapi" + "context" + "fmt" + "os" + openapiclient "./airflow" ) func main() { - dagId := "dagId_example" // string | The DAG ID. - dagRunId := "dagRunId_example" // string | The DAG run ID. - taskId := "taskId_example" // string | The task ID. - xcomKey := "xcomKey_example" // string | The XCom key. - deserialize := true // bool | Whether to deserialize an XCom value when using a custom XCom backend. The XCom API endpoint calls `orm_deserialize_value` by default since an XCom may contain value that is potentially expensive to deserialize in the web server. Setting this to true overrides the consideration, and calls `deserialize_value` instead. This parameter is not meaningful when using the default XCom backend. *New in version 2.4.0* (optional) (default to false) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.XComApi.GetXcomEntry(context.Background(), dagId, dagRunId, taskId, xcomKey).Deserialize(deserialize).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `XComApi.GetXcomEntry``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetXcomEntry`: XCom - fmt.Fprintf(os.Stdout, "Response from `XComApi.GetXcomEntry`: %v\n", resp) + dagId := "dagId_example" // string | The DAG ID. + dagRunId := "dagRunId_example" // string | The DAG run ID. + taskId := "taskId_example" // string | The task ID. + xcomKey := "xcomKey_example" // string | The XCom key. + mapIndex := int32(56) // int32 | Filter on map index for mapped task. (optional) + deserialize := true // bool | Whether to deserialize an XCom value when using a custom XCom backend. The XCom API endpoint calls `orm_deserialize_value` by default since an XCom may contain value that is potentially expensive to deserialize in the web server. Setting this to true overrides the consideration, and calls `deserialize_value` instead. This parameter is not meaningful when using the default XCom backend. *New in version 2.4.0* (optional) (default to false) + stringify := true // bool | Whether to convert the XCom value to be a string. XCom values can be of Any data type. If set to true (default) the Any value will be returned as string, e.g. a Python representation of a dict. If set to false it will return the raw data as dict, list, string or whatever was stored. This parameter is not meaningful when using XCom pickling, then it is always returned as string. *New in version 2.10.0* (optional) (default to true) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.XComAPI.GetXcomEntry(context.Background(), dagId, dagRunId, taskId, xcomKey).MapIndex(mapIndex).Deserialize(deserialize).Stringify(stringify).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `XComAPI.GetXcomEntry``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetXcomEntry`: XCom + fmt.Fprintf(os.Stdout, "Response from `XComAPI.GetXcomEntry`: %v\n", resp) } ``` @@ -167,7 +154,9 @@ Name | Type | Description | Notes + **mapIndex** | **int32** | Filter on map index for mapped task. | **deserialize** | **bool** | Whether to deserialize an XCom value when using a custom XCom backend. The XCom API endpoint calls `orm_deserialize_value` by default since an XCom may contain value that is potentially expensive to deserialize in the web server. Setting this to true overrides the consideration, and calls `deserialize_value` instead. This parameter is not meaningful when using the default XCom backend. *New in version 2.4.0* | [default to false] + **stringify** | **bool** | Whether to convert the XCom value to be a string. XCom values can be of Any data type. If set to true (default) the Any value will be returned as string, e.g. a Python representation of a dict. If set to false it will return the raw data as dict, list, string or whatever was stored. This parameter is not meaningful when using XCom pickling, then it is always returned as string. *New in version 2.10.0* | [default to true] ### Return type @@ -175,7 +164,7 @@ Name | Type | Description | Notes ### Authorization -[Basic](../README.md#Basic), [Kerberos](../README.md#Kerberos) +No authorization required ### HTTP request headers diff --git a/airflow/docs/XComCollection.md b/airflow/docs/XComCollection.md index 36eba5a..911b0ab 100644 --- a/airflow/docs/XComCollection.md +++ b/airflow/docs/XComCollection.md @@ -1,30 +1,11 @@ - - # XComCollection ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] **XcomEntries** | Pointer to [**[]XComCollectionItem**](XComCollectionItem.md) | | [optional] -**TotalEntries** | Pointer to **int32** | Count of objects in the current result set. | [optional] ## Methods @@ -45,55 +26,55 @@ NewXComCollectionWithDefaults instantiates a new XComCollection object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetXcomEntries +### GetTotalEntries -`func (o *XComCollection) GetXcomEntries() []XComCollectionItem` +`func (o *XComCollection) GetTotalEntries() int32` -GetXcomEntries returns the XcomEntries field if non-nil, zero value otherwise. +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. -### GetXcomEntriesOk +### GetTotalEntriesOk -`func (o *XComCollection) GetXcomEntriesOk() (*[]XComCollectionItem, bool)` +`func (o *XComCollection) GetTotalEntriesOk() (*int32, bool)` -GetXcomEntriesOk returns a tuple with the XcomEntries field if it's non-nil, zero value otherwise +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetXcomEntries +### SetTotalEntries -`func (o *XComCollection) SetXcomEntries(v []XComCollectionItem)` +`func (o *XComCollection) SetTotalEntries(v int32)` -SetXcomEntries sets XcomEntries field to given value. +SetTotalEntries sets TotalEntries field to given value. -### HasXcomEntries +### HasTotalEntries -`func (o *XComCollection) HasXcomEntries() bool` +`func (o *XComCollection) HasTotalEntries() bool` -HasXcomEntries returns a boolean if a field has been set. +HasTotalEntries returns a boolean if a field has been set. -### GetTotalEntries +### GetXcomEntries -`func (o *XComCollection) GetTotalEntries() int32` +`func (o *XComCollection) GetXcomEntries() []XComCollectionItem` -GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. +GetXcomEntries returns the XcomEntries field if non-nil, zero value otherwise. -### GetTotalEntriesOk +### GetXcomEntriesOk -`func (o *XComCollection) GetTotalEntriesOk() (*int32, bool)` +`func (o *XComCollection) GetXcomEntriesOk() (*[]XComCollectionItem, bool)` -GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +GetXcomEntriesOk returns a tuple with the XcomEntries field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTotalEntries +### SetXcomEntries -`func (o *XComCollection) SetTotalEntries(v int32)` +`func (o *XComCollection) SetXcomEntries(v []XComCollectionItem)` -SetTotalEntries sets TotalEntries field to given value. +SetXcomEntries sets XcomEntries field to given value. -### HasTotalEntries +### HasXcomEntries -`func (o *XComCollection) HasTotalEntries() bool` +`func (o *XComCollection) HasXcomEntries() bool` -HasTotalEntries returns a boolean if a field has been set. +HasXcomEntries returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/docs/XComCollectionItem.md b/airflow/docs/XComCollectionItem.md index e3ee09c..b77f6fe 100644 --- a/airflow/docs/XComCollectionItem.md +++ b/airflow/docs/XComCollectionItem.md @@ -1,33 +1,15 @@ - - # XComCollectionItem ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Key** | Pointer to **string** | | [optional] -**Timestamp** | Pointer to **string** | | [optional] +**DagId** | Pointer to **string** | | [optional] **ExecutionDate** | Pointer to **string** | | [optional] +**Key** | Pointer to **string** | | [optional] +**MapIndex** | Pointer to **int32** | | [optional] **TaskId** | Pointer to **string** | | [optional] -**DagId** | Pointer to **string** | | [optional] +**Timestamp** | Pointer to **string** | | [optional] ## Methods @@ -48,80 +30,105 @@ NewXComCollectionItemWithDefaults instantiates a new XComCollectionItem object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set -### GetKey +### GetDagId -`func (o *XComCollectionItem) GetKey() string` +`func (o *XComCollectionItem) GetDagId() string` -GetKey returns the Key field if non-nil, zero value otherwise. +GetDagId returns the DagId field if non-nil, zero value otherwise. -### GetKeyOk +### GetDagIdOk -`func (o *XComCollectionItem) GetKeyOk() (*string, bool)` +`func (o *XComCollectionItem) GetDagIdOk() (*string, bool)` -GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise +GetDagIdOk returns a tuple with the DagId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetKey +### SetDagId -`func (o *XComCollectionItem) SetKey(v string)` +`func (o *XComCollectionItem) SetDagId(v string)` -SetKey sets Key field to given value. +SetDagId sets DagId field to given value. -### HasKey +### HasDagId -`func (o *XComCollectionItem) HasKey() bool` +`func (o *XComCollectionItem) HasDagId() bool` -HasKey returns a boolean if a field has been set. +HasDagId returns a boolean if a field has been set. -### GetTimestamp +### GetExecutionDate -`func (o *XComCollectionItem) GetTimestamp() string` +`func (o *XComCollectionItem) GetExecutionDate() string` -GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. +GetExecutionDate returns the ExecutionDate field if non-nil, zero value otherwise. -### GetTimestampOk +### GetExecutionDateOk -`func (o *XComCollectionItem) GetTimestampOk() (*string, bool)` +`func (o *XComCollectionItem) GetExecutionDateOk() (*string, bool)` -GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise +GetExecutionDateOk returns a tuple with the ExecutionDate field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetTimestamp +### SetExecutionDate -`func (o *XComCollectionItem) SetTimestamp(v string)` +`func (o *XComCollectionItem) SetExecutionDate(v string)` -SetTimestamp sets Timestamp field to given value. +SetExecutionDate sets ExecutionDate field to given value. -### HasTimestamp +### HasExecutionDate -`func (o *XComCollectionItem) HasTimestamp() bool` +`func (o *XComCollectionItem) HasExecutionDate() bool` -HasTimestamp returns a boolean if a field has been set. +HasExecutionDate returns a boolean if a field has been set. -### GetExecutionDate +### GetKey -`func (o *XComCollectionItem) GetExecutionDate() string` +`func (o *XComCollectionItem) GetKey() string` -GetExecutionDate returns the ExecutionDate field if non-nil, zero value otherwise. +GetKey returns the Key field if non-nil, zero value otherwise. -### GetExecutionDateOk +### GetKeyOk -`func (o *XComCollectionItem) GetExecutionDateOk() (*string, bool)` +`func (o *XComCollectionItem) GetKeyOk() (*string, bool)` -GetExecutionDateOk returns a tuple with the ExecutionDate field if it's non-nil, zero value otherwise +GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetExecutionDate +### SetKey -`func (o *XComCollectionItem) SetExecutionDate(v string)` +`func (o *XComCollectionItem) SetKey(v string)` -SetExecutionDate sets ExecutionDate field to given value. +SetKey sets Key field to given value. -### HasExecutionDate +### HasKey -`func (o *XComCollectionItem) HasExecutionDate() bool` +`func (o *XComCollectionItem) HasKey() bool` -HasExecutionDate returns a boolean if a field has been set. +HasKey returns a boolean if a field has been set. + +### GetMapIndex + +`func (o *XComCollectionItem) GetMapIndex() int32` + +GetMapIndex returns the MapIndex field if non-nil, zero value otherwise. + +### GetMapIndexOk + +`func (o *XComCollectionItem) GetMapIndexOk() (*int32, bool)` + +GetMapIndexOk returns a tuple with the MapIndex field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMapIndex + +`func (o *XComCollectionItem) SetMapIndex(v int32)` + +SetMapIndex sets MapIndex field to given value. + +### HasMapIndex + +`func (o *XComCollectionItem) HasMapIndex() bool` + +HasMapIndex returns a boolean if a field has been set. ### GetTaskId @@ -148,30 +155,30 @@ SetTaskId sets TaskId field to given value. HasTaskId returns a boolean if a field has been set. -### GetDagId +### GetTimestamp -`func (o *XComCollectionItem) GetDagId() string` +`func (o *XComCollectionItem) GetTimestamp() string` -GetDagId returns the DagId field if non-nil, zero value otherwise. +GetTimestamp returns the Timestamp field if non-nil, zero value otherwise. -### GetDagIdOk +### GetTimestampOk -`func (o *XComCollectionItem) GetDagIdOk() (*string, bool)` +`func (o *XComCollectionItem) GetTimestampOk() (*string, bool)` -GetDagIdOk returns a tuple with the DagId field if it's non-nil, zero value otherwise +GetTimestampOk returns a tuple with the Timestamp field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. -### SetDagId +### SetTimestamp -`func (o *XComCollectionItem) SetDagId(v string)` +`func (o *XComCollectionItem) SetTimestamp(v string)` -SetDagId sets DagId field to given value. +SetTimestamp sets Timestamp field to given value. -### HasDagId +### HasTimestamp -`func (o *XComCollectionItem) HasDagId() bool` +`func (o *XComCollectionItem) HasTimestamp() bool` -HasDagId returns a boolean if a field has been set. +HasTimestamp returns a boolean if a field has been set. [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/airflow/go.mod b/airflow/go.mod index 0eb774e..b58df7a 100644 --- a/airflow/go.mod +++ b/airflow/go.mod @@ -1,7 +1,11 @@ module github.com/apache/airflow-client-go/airflow -go 1.13 +go 1.18 + +require github.com/stretchr/testify v1.10.0 require ( - golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99 + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/airflow/go.sum b/airflow/go.sum index 734252e..c38f9d6 100644 --- a/airflow/go.sum +++ b/airflow/go.sum @@ -1,13 +1,5 @@ -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/airflow/model_action.go b/airflow/model_action.go index e011476..d0abebc 100644 --- a/airflow/model_action.go +++ b/airflow/model_action.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,6 +15,9 @@ import ( "encoding/json" ) +// checks if the Action type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Action{} + // Action An action Item. *New in version 2.1.0* type Action struct { // The name of the permission \"action\" @@ -57,7 +43,7 @@ func NewActionWithDefaults() *Action { // GetName returns the Name field value if set, zero value otherwise. func (o *Action) GetName() string { - if o == nil || o.Name == nil { + if o == nil || IsNil(o.Name) { var ret string return ret } @@ -67,7 +53,7 @@ func (o *Action) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Action) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { + if o == nil || IsNil(o.Name) { return nil, false } return o.Name, true @@ -75,7 +61,7 @@ func (o *Action) GetNameOk() (*string, bool) { // HasName returns a boolean if a field has been set. func (o *Action) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !IsNil(o.Name) { return true } @@ -88,11 +74,19 @@ func (o *Action) SetName(v string) { } func (o Action) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Action) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { + if !IsNil(o.Name) { toSerialize["name"] = o.Name } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableAction struct { diff --git a/airflow/model_action_collection.go b/airflow/model_action_collection.go index 91978ad..9f6524d 100644 --- a/airflow/model_action_collection.go +++ b/airflow/model_action_collection.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,11 +15,14 @@ import ( "encoding/json" ) +// checks if the ActionCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActionCollection{} + // ActionCollection A collection of actions. *New in version 2.1.0* type ActionCollection struct { - Actions *[]Action `json:"actions,omitempty"` - // Count of objects in the current result set. + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. TotalEntries *int32 `json:"total_entries,omitempty"` + Actions []Action `json:"actions,omitempty"` } // NewActionCollection instantiates a new ActionCollection object @@ -56,79 +42,87 @@ func NewActionCollectionWithDefaults() *ActionCollection { return &this } -// GetActions returns the Actions field value if set, zero value otherwise. -func (o *ActionCollection) GetActions() []Action { - if o == nil || o.Actions == nil { - var ret []Action +// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. +func (o *ActionCollection) GetTotalEntries() int32 { + if o == nil || IsNil(o.TotalEntries) { + var ret int32 return ret } - return *o.Actions + return *o.TotalEntries } -// GetActionsOk returns a tuple with the Actions field value if set, nil otherwise +// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ActionCollection) GetActionsOk() (*[]Action, bool) { - if o == nil || o.Actions == nil { +func (o *ActionCollection) GetTotalEntriesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalEntries) { return nil, false } - return o.Actions, true + return o.TotalEntries, true } -// HasActions returns a boolean if a field has been set. -func (o *ActionCollection) HasActions() bool { - if o != nil && o.Actions != nil { +// HasTotalEntries returns a boolean if a field has been set. +func (o *ActionCollection) HasTotalEntries() bool { + if o != nil && !IsNil(o.TotalEntries) { return true } return false } -// SetActions gets a reference to the given []Action and assigns it to the Actions field. -func (o *ActionCollection) SetActions(v []Action) { - o.Actions = &v +// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. +func (o *ActionCollection) SetTotalEntries(v int32) { + o.TotalEntries = &v } -// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. -func (o *ActionCollection) GetTotalEntries() int32 { - if o == nil || o.TotalEntries == nil { - var ret int32 +// GetActions returns the Actions field value if set, zero value otherwise. +func (o *ActionCollection) GetActions() []Action { + if o == nil || IsNil(o.Actions) { + var ret []Action return ret } - return *o.TotalEntries + return o.Actions } -// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise +// GetActionsOk returns a tuple with the Actions field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ActionCollection) GetTotalEntriesOk() (*int32, bool) { - if o == nil || o.TotalEntries == nil { +func (o *ActionCollection) GetActionsOk() ([]Action, bool) { + if o == nil || IsNil(o.Actions) { return nil, false } - return o.TotalEntries, true + return o.Actions, true } -// HasTotalEntries returns a boolean if a field has been set. -func (o *ActionCollection) HasTotalEntries() bool { - if o != nil && o.TotalEntries != nil { +// HasActions returns a boolean if a field has been set. +func (o *ActionCollection) HasActions() bool { + if o != nil && !IsNil(o.Actions) { return true } return false } -// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. -func (o *ActionCollection) SetTotalEntries(v int32) { - o.TotalEntries = &v +// SetActions gets a reference to the given []Action and assigns it to the Actions field. +func (o *ActionCollection) SetActions(v []Action) { + o.Actions = v } func (o ActionCollection) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Actions != nil { - toSerialize["actions"] = o.Actions + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.TotalEntries != nil { + return json.Marshal(toSerialize) +} + +func (o ActionCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalEntries) { toSerialize["total_entries"] = o.TotalEntries } - return json.Marshal(toSerialize) + if !IsNil(o.Actions) { + toSerialize["actions"] = o.Actions + } + return toSerialize, nil } type NullableActionCollection struct { diff --git a/airflow/model_action_resource.go b/airflow/model_action_resource.go index a0a209c..bc42792 100644 --- a/airflow/model_action_resource.go +++ b/airflow/model_action_resource.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,10 +15,13 @@ import ( "encoding/json" ) +// checks if the ActionResource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActionResource{} + // ActionResource The Action-Resource item. *New in version 2.1.0* type ActionResource struct { - Action *Action `json:"action,omitempty"` - Resource *Resource `json:"resource,omitempty"` + Action Action `json:"action,omitempty"` + Resource Resource `json:"resource,omitempty"` } // NewActionResource instantiates a new ActionResource object @@ -57,25 +43,25 @@ func NewActionResourceWithDefaults() *ActionResource { // GetAction returns the Action field value if set, zero value otherwise. func (o *ActionResource) GetAction() Action { - if o == nil || o.Action == nil { + if o == nil || IsNil(o.Action) { var ret Action return ret } - return *o.Action + return o.Action } // GetActionOk returns a tuple with the Action field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ActionResource) GetActionOk() (*Action, bool) { - if o == nil || o.Action == nil { - return nil, false +func (o *ActionResource) GetActionOk() (Action, bool) { + if o == nil || IsNil(o.Action) { + return Action{}, false } return o.Action, true } // HasAction returns a boolean if a field has been set. func (o *ActionResource) HasAction() bool { - if o != nil && o.Action != nil { + if o != nil && !IsNil(o.Action) { return true } @@ -84,30 +70,30 @@ func (o *ActionResource) HasAction() bool { // SetAction gets a reference to the given Action and assigns it to the Action field. func (o *ActionResource) SetAction(v Action) { - o.Action = &v + o.Action = v } // GetResource returns the Resource field value if set, zero value otherwise. func (o *ActionResource) GetResource() Resource { - if o == nil || o.Resource == nil { + if o == nil || IsNil(o.Resource) { var ret Resource return ret } - return *o.Resource + return o.Resource } // GetResourceOk returns a tuple with the Resource field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ActionResource) GetResourceOk() (*Resource, bool) { - if o == nil || o.Resource == nil { - return nil, false +func (o *ActionResource) GetResourceOk() (Resource, bool) { + if o == nil || IsNil(o.Resource) { + return Resource{}, false } return o.Resource, true } // HasResource returns a boolean if a field has been set. func (o *ActionResource) HasResource() bool { - if o != nil && o.Resource != nil { + if o != nil && !IsNil(o.Resource) { return true } @@ -116,18 +102,26 @@ func (o *ActionResource) HasResource() bool { // SetResource gets a reference to the given Resource and assigns it to the Resource field. func (o *ActionResource) SetResource(v Resource) { - o.Resource = &v + o.Resource = v } func (o ActionResource) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActionResource) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Action != nil { + if !IsNil(o.Action) { toSerialize["action"] = o.Action } - if o.Resource != nil { + if !IsNil(o.Resource) { toSerialize["resource"] = o.Resource } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableActionResource struct { diff --git a/airflow/model_basic_dag_run.go b/airflow/model_basic_dag_run.go index a46ec98..56424c5 100644 --- a/airflow/model_basic_dag_run.go +++ b/airflow/model_basic_dag_run.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -33,18 +16,21 @@ import ( "time" ) +// checks if the BasicDAGRun type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BasicDAGRun{} + // BasicDAGRun struct for BasicDAGRun type BasicDAGRun struct { - // Run ID. - RunId *string `json:"run_id,omitempty"` DagId *string `json:"dag_id,omitempty"` + DataIntervalEnd NullableTime `json:"data_interval_end,omitempty"` + DataIntervalStart NullableTime `json:"data_interval_start,omitempty"` + EndDate NullableTime `json:"end_date,omitempty"` // The logical date (previously called execution date). This is the time or interval covered by this DAG run, according to the DAG definition. The value of this field can be set only when creating the object. If you try to modify the field of an existing object, the request fails with an BAD_REQUEST error. This together with DAG_ID are a unique key. *New in version 2.2.0* LogicalDate *time.Time `json:"logical_date,omitempty"` + // Run ID. + RunId *string `json:"run_id,omitempty"` // The start time. The time when DAG run was actually created. *Changed in version 2.1.3*: Field becomes nullable. StartDate NullableTime `json:"start_date,omitempty"` - EndDate NullableTime `json:"end_date,omitempty"` - DataIntervalStart NullableTime `json:"data_interval_start,omitempty"` - DataIntervalEnd NullableTime `json:"data_interval_end,omitempty"` State *DagState `json:"state,omitempty"` } @@ -65,41 +51,9 @@ func NewBasicDAGRunWithDefaults() *BasicDAGRun { return &this } -// GetRunId returns the RunId field value if set, zero value otherwise. -func (o *BasicDAGRun) GetRunId() string { - if o == nil || o.RunId == nil { - var ret string - return ret - } - return *o.RunId -} - -// GetRunIdOk returns a tuple with the RunId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *BasicDAGRun) GetRunIdOk() (*string, bool) { - if o == nil || o.RunId == nil { - return nil, false - } - return o.RunId, true -} - -// HasRunId returns a boolean if a field has been set. -func (o *BasicDAGRun) HasRunId() bool { - if o != nil && o.RunId != nil { - return true - } - - return false -} - -// SetRunId gets a reference to the given string and assigns it to the RunId field. -func (o *BasicDAGRun) SetRunId(v string) { - o.RunId = &v -} - // GetDagId returns the DagId field value if set, zero value otherwise. func (o *BasicDAGRun) GetDagId() string { - if o == nil || o.DagId == nil { + if o == nil || IsNil(o.DagId) { var ret string return ret } @@ -109,7 +63,7 @@ func (o *BasicDAGRun) GetDagId() string { // GetDagIdOk returns a tuple with the DagId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *BasicDAGRun) GetDagIdOk() (*string, bool) { - if o == nil || o.DagId == nil { + if o == nil || IsNil(o.DagId) { return nil, false } return o.DagId, true @@ -117,7 +71,7 @@ func (o *BasicDAGRun) GetDagIdOk() (*string, bool) { // HasDagId returns a boolean if a field has been set. func (o *BasicDAGRun) HasDagId() bool { - if o != nil && o.DagId != nil { + if o != nil && !IsNil(o.DagId) { return true } @@ -129,83 +83,93 @@ func (o *BasicDAGRun) SetDagId(v string) { o.DagId = &v } -// GetLogicalDate returns the LogicalDate field value if set, zero value otherwise. -func (o *BasicDAGRun) GetLogicalDate() time.Time { - if o == nil || o.LogicalDate == nil { +// GetDataIntervalEnd returns the DataIntervalEnd field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BasicDAGRun) GetDataIntervalEnd() time.Time { + if o == nil || IsNil(o.DataIntervalEnd.Get()) { var ret time.Time return ret } - return *o.LogicalDate + return *o.DataIntervalEnd.Get() } -// GetLogicalDateOk returns a tuple with the LogicalDate field value if set, nil otherwise +// GetDataIntervalEndOk returns a tuple with the DataIntervalEnd field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *BasicDAGRun) GetLogicalDateOk() (*time.Time, bool) { - if o == nil || o.LogicalDate == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BasicDAGRun) GetDataIntervalEndOk() (*time.Time, bool) { + if o == nil { return nil, false } - return o.LogicalDate, true + return o.DataIntervalEnd.Get(), o.DataIntervalEnd.IsSet() } -// HasLogicalDate returns a boolean if a field has been set. -func (o *BasicDAGRun) HasLogicalDate() bool { - if o != nil && o.LogicalDate != nil { +// HasDataIntervalEnd returns a boolean if a field has been set. +func (o *BasicDAGRun) HasDataIntervalEnd() bool { + if o != nil && o.DataIntervalEnd.IsSet() { return true } return false } -// SetLogicalDate gets a reference to the given time.Time and assigns it to the LogicalDate field. -func (o *BasicDAGRun) SetLogicalDate(v time.Time) { - o.LogicalDate = &v +// SetDataIntervalEnd gets a reference to the given NullableTime and assigns it to the DataIntervalEnd field. +func (o *BasicDAGRun) SetDataIntervalEnd(v time.Time) { + o.DataIntervalEnd.Set(&v) +} +// SetDataIntervalEndNil sets the value for DataIntervalEnd to be an explicit nil +func (o *BasicDAGRun) SetDataIntervalEndNil() { + o.DataIntervalEnd.Set(nil) } -// GetStartDate returns the StartDate field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *BasicDAGRun) GetStartDate() time.Time { - if o == nil || o.StartDate.Get() == nil { +// UnsetDataIntervalEnd ensures that no value is present for DataIntervalEnd, not even an explicit nil +func (o *BasicDAGRun) UnsetDataIntervalEnd() { + o.DataIntervalEnd.Unset() +} + +// GetDataIntervalStart returns the DataIntervalStart field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BasicDAGRun) GetDataIntervalStart() time.Time { + if o == nil || IsNil(o.DataIntervalStart.Get()) { var ret time.Time return ret } - return *o.StartDate.Get() + return *o.DataIntervalStart.Get() } -// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise +// GetDataIntervalStartOk returns a tuple with the DataIntervalStart field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *BasicDAGRun) GetStartDateOk() (*time.Time, bool) { - if o == nil { +func (o *BasicDAGRun) GetDataIntervalStartOk() (*time.Time, bool) { + if o == nil { return nil, false } - return o.StartDate.Get(), o.StartDate.IsSet() + return o.DataIntervalStart.Get(), o.DataIntervalStart.IsSet() } -// HasStartDate returns a boolean if a field has been set. -func (o *BasicDAGRun) HasStartDate() bool { - if o != nil && o.StartDate.IsSet() { +// HasDataIntervalStart returns a boolean if a field has been set. +func (o *BasicDAGRun) HasDataIntervalStart() bool { + if o != nil && o.DataIntervalStart.IsSet() { return true } return false } -// SetStartDate gets a reference to the given NullableTime and assigns it to the StartDate field. -func (o *BasicDAGRun) SetStartDate(v time.Time) { - o.StartDate.Set(&v) +// SetDataIntervalStart gets a reference to the given NullableTime and assigns it to the DataIntervalStart field. +func (o *BasicDAGRun) SetDataIntervalStart(v time.Time) { + o.DataIntervalStart.Set(&v) } -// SetStartDateNil sets the value for StartDate to be an explicit nil -func (o *BasicDAGRun) SetStartDateNil() { - o.StartDate.Set(nil) +// SetDataIntervalStartNil sets the value for DataIntervalStart to be an explicit nil +func (o *BasicDAGRun) SetDataIntervalStartNil() { + o.DataIntervalStart.Set(nil) } -// UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil -func (o *BasicDAGRun) UnsetStartDate() { - o.StartDate.Unset() +// UnsetDataIntervalStart ensures that no value is present for DataIntervalStart, not even an explicit nil +func (o *BasicDAGRun) UnsetDataIntervalStart() { + o.DataIntervalStart.Unset() } // GetEndDate returns the EndDate field value if set, zero value otherwise (both if not set or set to explicit null). func (o *BasicDAGRun) GetEndDate() time.Time { - if o == nil || o.EndDate.Get() == nil { + if o == nil || IsNil(o.EndDate.Get()) { var ret time.Time return ret } @@ -216,7 +180,7 @@ func (o *BasicDAGRun) GetEndDate() time.Time { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *BasicDAGRun) GetEndDateOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return o.EndDate.Get(), o.EndDate.IsSet() @@ -245,93 +209,115 @@ func (o *BasicDAGRun) UnsetEndDate() { o.EndDate.Unset() } -// GetDataIntervalStart returns the DataIntervalStart field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *BasicDAGRun) GetDataIntervalStart() time.Time { - if o == nil || o.DataIntervalStart.Get() == nil { +// GetLogicalDate returns the LogicalDate field value if set, zero value otherwise. +func (o *BasicDAGRun) GetLogicalDate() time.Time { + if o == nil || IsNil(o.LogicalDate) { var ret time.Time return ret } - return *o.DataIntervalStart.Get() + return *o.LogicalDate } -// GetDataIntervalStartOk returns a tuple with the DataIntervalStart field value if set, nil otherwise +// GetLogicalDateOk returns a tuple with the LogicalDate field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *BasicDAGRun) GetDataIntervalStartOk() (*time.Time, bool) { - if o == nil { +func (o *BasicDAGRun) GetLogicalDateOk() (*time.Time, bool) { + if o == nil || IsNil(o.LogicalDate) { return nil, false } - return o.DataIntervalStart.Get(), o.DataIntervalStart.IsSet() + return o.LogicalDate, true } -// HasDataIntervalStart returns a boolean if a field has been set. -func (o *BasicDAGRun) HasDataIntervalStart() bool { - if o != nil && o.DataIntervalStart.IsSet() { +// HasLogicalDate returns a boolean if a field has been set. +func (o *BasicDAGRun) HasLogicalDate() bool { + if o != nil && !IsNil(o.LogicalDate) { return true } return false } -// SetDataIntervalStart gets a reference to the given NullableTime and assigns it to the DataIntervalStart field. -func (o *BasicDAGRun) SetDataIntervalStart(v time.Time) { - o.DataIntervalStart.Set(&v) +// SetLogicalDate gets a reference to the given time.Time and assigns it to the LogicalDate field. +func (o *BasicDAGRun) SetLogicalDate(v time.Time) { + o.LogicalDate = &v } -// SetDataIntervalStartNil sets the value for DataIntervalStart to be an explicit nil -func (o *BasicDAGRun) SetDataIntervalStartNil() { - o.DataIntervalStart.Set(nil) + +// GetRunId returns the RunId field value if set, zero value otherwise. +func (o *BasicDAGRun) GetRunId() string { + if o == nil || IsNil(o.RunId) { + var ret string + return ret + } + return *o.RunId } -// UnsetDataIntervalStart ensures that no value is present for DataIntervalStart, not even an explicit nil -func (o *BasicDAGRun) UnsetDataIntervalStart() { - o.DataIntervalStart.Unset() +// GetRunIdOk returns a tuple with the RunId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BasicDAGRun) GetRunIdOk() (*string, bool) { + if o == nil || IsNil(o.RunId) { + return nil, false + } + return o.RunId, true } -// GetDataIntervalEnd returns the DataIntervalEnd field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *BasicDAGRun) GetDataIntervalEnd() time.Time { - if o == nil || o.DataIntervalEnd.Get() == nil { +// HasRunId returns a boolean if a field has been set. +func (o *BasicDAGRun) HasRunId() bool { + if o != nil && !IsNil(o.RunId) { + return true + } + + return false +} + +// SetRunId gets a reference to the given string and assigns it to the RunId field. +func (o *BasicDAGRun) SetRunId(v string) { + o.RunId = &v +} + +// GetStartDate returns the StartDate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BasicDAGRun) GetStartDate() time.Time { + if o == nil || IsNil(o.StartDate.Get()) { var ret time.Time return ret } - return *o.DataIntervalEnd.Get() + return *o.StartDate.Get() } -// GetDataIntervalEndOk returns a tuple with the DataIntervalEnd field value if set, nil otherwise +// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *BasicDAGRun) GetDataIntervalEndOk() (*time.Time, bool) { - if o == nil { +func (o *BasicDAGRun) GetStartDateOk() (*time.Time, bool) { + if o == nil { return nil, false } - return o.DataIntervalEnd.Get(), o.DataIntervalEnd.IsSet() + return o.StartDate.Get(), o.StartDate.IsSet() } -// HasDataIntervalEnd returns a boolean if a field has been set. -func (o *BasicDAGRun) HasDataIntervalEnd() bool { - if o != nil && o.DataIntervalEnd.IsSet() { +// HasStartDate returns a boolean if a field has been set. +func (o *BasicDAGRun) HasStartDate() bool { + if o != nil && o.StartDate.IsSet() { return true } return false } -// SetDataIntervalEnd gets a reference to the given NullableTime and assigns it to the DataIntervalEnd field. -func (o *BasicDAGRun) SetDataIntervalEnd(v time.Time) { - o.DataIntervalEnd.Set(&v) +// SetStartDate gets a reference to the given NullableTime and assigns it to the StartDate field. +func (o *BasicDAGRun) SetStartDate(v time.Time) { + o.StartDate.Set(&v) } -// SetDataIntervalEndNil sets the value for DataIntervalEnd to be an explicit nil -func (o *BasicDAGRun) SetDataIntervalEndNil() { - o.DataIntervalEnd.Set(nil) +// SetStartDateNil sets the value for StartDate to be an explicit nil +func (o *BasicDAGRun) SetStartDateNil() { + o.StartDate.Set(nil) } -// UnsetDataIntervalEnd ensures that no value is present for DataIntervalEnd, not even an explicit nil -func (o *BasicDAGRun) UnsetDataIntervalEnd() { - o.DataIntervalEnd.Unset() +// UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil +func (o *BasicDAGRun) UnsetStartDate() { + o.StartDate.Unset() } // GetState returns the State field value if set, zero value otherwise. func (o *BasicDAGRun) GetState() DagState { - if o == nil || o.State == nil { + if o == nil || IsNil(o.State) { var ret DagState return ret } @@ -341,7 +327,7 @@ func (o *BasicDAGRun) GetState() DagState { // GetStateOk returns a tuple with the State field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *BasicDAGRun) GetStateOk() (*DagState, bool) { - if o == nil || o.State == nil { + if o == nil || IsNil(o.State) { return nil, false } return o.State, true @@ -349,7 +335,7 @@ func (o *BasicDAGRun) GetStateOk() (*DagState, bool) { // HasState returns a boolean if a field has been set. func (o *BasicDAGRun) HasState() bool { - if o != nil && o.State != nil { + if o != nil && !IsNil(o.State) { return true } @@ -362,32 +348,40 @@ func (o *BasicDAGRun) SetState(v DagState) { } func (o BasicDAGRun) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.RunId != nil { - toSerialize["run_id"] = o.RunId + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.DagId != nil { + return json.Marshal(toSerialize) +} + +func (o BasicDAGRun) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DagId) { toSerialize["dag_id"] = o.DagId } - if o.LogicalDate != nil { - toSerialize["logical_date"] = o.LogicalDate + if o.DataIntervalEnd.IsSet() { + toSerialize["data_interval_end"] = o.DataIntervalEnd.Get() } - if o.StartDate.IsSet() { - toSerialize["start_date"] = o.StartDate.Get() + if o.DataIntervalStart.IsSet() { + toSerialize["data_interval_start"] = o.DataIntervalStart.Get() } if o.EndDate.IsSet() { toSerialize["end_date"] = o.EndDate.Get() } - if o.DataIntervalStart.IsSet() { - toSerialize["data_interval_start"] = o.DataIntervalStart.Get() + if !IsNil(o.LogicalDate) { + toSerialize["logical_date"] = o.LogicalDate } - if o.DataIntervalEnd.IsSet() { - toSerialize["data_interval_end"] = o.DataIntervalEnd.Get() + if !IsNil(o.RunId) { + toSerialize["run_id"] = o.RunId } - if o.State != nil { + if o.StartDate.IsSet() { + toSerialize["start_date"] = o.StartDate.Get() + } + if !IsNil(o.State) { toSerialize["state"] = o.State } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableBasicDAGRun struct { diff --git a/airflow/model_class_reference.go b/airflow/model_class_reference.go index 0a94e78..12a9edc 100644 --- a/airflow/model_class_reference.go +++ b/airflow/model_class_reference.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,10 +15,13 @@ import ( "encoding/json" ) +// checks if the ClassReference type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClassReference{} + // ClassReference Class reference type ClassReference struct { - ModulePath *string `json:"module_path,omitempty"` ClassName *string `json:"class_name,omitempty"` + ModulePath *string `json:"module_path,omitempty"` } // NewClassReference instantiates a new ClassReference object @@ -55,79 +41,87 @@ func NewClassReferenceWithDefaults() *ClassReference { return &this } -// GetModulePath returns the ModulePath field value if set, zero value otherwise. -func (o *ClassReference) GetModulePath() string { - if o == nil || o.ModulePath == nil { +// GetClassName returns the ClassName field value if set, zero value otherwise. +func (o *ClassReference) GetClassName() string { + if o == nil || IsNil(o.ClassName) { var ret string return ret } - return *o.ModulePath + return *o.ClassName } -// GetModulePathOk returns a tuple with the ModulePath field value if set, nil otherwise +// GetClassNameOk returns a tuple with the ClassName field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClassReference) GetModulePathOk() (*string, bool) { - if o == nil || o.ModulePath == nil { +func (o *ClassReference) GetClassNameOk() (*string, bool) { + if o == nil || IsNil(o.ClassName) { return nil, false } - return o.ModulePath, true + return o.ClassName, true } -// HasModulePath returns a boolean if a field has been set. -func (o *ClassReference) HasModulePath() bool { - if o != nil && o.ModulePath != nil { +// HasClassName returns a boolean if a field has been set. +func (o *ClassReference) HasClassName() bool { + if o != nil && !IsNil(o.ClassName) { return true } return false } -// SetModulePath gets a reference to the given string and assigns it to the ModulePath field. -func (o *ClassReference) SetModulePath(v string) { - o.ModulePath = &v +// SetClassName gets a reference to the given string and assigns it to the ClassName field. +func (o *ClassReference) SetClassName(v string) { + o.ClassName = &v } -// GetClassName returns the ClassName field value if set, zero value otherwise. -func (o *ClassReference) GetClassName() string { - if o == nil || o.ClassName == nil { +// GetModulePath returns the ModulePath field value if set, zero value otherwise. +func (o *ClassReference) GetModulePath() string { + if o == nil || IsNil(o.ModulePath) { var ret string return ret } - return *o.ClassName + return *o.ModulePath } -// GetClassNameOk returns a tuple with the ClassName field value if set, nil otherwise +// GetModulePathOk returns a tuple with the ModulePath field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClassReference) GetClassNameOk() (*string, bool) { - if o == nil || o.ClassName == nil { +func (o *ClassReference) GetModulePathOk() (*string, bool) { + if o == nil || IsNil(o.ModulePath) { return nil, false } - return o.ClassName, true + return o.ModulePath, true } -// HasClassName returns a boolean if a field has been set. -func (o *ClassReference) HasClassName() bool { - if o != nil && o.ClassName != nil { +// HasModulePath returns a boolean if a field has been set. +func (o *ClassReference) HasModulePath() bool { + if o != nil && !IsNil(o.ModulePath) { return true } return false } -// SetClassName gets a reference to the given string and assigns it to the ClassName field. -func (o *ClassReference) SetClassName(v string) { - o.ClassName = &v +// SetModulePath gets a reference to the given string and assigns it to the ModulePath field. +func (o *ClassReference) SetModulePath(v string) { + o.ModulePath = &v } func (o ClassReference) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.ModulePath != nil { - toSerialize["module_path"] = o.ModulePath + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.ClassName != nil { + return json.Marshal(toSerialize) +} + +func (o ClassReference) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ClassName) { toSerialize["class_name"] = o.ClassName } - return json.Marshal(toSerialize) + if !IsNil(o.ModulePath) { + toSerialize["module_path"] = o.ModulePath + } + return toSerialize, nil } type NullableClassReference struct { diff --git a/airflow/model_clear_dag_run.go b/airflow/model_clear_dag_run.go index d16231f..d1c59fb 100644 --- a/airflow/model_clear_dag_run.go +++ b/airflow/model_clear_dag_run.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,6 +15,9 @@ import ( "encoding/json" ) +// checks if the ClearDagRun type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClearDagRun{} + // ClearDagRun struct for ClearDagRun type ClearDagRun struct { // If set, don't actually run this operation. The response will contain a list of task instances planned to be cleaned, but not modified in any way. @@ -61,7 +47,7 @@ func NewClearDagRunWithDefaults() *ClearDagRun { // GetDryRun returns the DryRun field value if set, zero value otherwise. func (o *ClearDagRun) GetDryRun() bool { - if o == nil || o.DryRun == nil { + if o == nil || IsNil(o.DryRun) { var ret bool return ret } @@ -71,7 +57,7 @@ func (o *ClearDagRun) GetDryRun() bool { // GetDryRunOk returns a tuple with the DryRun field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ClearDagRun) GetDryRunOk() (*bool, bool) { - if o == nil || o.DryRun == nil { + if o == nil || IsNil(o.DryRun) { return nil, false } return o.DryRun, true @@ -79,7 +65,7 @@ func (o *ClearDagRun) GetDryRunOk() (*bool, bool) { // HasDryRun returns a boolean if a field has been set. func (o *ClearDagRun) HasDryRun() bool { - if o != nil && o.DryRun != nil { + if o != nil && !IsNil(o.DryRun) { return true } @@ -92,11 +78,19 @@ func (o *ClearDagRun) SetDryRun(v bool) { } func (o ClearDagRun) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ClearDagRun) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.DryRun != nil { + if !IsNil(o.DryRun) { toSerialize["dry_run"] = o.DryRun } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableClearDagRun struct { diff --git a/airflow/model_clear_dag_run_200_response.go b/airflow/model_clear_dag_run_200_response.go new file mode 100644 index 0000000..c956d7a --- /dev/null +++ b/airflow/model_clear_dag_run_200_response.go @@ -0,0 +1,108 @@ +/* +Airflow API (Stable) + +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. + +API version: 2.10.5 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package airflow + +import ( + "encoding/json" + "fmt" +) + + +// ClearDagRun200Response struct for ClearDagRun200Response +type ClearDagRun200Response struct { + DAGRun *DAGRun + TaskInstanceCollection *TaskInstanceCollection +} + +// Unmarshal JSON data into any of the pointers in the struct +func (dst *ClearDagRun200Response) UnmarshalJSON(data []byte) error { + var err error + // try to unmarshal JSON data into DAGRun + err = json.Unmarshal(data, &dst.DAGRun); + if err == nil { + jsonDAGRun, _ := json.Marshal(dst.DAGRun) + if string(jsonDAGRun) == "{}" { // empty struct + dst.DAGRun = nil + } else { + return nil // data stored in dst.DAGRun, return on the first match + } + } else { + dst.DAGRun = nil + } + + // try to unmarshal JSON data into TaskInstanceCollection + err = json.Unmarshal(data, &dst.TaskInstanceCollection); + if err == nil { + jsonTaskInstanceCollection, _ := json.Marshal(dst.TaskInstanceCollection) + if string(jsonTaskInstanceCollection) == "{}" { // empty struct + dst.TaskInstanceCollection = nil + } else { + return nil // data stored in dst.TaskInstanceCollection, return on the first match + } + } else { + dst.TaskInstanceCollection = nil + } + + return fmt.Errorf("data failed to match schemas in anyOf(ClearDagRun200Response)") +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src ClearDagRun200Response) MarshalJSON() ([]byte, error) { + if src.DAGRun != nil { + return json.Marshal(&src.DAGRun) + } + + if src.TaskInstanceCollection != nil { + return json.Marshal(&src.TaskInstanceCollection) + } + + return nil, nil // no data in anyOf schemas +} + + +type NullableClearDagRun200Response struct { + value *ClearDagRun200Response + isSet bool +} + +func (v NullableClearDagRun200Response) Get() *ClearDagRun200Response { + return v.value +} + +func (v *NullableClearDagRun200Response) Set(val *ClearDagRun200Response) { + v.value = val + v.isSet = true +} + +func (v NullableClearDagRun200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableClearDagRun200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClearDagRun200Response(val *ClearDagRun200Response) *NullableClearDagRun200Response { + return &NullableClearDagRun200Response{value: val, isSet: true} +} + +func (v NullableClearDagRun200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClearDagRun200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/model_clear_task_instances.go b/airflow/model_clear_task_instances.go index 279aa8d..5d209d7 100644 --- a/airflow/model_clear_task_instances.go +++ b/airflow/model_clear_task_instances.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,36 +15,39 @@ import ( "encoding/json" ) +// checks if the ClearTaskInstances type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ClearTaskInstances{} + // ClearTaskInstances struct for ClearTaskInstances type ClearTaskInstances struct { + // The DagRun ID for this task instance + DagRunId NullableString `json:"dag_run_id,omitempty"` // If set, don't actually run this operation. The response will contain a list of task instances planned to be cleaned, but not modified in any way. DryRun *bool `json:"dry_run,omitempty"` - // A list of task ids to clear. *New in version 2.1.0* - TaskIds *[]string `json:"task_ids,omitempty"` - // The minimum execution date to clear. - StartDate *string `json:"start_date,omitempty"` // The maximum execution date to clear. EndDate *string `json:"end_date,omitempty"` - // Only clear failed tasks. - OnlyFailed *bool `json:"only_failed,omitempty"` - // Only clear running tasks. - OnlyRunning *bool `json:"only_running,omitempty"` - // Clear tasks in subdags and clear external tasks indicated by ExternalTaskMarker. - IncludeSubdags *bool `json:"include_subdags,omitempty"` - // Clear tasks in the parent dag of the subdag. - IncludeParentdag *bool `json:"include_parentdag,omitempty"` - // Set state of DAG runs to RUNNING. - ResetDagRuns *bool `json:"reset_dag_runs,omitempty"` - // The DagRun ID for this task instance - DagRunId NullableString `json:"dag_run_id,omitempty"` - // If set to true, upstream tasks are also affected. - IncludeUpstream *bool `json:"include_upstream,omitempty"` // If set to true, downstream tasks are also affected. IncludeDownstream *bool `json:"include_downstream,omitempty"` // If set to True, also tasks from future DAG Runs are affected. IncludeFuture *bool `json:"include_future,omitempty"` + // Clear tasks in the parent dag of the subdag. + IncludeParentdag *bool `json:"include_parentdag,omitempty"` // If set to True, also tasks from past DAG Runs are affected. IncludePast *bool `json:"include_past,omitempty"` + // Clear tasks in subdags and clear external tasks indicated by ExternalTaskMarker. + IncludeSubdags *bool `json:"include_subdags,omitempty"` + // If set to true, upstream tasks are also affected. + IncludeUpstream *bool `json:"include_upstream,omitempty"` + // Only clear failed tasks. + OnlyFailed *bool `json:"only_failed,omitempty"` + // Only clear running tasks. + OnlyRunning *bool `json:"only_running,omitempty"` + // Set state of DAG runs to RUNNING. + ResetDagRuns *bool `json:"reset_dag_runs,omitempty"` + // The minimum execution date to clear. + StartDate *string `json:"start_date,omitempty"` + // A list of task ids to clear. *New in version 2.1.0* + TaskIds []string `json:"task_ids,omitempty"` } // NewClearTaskInstances instantiates a new ClearTaskInstances object @@ -72,18 +58,18 @@ func NewClearTaskInstances() *ClearTaskInstances { this := ClearTaskInstances{} var dryRun bool = true this.DryRun = &dryRun - var onlyFailed bool = true - this.OnlyFailed = &onlyFailed - var onlyRunning bool = false - this.OnlyRunning = &onlyRunning - var includeUpstream bool = false - this.IncludeUpstream = &includeUpstream var includeDownstream bool = false this.IncludeDownstream = &includeDownstream var includeFuture bool = false this.IncludeFuture = &includeFuture var includePast bool = false this.IncludePast = &includePast + var includeUpstream bool = false + this.IncludeUpstream = &includeUpstream + var onlyFailed bool = true + this.OnlyFailed = &onlyFailed + var onlyRunning bool = false + this.OnlyRunning = &onlyRunning return &this } @@ -94,24 +80,66 @@ func NewClearTaskInstancesWithDefaults() *ClearTaskInstances { this := ClearTaskInstances{} var dryRun bool = true this.DryRun = &dryRun - var onlyFailed bool = true - this.OnlyFailed = &onlyFailed - var onlyRunning bool = false - this.OnlyRunning = &onlyRunning - var includeUpstream bool = false - this.IncludeUpstream = &includeUpstream var includeDownstream bool = false this.IncludeDownstream = &includeDownstream var includeFuture bool = false this.IncludeFuture = &includeFuture var includePast bool = false this.IncludePast = &includePast + var includeUpstream bool = false + this.IncludeUpstream = &includeUpstream + var onlyFailed bool = true + this.OnlyFailed = &onlyFailed + var onlyRunning bool = false + this.OnlyRunning = &onlyRunning return &this } +// GetDagRunId returns the DagRunId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ClearTaskInstances) GetDagRunId() string { + if o == nil || IsNil(o.DagRunId.Get()) { + var ret string + return ret + } + return *o.DagRunId.Get() +} + +// GetDagRunIdOk returns a tuple with the DagRunId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClearTaskInstances) GetDagRunIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DagRunId.Get(), o.DagRunId.IsSet() +} + +// HasDagRunId returns a boolean if a field has been set. +func (o *ClearTaskInstances) HasDagRunId() bool { + if o != nil && o.DagRunId.IsSet() { + return true + } + + return false +} + +// SetDagRunId gets a reference to the given NullableString and assigns it to the DagRunId field. +func (o *ClearTaskInstances) SetDagRunId(v string) { + o.DagRunId.Set(&v) +} +// SetDagRunIdNil sets the value for DagRunId to be an explicit nil +func (o *ClearTaskInstances) SetDagRunIdNil() { + o.DagRunId.Set(nil) +} + +// UnsetDagRunId ensures that no value is present for DagRunId, not even an explicit nil +func (o *ClearTaskInstances) UnsetDagRunId() { + o.DagRunId.Unset() +} + // GetDryRun returns the DryRun field value if set, zero value otherwise. func (o *ClearTaskInstances) GetDryRun() bool { - if o == nil || o.DryRun == nil { + if o == nil || IsNil(o.DryRun) { var ret bool return ret } @@ -121,7 +149,7 @@ func (o *ClearTaskInstances) GetDryRun() bool { // GetDryRunOk returns a tuple with the DryRun field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ClearTaskInstances) GetDryRunOk() (*bool, bool) { - if o == nil || o.DryRun == nil { + if o == nil || IsNil(o.DryRun) { return nil, false } return o.DryRun, true @@ -129,7 +157,7 @@ func (o *ClearTaskInstances) GetDryRunOk() (*bool, bool) { // HasDryRun returns a boolean if a field has been set. func (o *ClearTaskInstances) HasDryRun() bool { - if o != nil && o.DryRun != nil { + if o != nil && !IsNil(o.DryRun) { return true } @@ -141,169 +169,169 @@ func (o *ClearTaskInstances) SetDryRun(v bool) { o.DryRun = &v } -// GetTaskIds returns the TaskIds field value if set, zero value otherwise. -func (o *ClearTaskInstances) GetTaskIds() []string { - if o == nil || o.TaskIds == nil { - var ret []string +// GetEndDate returns the EndDate field value if set, zero value otherwise. +func (o *ClearTaskInstances) GetEndDate() string { + if o == nil || IsNil(o.EndDate) { + var ret string return ret } - return *o.TaskIds + return *o.EndDate } -// GetTaskIdsOk returns a tuple with the TaskIds field value if set, nil otherwise +// GetEndDateOk returns a tuple with the EndDate field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClearTaskInstances) GetTaskIdsOk() (*[]string, bool) { - if o == nil || o.TaskIds == nil { +func (o *ClearTaskInstances) GetEndDateOk() (*string, bool) { + if o == nil || IsNil(o.EndDate) { return nil, false } - return o.TaskIds, true + return o.EndDate, true } -// HasTaskIds returns a boolean if a field has been set. -func (o *ClearTaskInstances) HasTaskIds() bool { - if o != nil && o.TaskIds != nil { +// HasEndDate returns a boolean if a field has been set. +func (o *ClearTaskInstances) HasEndDate() bool { + if o != nil && !IsNil(o.EndDate) { return true } return false } -// SetTaskIds gets a reference to the given []string and assigns it to the TaskIds field. -func (o *ClearTaskInstances) SetTaskIds(v []string) { - o.TaskIds = &v +// SetEndDate gets a reference to the given string and assigns it to the EndDate field. +func (o *ClearTaskInstances) SetEndDate(v string) { + o.EndDate = &v } -// GetStartDate returns the StartDate field value if set, zero value otherwise. -func (o *ClearTaskInstances) GetStartDate() string { - if o == nil || o.StartDate == nil { - var ret string +// GetIncludeDownstream returns the IncludeDownstream field value if set, zero value otherwise. +func (o *ClearTaskInstances) GetIncludeDownstream() bool { + if o == nil || IsNil(o.IncludeDownstream) { + var ret bool return ret } - return *o.StartDate + return *o.IncludeDownstream } -// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise +// GetIncludeDownstreamOk returns a tuple with the IncludeDownstream field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClearTaskInstances) GetStartDateOk() (*string, bool) { - if o == nil || o.StartDate == nil { +func (o *ClearTaskInstances) GetIncludeDownstreamOk() (*bool, bool) { + if o == nil || IsNil(o.IncludeDownstream) { return nil, false } - return o.StartDate, true + return o.IncludeDownstream, true } -// HasStartDate returns a boolean if a field has been set. -func (o *ClearTaskInstances) HasStartDate() bool { - if o != nil && o.StartDate != nil { +// HasIncludeDownstream returns a boolean if a field has been set. +func (o *ClearTaskInstances) HasIncludeDownstream() bool { + if o != nil && !IsNil(o.IncludeDownstream) { return true } return false } -// SetStartDate gets a reference to the given string and assigns it to the StartDate field. -func (o *ClearTaskInstances) SetStartDate(v string) { - o.StartDate = &v +// SetIncludeDownstream gets a reference to the given bool and assigns it to the IncludeDownstream field. +func (o *ClearTaskInstances) SetIncludeDownstream(v bool) { + o.IncludeDownstream = &v } -// GetEndDate returns the EndDate field value if set, zero value otherwise. -func (o *ClearTaskInstances) GetEndDate() string { - if o == nil || o.EndDate == nil { - var ret string +// GetIncludeFuture returns the IncludeFuture field value if set, zero value otherwise. +func (o *ClearTaskInstances) GetIncludeFuture() bool { + if o == nil || IsNil(o.IncludeFuture) { + var ret bool return ret } - return *o.EndDate + return *o.IncludeFuture } -// GetEndDateOk returns a tuple with the EndDate field value if set, nil otherwise +// GetIncludeFutureOk returns a tuple with the IncludeFuture field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClearTaskInstances) GetEndDateOk() (*string, bool) { - if o == nil || o.EndDate == nil { +func (o *ClearTaskInstances) GetIncludeFutureOk() (*bool, bool) { + if o == nil || IsNil(o.IncludeFuture) { return nil, false } - return o.EndDate, true + return o.IncludeFuture, true } -// HasEndDate returns a boolean if a field has been set. -func (o *ClearTaskInstances) HasEndDate() bool { - if o != nil && o.EndDate != nil { +// HasIncludeFuture returns a boolean if a field has been set. +func (o *ClearTaskInstances) HasIncludeFuture() bool { + if o != nil && !IsNil(o.IncludeFuture) { return true } return false } -// SetEndDate gets a reference to the given string and assigns it to the EndDate field. -func (o *ClearTaskInstances) SetEndDate(v string) { - o.EndDate = &v +// SetIncludeFuture gets a reference to the given bool and assigns it to the IncludeFuture field. +func (o *ClearTaskInstances) SetIncludeFuture(v bool) { + o.IncludeFuture = &v } -// GetOnlyFailed returns the OnlyFailed field value if set, zero value otherwise. -func (o *ClearTaskInstances) GetOnlyFailed() bool { - if o == nil || o.OnlyFailed == nil { +// GetIncludeParentdag returns the IncludeParentdag field value if set, zero value otherwise. +func (o *ClearTaskInstances) GetIncludeParentdag() bool { + if o == nil || IsNil(o.IncludeParentdag) { var ret bool return ret } - return *o.OnlyFailed + return *o.IncludeParentdag } -// GetOnlyFailedOk returns a tuple with the OnlyFailed field value if set, nil otherwise +// GetIncludeParentdagOk returns a tuple with the IncludeParentdag field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClearTaskInstances) GetOnlyFailedOk() (*bool, bool) { - if o == nil || o.OnlyFailed == nil { +func (o *ClearTaskInstances) GetIncludeParentdagOk() (*bool, bool) { + if o == nil || IsNil(o.IncludeParentdag) { return nil, false } - return o.OnlyFailed, true + return o.IncludeParentdag, true } -// HasOnlyFailed returns a boolean if a field has been set. -func (o *ClearTaskInstances) HasOnlyFailed() bool { - if o != nil && o.OnlyFailed != nil { +// HasIncludeParentdag returns a boolean if a field has been set. +func (o *ClearTaskInstances) HasIncludeParentdag() bool { + if o != nil && !IsNil(o.IncludeParentdag) { return true } return false } -// SetOnlyFailed gets a reference to the given bool and assigns it to the OnlyFailed field. -func (o *ClearTaskInstances) SetOnlyFailed(v bool) { - o.OnlyFailed = &v +// SetIncludeParentdag gets a reference to the given bool and assigns it to the IncludeParentdag field. +func (o *ClearTaskInstances) SetIncludeParentdag(v bool) { + o.IncludeParentdag = &v } -// GetOnlyRunning returns the OnlyRunning field value if set, zero value otherwise. -func (o *ClearTaskInstances) GetOnlyRunning() bool { - if o == nil || o.OnlyRunning == nil { +// GetIncludePast returns the IncludePast field value if set, zero value otherwise. +func (o *ClearTaskInstances) GetIncludePast() bool { + if o == nil || IsNil(o.IncludePast) { var ret bool return ret } - return *o.OnlyRunning + return *o.IncludePast } -// GetOnlyRunningOk returns a tuple with the OnlyRunning field value if set, nil otherwise +// GetIncludePastOk returns a tuple with the IncludePast field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClearTaskInstances) GetOnlyRunningOk() (*bool, bool) { - if o == nil || o.OnlyRunning == nil { +func (o *ClearTaskInstances) GetIncludePastOk() (*bool, bool) { + if o == nil || IsNil(o.IncludePast) { return nil, false } - return o.OnlyRunning, true + return o.IncludePast, true } -// HasOnlyRunning returns a boolean if a field has been set. -func (o *ClearTaskInstances) HasOnlyRunning() bool { - if o != nil && o.OnlyRunning != nil { +// HasIncludePast returns a boolean if a field has been set. +func (o *ClearTaskInstances) HasIncludePast() bool { + if o != nil && !IsNil(o.IncludePast) { return true } return false } -// SetOnlyRunning gets a reference to the given bool and assigns it to the OnlyRunning field. -func (o *ClearTaskInstances) SetOnlyRunning(v bool) { - o.OnlyRunning = &v +// SetIncludePast gets a reference to the given bool and assigns it to the IncludePast field. +func (o *ClearTaskInstances) SetIncludePast(v bool) { + o.IncludePast = &v } // GetIncludeSubdags returns the IncludeSubdags field value if set, zero value otherwise. func (o *ClearTaskInstances) GetIncludeSubdags() bool { - if o == nil || o.IncludeSubdags == nil { + if o == nil || IsNil(o.IncludeSubdags) { var ret bool return ret } @@ -313,7 +341,7 @@ func (o *ClearTaskInstances) GetIncludeSubdags() bool { // GetIncludeSubdagsOk returns a tuple with the IncludeSubdags field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ClearTaskInstances) GetIncludeSubdagsOk() (*bool, bool) { - if o == nil || o.IncludeSubdags == nil { + if o == nil || IsNil(o.IncludeSubdags) { return nil, false } return o.IncludeSubdags, true @@ -321,7 +349,7 @@ func (o *ClearTaskInstances) GetIncludeSubdagsOk() (*bool, bool) { // HasIncludeSubdags returns a boolean if a field has been set. func (o *ClearTaskInstances) HasIncludeSubdags() bool { - if o != nil && o.IncludeSubdags != nil { + if o != nil && !IsNil(o.IncludeSubdags) { return true } @@ -333,285 +361,251 @@ func (o *ClearTaskInstances) SetIncludeSubdags(v bool) { o.IncludeSubdags = &v } -// GetIncludeParentdag returns the IncludeParentdag field value if set, zero value otherwise. -func (o *ClearTaskInstances) GetIncludeParentdag() bool { - if o == nil || o.IncludeParentdag == nil { +// GetIncludeUpstream returns the IncludeUpstream field value if set, zero value otherwise. +func (o *ClearTaskInstances) GetIncludeUpstream() bool { + if o == nil || IsNil(o.IncludeUpstream) { var ret bool return ret } - return *o.IncludeParentdag + return *o.IncludeUpstream } -// GetIncludeParentdagOk returns a tuple with the IncludeParentdag field value if set, nil otherwise +// GetIncludeUpstreamOk returns a tuple with the IncludeUpstream field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClearTaskInstances) GetIncludeParentdagOk() (*bool, bool) { - if o == nil || o.IncludeParentdag == nil { +func (o *ClearTaskInstances) GetIncludeUpstreamOk() (*bool, bool) { + if o == nil || IsNil(o.IncludeUpstream) { return nil, false } - return o.IncludeParentdag, true + return o.IncludeUpstream, true } -// HasIncludeParentdag returns a boolean if a field has been set. -func (o *ClearTaskInstances) HasIncludeParentdag() bool { - if o != nil && o.IncludeParentdag != nil { +// HasIncludeUpstream returns a boolean if a field has been set. +func (o *ClearTaskInstances) HasIncludeUpstream() bool { + if o != nil && !IsNil(o.IncludeUpstream) { return true } return false } -// SetIncludeParentdag gets a reference to the given bool and assigns it to the IncludeParentdag field. -func (o *ClearTaskInstances) SetIncludeParentdag(v bool) { - o.IncludeParentdag = &v +// SetIncludeUpstream gets a reference to the given bool and assigns it to the IncludeUpstream field. +func (o *ClearTaskInstances) SetIncludeUpstream(v bool) { + o.IncludeUpstream = &v } -// GetResetDagRuns returns the ResetDagRuns field value if set, zero value otherwise. -func (o *ClearTaskInstances) GetResetDagRuns() bool { - if o == nil || o.ResetDagRuns == nil { +// GetOnlyFailed returns the OnlyFailed field value if set, zero value otherwise. +func (o *ClearTaskInstances) GetOnlyFailed() bool { + if o == nil || IsNil(o.OnlyFailed) { var ret bool return ret } - return *o.ResetDagRuns + return *o.OnlyFailed } -// GetResetDagRunsOk returns a tuple with the ResetDagRuns field value if set, nil otherwise +// GetOnlyFailedOk returns a tuple with the OnlyFailed field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClearTaskInstances) GetResetDagRunsOk() (*bool, bool) { - if o == nil || o.ResetDagRuns == nil { +func (o *ClearTaskInstances) GetOnlyFailedOk() (*bool, bool) { + if o == nil || IsNil(o.OnlyFailed) { return nil, false } - return o.ResetDagRuns, true + return o.OnlyFailed, true } -// HasResetDagRuns returns a boolean if a field has been set. -func (o *ClearTaskInstances) HasResetDagRuns() bool { - if o != nil && o.ResetDagRuns != nil { +// HasOnlyFailed returns a boolean if a field has been set. +func (o *ClearTaskInstances) HasOnlyFailed() bool { + if o != nil && !IsNil(o.OnlyFailed) { return true } return false } -// SetResetDagRuns gets a reference to the given bool and assigns it to the ResetDagRuns field. -func (o *ClearTaskInstances) SetResetDagRuns(v bool) { - o.ResetDagRuns = &v +// SetOnlyFailed gets a reference to the given bool and assigns it to the OnlyFailed field. +func (o *ClearTaskInstances) SetOnlyFailed(v bool) { + o.OnlyFailed = &v } -// GetDagRunId returns the DagRunId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ClearTaskInstances) GetDagRunId() string { - if o == nil || o.DagRunId.Get() == nil { - var ret string +// GetOnlyRunning returns the OnlyRunning field value if set, zero value otherwise. +func (o *ClearTaskInstances) GetOnlyRunning() bool { + if o == nil || IsNil(o.OnlyRunning) { + var ret bool return ret } - return *o.DagRunId.Get() + return *o.OnlyRunning } -// GetDagRunIdOk returns a tuple with the DagRunId field value if set, nil otherwise +// GetOnlyRunningOk returns a tuple with the OnlyRunning field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ClearTaskInstances) GetDagRunIdOk() (*string, bool) { - if o == nil { +func (o *ClearTaskInstances) GetOnlyRunningOk() (*bool, bool) { + if o == nil || IsNil(o.OnlyRunning) { return nil, false } - return o.DagRunId.Get(), o.DagRunId.IsSet() + return o.OnlyRunning, true } -// HasDagRunId returns a boolean if a field has been set. -func (o *ClearTaskInstances) HasDagRunId() bool { - if o != nil && o.DagRunId.IsSet() { +// HasOnlyRunning returns a boolean if a field has been set. +func (o *ClearTaskInstances) HasOnlyRunning() bool { + if o != nil && !IsNil(o.OnlyRunning) { return true } return false } -// SetDagRunId gets a reference to the given NullableString and assigns it to the DagRunId field. -func (o *ClearTaskInstances) SetDagRunId(v string) { - o.DagRunId.Set(&v) -} -// SetDagRunIdNil sets the value for DagRunId to be an explicit nil -func (o *ClearTaskInstances) SetDagRunIdNil() { - o.DagRunId.Set(nil) -} - -// UnsetDagRunId ensures that no value is present for DagRunId, not even an explicit nil -func (o *ClearTaskInstances) UnsetDagRunId() { - o.DagRunId.Unset() +// SetOnlyRunning gets a reference to the given bool and assigns it to the OnlyRunning field. +func (o *ClearTaskInstances) SetOnlyRunning(v bool) { + o.OnlyRunning = &v } -// GetIncludeUpstream returns the IncludeUpstream field value if set, zero value otherwise. -func (o *ClearTaskInstances) GetIncludeUpstream() bool { - if o == nil || o.IncludeUpstream == nil { +// GetResetDagRuns returns the ResetDagRuns field value if set, zero value otherwise. +func (o *ClearTaskInstances) GetResetDagRuns() bool { + if o == nil || IsNil(o.ResetDagRuns) { var ret bool return ret } - return *o.IncludeUpstream + return *o.ResetDagRuns } -// GetIncludeUpstreamOk returns a tuple with the IncludeUpstream field value if set, nil otherwise +// GetResetDagRunsOk returns a tuple with the ResetDagRuns field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClearTaskInstances) GetIncludeUpstreamOk() (*bool, bool) { - if o == nil || o.IncludeUpstream == nil { +func (o *ClearTaskInstances) GetResetDagRunsOk() (*bool, bool) { + if o == nil || IsNil(o.ResetDagRuns) { return nil, false } - return o.IncludeUpstream, true + return o.ResetDagRuns, true } -// HasIncludeUpstream returns a boolean if a field has been set. -func (o *ClearTaskInstances) HasIncludeUpstream() bool { - if o != nil && o.IncludeUpstream != nil { +// HasResetDagRuns returns a boolean if a field has been set. +func (o *ClearTaskInstances) HasResetDagRuns() bool { + if o != nil && !IsNil(o.ResetDagRuns) { return true } return false } -// SetIncludeUpstream gets a reference to the given bool and assigns it to the IncludeUpstream field. -func (o *ClearTaskInstances) SetIncludeUpstream(v bool) { - o.IncludeUpstream = &v +// SetResetDagRuns gets a reference to the given bool and assigns it to the ResetDagRuns field. +func (o *ClearTaskInstances) SetResetDagRuns(v bool) { + o.ResetDagRuns = &v } -// GetIncludeDownstream returns the IncludeDownstream field value if set, zero value otherwise. -func (o *ClearTaskInstances) GetIncludeDownstream() bool { - if o == nil || o.IncludeDownstream == nil { - var ret bool +// GetStartDate returns the StartDate field value if set, zero value otherwise. +func (o *ClearTaskInstances) GetStartDate() string { + if o == nil || IsNil(o.StartDate) { + var ret string return ret } - return *o.IncludeDownstream + return *o.StartDate } -// GetIncludeDownstreamOk returns a tuple with the IncludeDownstream field value if set, nil otherwise +// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClearTaskInstances) GetIncludeDownstreamOk() (*bool, bool) { - if o == nil || o.IncludeDownstream == nil { +func (o *ClearTaskInstances) GetStartDateOk() (*string, bool) { + if o == nil || IsNil(o.StartDate) { return nil, false } - return o.IncludeDownstream, true + return o.StartDate, true } -// HasIncludeDownstream returns a boolean if a field has been set. -func (o *ClearTaskInstances) HasIncludeDownstream() bool { - if o != nil && o.IncludeDownstream != nil { +// HasStartDate returns a boolean if a field has been set. +func (o *ClearTaskInstances) HasStartDate() bool { + if o != nil && !IsNil(o.StartDate) { return true } return false } -// SetIncludeDownstream gets a reference to the given bool and assigns it to the IncludeDownstream field. -func (o *ClearTaskInstances) SetIncludeDownstream(v bool) { - o.IncludeDownstream = &v +// SetStartDate gets a reference to the given string and assigns it to the StartDate field. +func (o *ClearTaskInstances) SetStartDate(v string) { + o.StartDate = &v } -// GetIncludeFuture returns the IncludeFuture field value if set, zero value otherwise. -func (o *ClearTaskInstances) GetIncludeFuture() bool { - if o == nil || o.IncludeFuture == nil { - var ret bool +// GetTaskIds returns the TaskIds field value if set, zero value otherwise. +func (o *ClearTaskInstances) GetTaskIds() []string { + if o == nil || IsNil(o.TaskIds) { + var ret []string return ret } - return *o.IncludeFuture + return o.TaskIds } -// GetIncludeFutureOk returns a tuple with the IncludeFuture field value if set, nil otherwise +// GetTaskIdsOk returns a tuple with the TaskIds field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClearTaskInstances) GetIncludeFutureOk() (*bool, bool) { - if o == nil || o.IncludeFuture == nil { +func (o *ClearTaskInstances) GetTaskIdsOk() ([]string, bool) { + if o == nil || IsNil(o.TaskIds) { return nil, false } - return o.IncludeFuture, true + return o.TaskIds, true } -// HasIncludeFuture returns a boolean if a field has been set. -func (o *ClearTaskInstances) HasIncludeFuture() bool { - if o != nil && o.IncludeFuture != nil { +// HasTaskIds returns a boolean if a field has been set. +func (o *ClearTaskInstances) HasTaskIds() bool { + if o != nil && !IsNil(o.TaskIds) { return true } return false } -// SetIncludeFuture gets a reference to the given bool and assigns it to the IncludeFuture field. -func (o *ClearTaskInstances) SetIncludeFuture(v bool) { - o.IncludeFuture = &v -} - -// GetIncludePast returns the IncludePast field value if set, zero value otherwise. -func (o *ClearTaskInstances) GetIncludePast() bool { - if o == nil || o.IncludePast == nil { - var ret bool - return ret - } - return *o.IncludePast -} - -// GetIncludePastOk returns a tuple with the IncludePast field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ClearTaskInstances) GetIncludePastOk() (*bool, bool) { - if o == nil || o.IncludePast == nil { - return nil, false - } - return o.IncludePast, true +// SetTaskIds gets a reference to the given []string and assigns it to the TaskIds field. +func (o *ClearTaskInstances) SetTaskIds(v []string) { + o.TaskIds = v } -// HasIncludePast returns a boolean if a field has been set. -func (o *ClearTaskInstances) HasIncludePast() bool { - if o != nil && o.IncludePast != nil { - return true +func (o ClearTaskInstances) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - - return false -} - -// SetIncludePast gets a reference to the given bool and assigns it to the IncludePast field. -func (o *ClearTaskInstances) SetIncludePast(v bool) { - o.IncludePast = &v + return json.Marshal(toSerialize) } -func (o ClearTaskInstances) MarshalJSON() ([]byte, error) { +func (o ClearTaskInstances) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.DryRun != nil { - toSerialize["dry_run"] = o.DryRun - } - if o.TaskIds != nil { - toSerialize["task_ids"] = o.TaskIds + if o.DagRunId.IsSet() { + toSerialize["dag_run_id"] = o.DagRunId.Get() } - if o.StartDate != nil { - toSerialize["start_date"] = o.StartDate + if !IsNil(o.DryRun) { + toSerialize["dry_run"] = o.DryRun } - if o.EndDate != nil { + if !IsNil(o.EndDate) { toSerialize["end_date"] = o.EndDate } - if o.OnlyFailed != nil { - toSerialize["only_failed"] = o.OnlyFailed - } - if o.OnlyRunning != nil { - toSerialize["only_running"] = o.OnlyRunning + if !IsNil(o.IncludeDownstream) { + toSerialize["include_downstream"] = o.IncludeDownstream } - if o.IncludeSubdags != nil { - toSerialize["include_subdags"] = o.IncludeSubdags + if !IsNil(o.IncludeFuture) { + toSerialize["include_future"] = o.IncludeFuture } - if o.IncludeParentdag != nil { + if !IsNil(o.IncludeParentdag) { toSerialize["include_parentdag"] = o.IncludeParentdag } - if o.ResetDagRuns != nil { - toSerialize["reset_dag_runs"] = o.ResetDagRuns + if !IsNil(o.IncludePast) { + toSerialize["include_past"] = o.IncludePast } - if o.DagRunId.IsSet() { - toSerialize["dag_run_id"] = o.DagRunId.Get() + if !IsNil(o.IncludeSubdags) { + toSerialize["include_subdags"] = o.IncludeSubdags } - if o.IncludeUpstream != nil { + if !IsNil(o.IncludeUpstream) { toSerialize["include_upstream"] = o.IncludeUpstream } - if o.IncludeDownstream != nil { - toSerialize["include_downstream"] = o.IncludeDownstream + if !IsNil(o.OnlyFailed) { + toSerialize["only_failed"] = o.OnlyFailed } - if o.IncludeFuture != nil { - toSerialize["include_future"] = o.IncludeFuture + if !IsNil(o.OnlyRunning) { + toSerialize["only_running"] = o.OnlyRunning } - if o.IncludePast != nil { - toSerialize["include_past"] = o.IncludePast + if !IsNil(o.ResetDagRuns) { + toSerialize["reset_dag_runs"] = o.ResetDagRuns } - return json.Marshal(toSerialize) + if !IsNil(o.StartDate) { + toSerialize["start_date"] = o.StartDate + } + if !IsNil(o.TaskIds) { + toSerialize["task_ids"] = o.TaskIds + } + return toSerialize, nil } type NullableClearTaskInstances struct { diff --git a/airflow/model_collection_info.go b/airflow/model_collection_info.go index c822f85..1394d9e 100644 --- a/airflow/model_collection_info.go +++ b/airflow/model_collection_info.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,9 +15,12 @@ import ( "encoding/json" ) +// checks if the CollectionInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CollectionInfo{} + // CollectionInfo Metadata about collection. type CollectionInfo struct { - // Count of objects in the current result set. + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. TotalEntries *int32 `json:"total_entries,omitempty"` } @@ -57,7 +43,7 @@ func NewCollectionInfoWithDefaults() *CollectionInfo { // GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. func (o *CollectionInfo) GetTotalEntries() int32 { - if o == nil || o.TotalEntries == nil { + if o == nil || IsNil(o.TotalEntries) { var ret int32 return ret } @@ -67,7 +53,7 @@ func (o *CollectionInfo) GetTotalEntries() int32 { // GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *CollectionInfo) GetTotalEntriesOk() (*int32, bool) { - if o == nil || o.TotalEntries == nil { + if o == nil || IsNil(o.TotalEntries) { return nil, false } return o.TotalEntries, true @@ -75,7 +61,7 @@ func (o *CollectionInfo) GetTotalEntriesOk() (*int32, bool) { // HasTotalEntries returns a boolean if a field has been set. func (o *CollectionInfo) HasTotalEntries() bool { - if o != nil && o.TotalEntries != nil { + if o != nil && !IsNil(o.TotalEntries) { return true } @@ -88,11 +74,19 @@ func (o *CollectionInfo) SetTotalEntries(v int32) { } func (o CollectionInfo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CollectionInfo) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.TotalEntries != nil { + if !IsNil(o.TotalEntries) { toSerialize["total_entries"] = o.TotalEntries } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableCollectionInfo struct { diff --git a/airflow/model_config.go b/airflow/model_config.go index adc31f8..f8c0e54 100644 --- a/airflow/model_config.go +++ b/airflow/model_config.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,9 +15,12 @@ import ( "encoding/json" ) +// checks if the Config type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Config{} + // Config The configuration. type Config struct { - Sections *[]ConfigSection `json:"sections,omitempty"` + Sections []ConfigSection `json:"sections,omitempty"` } // NewConfig instantiates a new Config object @@ -56,17 +42,17 @@ func NewConfigWithDefaults() *Config { // GetSections returns the Sections field value if set, zero value otherwise. func (o *Config) GetSections() []ConfigSection { - if o == nil || o.Sections == nil { + if o == nil || IsNil(o.Sections) { var ret []ConfigSection return ret } - return *o.Sections + return o.Sections } // GetSectionsOk returns a tuple with the Sections field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Config) GetSectionsOk() (*[]ConfigSection, bool) { - if o == nil || o.Sections == nil { +func (o *Config) GetSectionsOk() ([]ConfigSection, bool) { + if o == nil || IsNil(o.Sections) { return nil, false } return o.Sections, true @@ -74,7 +60,7 @@ func (o *Config) GetSectionsOk() (*[]ConfigSection, bool) { // HasSections returns a boolean if a field has been set. func (o *Config) HasSections() bool { - if o != nil && o.Sections != nil { + if o != nil && !IsNil(o.Sections) { return true } @@ -83,15 +69,23 @@ func (o *Config) HasSections() bool { // SetSections gets a reference to the given []ConfigSection and assigns it to the Sections field. func (o *Config) SetSections(v []ConfigSection) { - o.Sections = &v + o.Sections = v } func (o Config) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Config) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Sections != nil { + if !IsNil(o.Sections) { toSerialize["sections"] = o.Sections } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableConfig struct { diff --git a/airflow/model_config_option.go b/airflow/model_config_option.go index eeb0178..fab847c 100644 --- a/airflow/model_config_option.go +++ b/airflow/model_config_option.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,6 +15,9 @@ import ( "encoding/json" ) +// checks if the ConfigOption type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConfigOption{} + // ConfigOption The option of configuration. type ConfigOption struct { Key *string `json:"key,omitempty"` @@ -57,7 +43,7 @@ func NewConfigOptionWithDefaults() *ConfigOption { // GetKey returns the Key field value if set, zero value otherwise. func (o *ConfigOption) GetKey() string { - if o == nil || o.Key == nil { + if o == nil || IsNil(o.Key) { var ret string return ret } @@ -67,7 +53,7 @@ func (o *ConfigOption) GetKey() string { // GetKeyOk returns a tuple with the Key field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ConfigOption) GetKeyOk() (*string, bool) { - if o == nil || o.Key == nil { + if o == nil || IsNil(o.Key) { return nil, false } return o.Key, true @@ -75,7 +61,7 @@ func (o *ConfigOption) GetKeyOk() (*string, bool) { // HasKey returns a boolean if a field has been set. func (o *ConfigOption) HasKey() bool { - if o != nil && o.Key != nil { + if o != nil && !IsNil(o.Key) { return true } @@ -89,7 +75,7 @@ func (o *ConfigOption) SetKey(v string) { // GetValue returns the Value field value if set, zero value otherwise. func (o *ConfigOption) GetValue() string { - if o == nil || o.Value == nil { + if o == nil || IsNil(o.Value) { var ret string return ret } @@ -99,7 +85,7 @@ func (o *ConfigOption) GetValue() string { // GetValueOk returns a tuple with the Value field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ConfigOption) GetValueOk() (*string, bool) { - if o == nil || o.Value == nil { + if o == nil || IsNil(o.Value) { return nil, false } return o.Value, true @@ -107,7 +93,7 @@ func (o *ConfigOption) GetValueOk() (*string, bool) { // HasValue returns a boolean if a field has been set. func (o *ConfigOption) HasValue() bool { - if o != nil && o.Value != nil { + if o != nil && !IsNil(o.Value) { return true } @@ -120,14 +106,22 @@ func (o *ConfigOption) SetValue(v string) { } func (o ConfigOption) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConfigOption) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Key != nil { + if !IsNil(o.Key) { toSerialize["key"] = o.Key } - if o.Value != nil { + if !IsNil(o.Value) { toSerialize["value"] = o.Value } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableConfigOption struct { diff --git a/airflow/model_config_section.go b/airflow/model_config_section.go index cc4c3ff..da04a59 100644 --- a/airflow/model_config_section.go +++ b/airflow/model_config_section.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,10 +15,13 @@ import ( "encoding/json" ) +// checks if the ConfigSection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConfigSection{} + // ConfigSection The section of configuration. type ConfigSection struct { Name *string `json:"name,omitempty"` - Options *[]ConfigOption `json:"options,omitempty"` + Options []ConfigOption `json:"options,omitempty"` } // NewConfigSection instantiates a new ConfigSection object @@ -57,7 +43,7 @@ func NewConfigSectionWithDefaults() *ConfigSection { // GetName returns the Name field value if set, zero value otherwise. func (o *ConfigSection) GetName() string { - if o == nil || o.Name == nil { + if o == nil || IsNil(o.Name) { var ret string return ret } @@ -67,7 +53,7 @@ func (o *ConfigSection) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ConfigSection) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { + if o == nil || IsNil(o.Name) { return nil, false } return o.Name, true @@ -75,7 +61,7 @@ func (o *ConfigSection) GetNameOk() (*string, bool) { // HasName returns a boolean if a field has been set. func (o *ConfigSection) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !IsNil(o.Name) { return true } @@ -89,17 +75,17 @@ func (o *ConfigSection) SetName(v string) { // GetOptions returns the Options field value if set, zero value otherwise. func (o *ConfigSection) GetOptions() []ConfigOption { - if o == nil || o.Options == nil { + if o == nil || IsNil(o.Options) { var ret []ConfigOption return ret } - return *o.Options + return o.Options } // GetOptionsOk returns a tuple with the Options field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ConfigSection) GetOptionsOk() (*[]ConfigOption, bool) { - if o == nil || o.Options == nil { +func (o *ConfigSection) GetOptionsOk() ([]ConfigOption, bool) { + if o == nil || IsNil(o.Options) { return nil, false } return o.Options, true @@ -107,7 +93,7 @@ func (o *ConfigSection) GetOptionsOk() (*[]ConfigOption, bool) { // HasOptions returns a boolean if a field has been set. func (o *ConfigSection) HasOptions() bool { - if o != nil && o.Options != nil { + if o != nil && !IsNil(o.Options) { return true } @@ -116,18 +102,26 @@ func (o *ConfigSection) HasOptions() bool { // SetOptions gets a reference to the given []ConfigOption and assigns it to the Options field. func (o *ConfigSection) SetOptions(v []ConfigOption) { - o.Options = &v + o.Options = v } func (o ConfigSection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConfigSection) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { + if !IsNil(o.Name) { toSerialize["name"] = o.Name } - if o.Options != nil { + if !IsNil(o.Options) { toSerialize["options"] = o.Options } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableConfigSection struct { diff --git a/airflow/model_connection.go b/airflow/model_connection.go index 07f0563..ed4944f 100644 --- a/airflow/model_connection.go +++ b/airflow/model_connection.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,26 +15,29 @@ import ( "encoding/json" ) +// checks if the Connection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Connection{} + // Connection Full representation of the connection. type Connection struct { - // The connection ID. - ConnectionId *string `json:"connection_id,omitempty"` // The connection type. ConnType *string `json:"conn_type,omitempty"` + // The connection ID. + ConnectionId *string `json:"connection_id,omitempty"` // The description of the connection. Description NullableString `json:"description,omitempty"` // Host of the connection. Host NullableString `json:"host,omitempty"` // Login of the connection. Login NullableString `json:"login,omitempty"` - // Schema of the connection. - Schema NullableString `json:"schema,omitempty"` // Port of the connection. Port NullableInt32 `json:"port,omitempty"` - // Password of the connection. - Password *string `json:"password,omitempty"` + // Schema of the connection. + Schema NullableString `json:"schema,omitempty"` // Other values that cannot be put into another field, e.g. RSA keys. Extra NullableString `json:"extra,omitempty"` + // Password of the connection. + Password *string `json:"password,omitempty"` } // NewConnection instantiates a new Connection object @@ -71,73 +57,73 @@ func NewConnectionWithDefaults() *Connection { return &this } -// GetConnectionId returns the ConnectionId field value if set, zero value otherwise. -func (o *Connection) GetConnectionId() string { - if o == nil || o.ConnectionId == nil { +// GetConnType returns the ConnType field value if set, zero value otherwise. +func (o *Connection) GetConnType() string { + if o == nil || IsNil(o.ConnType) { var ret string return ret } - return *o.ConnectionId + return *o.ConnType } -// GetConnectionIdOk returns a tuple with the ConnectionId field value if set, nil otherwise +// GetConnTypeOk returns a tuple with the ConnType field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Connection) GetConnectionIdOk() (*string, bool) { - if o == nil || o.ConnectionId == nil { +func (o *Connection) GetConnTypeOk() (*string, bool) { + if o == nil || IsNil(o.ConnType) { return nil, false } - return o.ConnectionId, true + return o.ConnType, true } -// HasConnectionId returns a boolean if a field has been set. -func (o *Connection) HasConnectionId() bool { - if o != nil && o.ConnectionId != nil { +// HasConnType returns a boolean if a field has been set. +func (o *Connection) HasConnType() bool { + if o != nil && !IsNil(o.ConnType) { return true } return false } -// SetConnectionId gets a reference to the given string and assigns it to the ConnectionId field. -func (o *Connection) SetConnectionId(v string) { - o.ConnectionId = &v +// SetConnType gets a reference to the given string and assigns it to the ConnType field. +func (o *Connection) SetConnType(v string) { + o.ConnType = &v } -// GetConnType returns the ConnType field value if set, zero value otherwise. -func (o *Connection) GetConnType() string { - if o == nil || o.ConnType == nil { +// GetConnectionId returns the ConnectionId field value if set, zero value otherwise. +func (o *Connection) GetConnectionId() string { + if o == nil || IsNil(o.ConnectionId) { var ret string return ret } - return *o.ConnType + return *o.ConnectionId } -// GetConnTypeOk returns a tuple with the ConnType field value if set, nil otherwise +// GetConnectionIdOk returns a tuple with the ConnectionId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Connection) GetConnTypeOk() (*string, bool) { - if o == nil || o.ConnType == nil { +func (o *Connection) GetConnectionIdOk() (*string, bool) { + if o == nil || IsNil(o.ConnectionId) { return nil, false } - return o.ConnType, true + return o.ConnectionId, true } -// HasConnType returns a boolean if a field has been set. -func (o *Connection) HasConnType() bool { - if o != nil && o.ConnType != nil { +// HasConnectionId returns a boolean if a field has been set. +func (o *Connection) HasConnectionId() bool { + if o != nil && !IsNil(o.ConnectionId) { return true } return false } -// SetConnType gets a reference to the given string and assigns it to the ConnType field. -func (o *Connection) SetConnType(v string) { - o.ConnType = &v +// SetConnectionId gets a reference to the given string and assigns it to the ConnectionId field. +func (o *Connection) SetConnectionId(v string) { + o.ConnectionId = &v } // GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Connection) GetDescription() string { - if o == nil || o.Description.Get() == nil { + if o == nil || IsNil(o.Description.Get()) { var ret string return ret } @@ -148,7 +134,7 @@ func (o *Connection) GetDescription() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Connection) GetDescriptionOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Description.Get(), o.Description.IsSet() @@ -179,7 +165,7 @@ func (o *Connection) UnsetDescription() { // GetHost returns the Host field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Connection) GetHost() string { - if o == nil || o.Host.Get() == nil { + if o == nil || IsNil(o.Host.Get()) { var ret string return ret } @@ -190,7 +176,7 @@ func (o *Connection) GetHost() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Connection) GetHostOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Host.Get(), o.Host.IsSet() @@ -221,7 +207,7 @@ func (o *Connection) UnsetHost() { // GetLogin returns the Login field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Connection) GetLogin() string { - if o == nil || o.Login.Get() == nil { + if o == nil || IsNil(o.Login.Get()) { var ret string return ret } @@ -232,7 +218,7 @@ func (o *Connection) GetLogin() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Connection) GetLoginOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Login.Get(), o.Login.IsSet() @@ -261,51 +247,9 @@ func (o *Connection) UnsetLogin() { o.Login.Unset() } -// GetSchema returns the Schema field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Connection) GetSchema() string { - if o == nil || o.Schema.Get() == nil { - var ret string - return ret - } - return *o.Schema.Get() -} - -// GetSchemaOk returns a tuple with the Schema field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Connection) GetSchemaOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Schema.Get(), o.Schema.IsSet() -} - -// HasSchema returns a boolean if a field has been set. -func (o *Connection) HasSchema() bool { - if o != nil && o.Schema.IsSet() { - return true - } - - return false -} - -// SetSchema gets a reference to the given NullableString and assigns it to the Schema field. -func (o *Connection) SetSchema(v string) { - o.Schema.Set(&v) -} -// SetSchemaNil sets the value for Schema to be an explicit nil -func (o *Connection) SetSchemaNil() { - o.Schema.Set(nil) -} - -// UnsetSchema ensures that no value is present for Schema, not even an explicit nil -func (o *Connection) UnsetSchema() { - o.Schema.Unset() -} - // GetPort returns the Port field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Connection) GetPort() int32 { - if o == nil || o.Port.Get() == nil { + if o == nil || IsNil(o.Port.Get()) { var ret int32 return ret } @@ -316,7 +260,7 @@ func (o *Connection) GetPort() int32 { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Connection) GetPortOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return o.Port.Get(), o.Port.IsSet() @@ -345,41 +289,51 @@ func (o *Connection) UnsetPort() { o.Port.Unset() } -// GetPassword returns the Password field value if set, zero value otherwise. -func (o *Connection) GetPassword() string { - if o == nil || o.Password == nil { +// GetSchema returns the Schema field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Connection) GetSchema() string { + if o == nil || IsNil(o.Schema.Get()) { var ret string return ret } - return *o.Password + return *o.Schema.Get() } -// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// GetSchemaOk returns a tuple with the Schema field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Connection) GetPasswordOk() (*string, bool) { - if o == nil || o.Password == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Connection) GetSchemaOk() (*string, bool) { + if o == nil { return nil, false } - return o.Password, true + return o.Schema.Get(), o.Schema.IsSet() } -// HasPassword returns a boolean if a field has been set. -func (o *Connection) HasPassword() bool { - if o != nil && o.Password != nil { +// HasSchema returns a boolean if a field has been set. +func (o *Connection) HasSchema() bool { + if o != nil && o.Schema.IsSet() { return true } return false } -// SetPassword gets a reference to the given string and assigns it to the Password field. -func (o *Connection) SetPassword(v string) { - o.Password = &v +// SetSchema gets a reference to the given NullableString and assigns it to the Schema field. +func (o *Connection) SetSchema(v string) { + o.Schema.Set(&v) +} +// SetSchemaNil sets the value for Schema to be an explicit nil +func (o *Connection) SetSchemaNil() { + o.Schema.Set(nil) +} + +// UnsetSchema ensures that no value is present for Schema, not even an explicit nil +func (o *Connection) UnsetSchema() { + o.Schema.Unset() } // GetExtra returns the Extra field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Connection) GetExtra() string { - if o == nil || o.Extra.Get() == nil { + if o == nil || IsNil(o.Extra.Get()) { var ret string return ret } @@ -390,7 +344,7 @@ func (o *Connection) GetExtra() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Connection) GetExtraOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Extra.Get(), o.Extra.IsSet() @@ -419,14 +373,54 @@ func (o *Connection) UnsetExtra() { o.Extra.Unset() } +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *Connection) GetPassword() string { + if o == nil || IsNil(o.Password) { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Connection) GetPasswordOk() (*string, bool) { + if o == nil || IsNil(o.Password) { + return nil, false + } + return o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *Connection) HasPassword() bool { + if o != nil && !IsNil(o.Password) { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *Connection) SetPassword(v string) { + o.Password = &v +} + func (o Connection) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.ConnectionId != nil { - toSerialize["connection_id"] = o.ConnectionId + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.ConnType != nil { + return json.Marshal(toSerialize) +} + +func (o Connection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ConnType) { toSerialize["conn_type"] = o.ConnType } + if !IsNil(o.ConnectionId) { + toSerialize["connection_id"] = o.ConnectionId + } if o.Description.IsSet() { toSerialize["description"] = o.Description.Get() } @@ -436,19 +430,19 @@ func (o Connection) MarshalJSON() ([]byte, error) { if o.Login.IsSet() { toSerialize["login"] = o.Login.Get() } - if o.Schema.IsSet() { - toSerialize["schema"] = o.Schema.Get() - } if o.Port.IsSet() { toSerialize["port"] = o.Port.Get() } - if o.Password != nil { - toSerialize["password"] = o.Password + if o.Schema.IsSet() { + toSerialize["schema"] = o.Schema.Get() } if o.Extra.IsSet() { toSerialize["extra"] = o.Extra.Get() } - return json.Marshal(toSerialize) + if !IsNil(o.Password) { + toSerialize["password"] = o.Password + } + return toSerialize, nil } type NullableConnection struct { diff --git a/airflow/model_connection_collection.go b/airflow/model_connection_collection.go index e7cf6da..70c56c4 100644 --- a/airflow/model_connection_collection.go +++ b/airflow/model_connection_collection.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,11 +15,14 @@ import ( "encoding/json" ) +// checks if the ConnectionCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConnectionCollection{} + // ConnectionCollection Collection of connections. *Changed in version 2.1.0*: 'total_entries' field is added. type ConnectionCollection struct { - Connections *[]ConnectionCollectionItem `json:"connections,omitempty"` - // Count of objects in the current result set. + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. TotalEntries *int32 `json:"total_entries,omitempty"` + Connections []ConnectionCollectionItem `json:"connections,omitempty"` } // NewConnectionCollection instantiates a new ConnectionCollection object @@ -56,79 +42,87 @@ func NewConnectionCollectionWithDefaults() *ConnectionCollection { return &this } -// GetConnections returns the Connections field value if set, zero value otherwise. -func (o *ConnectionCollection) GetConnections() []ConnectionCollectionItem { - if o == nil || o.Connections == nil { - var ret []ConnectionCollectionItem +// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. +func (o *ConnectionCollection) GetTotalEntries() int32 { + if o == nil || IsNil(o.TotalEntries) { + var ret int32 return ret } - return *o.Connections + return *o.TotalEntries } -// GetConnectionsOk returns a tuple with the Connections field value if set, nil otherwise +// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ConnectionCollection) GetConnectionsOk() (*[]ConnectionCollectionItem, bool) { - if o == nil || o.Connections == nil { +func (o *ConnectionCollection) GetTotalEntriesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalEntries) { return nil, false } - return o.Connections, true + return o.TotalEntries, true } -// HasConnections returns a boolean if a field has been set. -func (o *ConnectionCollection) HasConnections() bool { - if o != nil && o.Connections != nil { +// HasTotalEntries returns a boolean if a field has been set. +func (o *ConnectionCollection) HasTotalEntries() bool { + if o != nil && !IsNil(o.TotalEntries) { return true } return false } -// SetConnections gets a reference to the given []ConnectionCollectionItem and assigns it to the Connections field. -func (o *ConnectionCollection) SetConnections(v []ConnectionCollectionItem) { - o.Connections = &v +// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. +func (o *ConnectionCollection) SetTotalEntries(v int32) { + o.TotalEntries = &v } -// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. -func (o *ConnectionCollection) GetTotalEntries() int32 { - if o == nil || o.TotalEntries == nil { - var ret int32 +// GetConnections returns the Connections field value if set, zero value otherwise. +func (o *ConnectionCollection) GetConnections() []ConnectionCollectionItem { + if o == nil || IsNil(o.Connections) { + var ret []ConnectionCollectionItem return ret } - return *o.TotalEntries + return o.Connections } -// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise +// GetConnectionsOk returns a tuple with the Connections field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ConnectionCollection) GetTotalEntriesOk() (*int32, bool) { - if o == nil || o.TotalEntries == nil { +func (o *ConnectionCollection) GetConnectionsOk() ([]ConnectionCollectionItem, bool) { + if o == nil || IsNil(o.Connections) { return nil, false } - return o.TotalEntries, true + return o.Connections, true } -// HasTotalEntries returns a boolean if a field has been set. -func (o *ConnectionCollection) HasTotalEntries() bool { - if o != nil && o.TotalEntries != nil { +// HasConnections returns a boolean if a field has been set. +func (o *ConnectionCollection) HasConnections() bool { + if o != nil && !IsNil(o.Connections) { return true } return false } -// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. -func (o *ConnectionCollection) SetTotalEntries(v int32) { - o.TotalEntries = &v +// SetConnections gets a reference to the given []ConnectionCollectionItem and assigns it to the Connections field. +func (o *ConnectionCollection) SetConnections(v []ConnectionCollectionItem) { + o.Connections = v } func (o ConnectionCollection) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Connections != nil { - toSerialize["connections"] = o.Connections + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.TotalEntries != nil { + return json.Marshal(toSerialize) +} + +func (o ConnectionCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalEntries) { toSerialize["total_entries"] = o.TotalEntries } - return json.Marshal(toSerialize) + if !IsNil(o.Connections) { + toSerialize["connections"] = o.Connections + } + return toSerialize, nil } type NullableConnectionCollection struct { diff --git a/airflow/model_connection_collection_item.go b/airflow/model_connection_collection_item.go index 4f7be22..b303575 100644 --- a/airflow/model_connection_collection_item.go +++ b/airflow/model_connection_collection_item.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,22 +15,25 @@ import ( "encoding/json" ) +// checks if the ConnectionCollectionItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConnectionCollectionItem{} + // ConnectionCollectionItem Connection collection item. The password and extra fields are only available when retrieving a single object due to the sensitivity of this data. type ConnectionCollectionItem struct { - // The connection ID. - ConnectionId *string `json:"connection_id,omitempty"` // The connection type. ConnType *string `json:"conn_type,omitempty"` + // The connection ID. + ConnectionId *string `json:"connection_id,omitempty"` // The description of the connection. Description NullableString `json:"description,omitempty"` // Host of the connection. Host NullableString `json:"host,omitempty"` // Login of the connection. Login NullableString `json:"login,omitempty"` - // Schema of the connection. - Schema NullableString `json:"schema,omitempty"` // Port of the connection. Port NullableInt32 `json:"port,omitempty"` + // Schema of the connection. + Schema NullableString `json:"schema,omitempty"` } // NewConnectionCollectionItem instantiates a new ConnectionCollectionItem object @@ -67,73 +53,73 @@ func NewConnectionCollectionItemWithDefaults() *ConnectionCollectionItem { return &this } -// GetConnectionId returns the ConnectionId field value if set, zero value otherwise. -func (o *ConnectionCollectionItem) GetConnectionId() string { - if o == nil || o.ConnectionId == nil { +// GetConnType returns the ConnType field value if set, zero value otherwise. +func (o *ConnectionCollectionItem) GetConnType() string { + if o == nil || IsNil(o.ConnType) { var ret string return ret } - return *o.ConnectionId + return *o.ConnType } -// GetConnectionIdOk returns a tuple with the ConnectionId field value if set, nil otherwise +// GetConnTypeOk returns a tuple with the ConnType field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ConnectionCollectionItem) GetConnectionIdOk() (*string, bool) { - if o == nil || o.ConnectionId == nil { +func (o *ConnectionCollectionItem) GetConnTypeOk() (*string, bool) { + if o == nil || IsNil(o.ConnType) { return nil, false } - return o.ConnectionId, true + return o.ConnType, true } -// HasConnectionId returns a boolean if a field has been set. -func (o *ConnectionCollectionItem) HasConnectionId() bool { - if o != nil && o.ConnectionId != nil { +// HasConnType returns a boolean if a field has been set. +func (o *ConnectionCollectionItem) HasConnType() bool { + if o != nil && !IsNil(o.ConnType) { return true } return false } -// SetConnectionId gets a reference to the given string and assigns it to the ConnectionId field. -func (o *ConnectionCollectionItem) SetConnectionId(v string) { - o.ConnectionId = &v +// SetConnType gets a reference to the given string and assigns it to the ConnType field. +func (o *ConnectionCollectionItem) SetConnType(v string) { + o.ConnType = &v } -// GetConnType returns the ConnType field value if set, zero value otherwise. -func (o *ConnectionCollectionItem) GetConnType() string { - if o == nil || o.ConnType == nil { +// GetConnectionId returns the ConnectionId field value if set, zero value otherwise. +func (o *ConnectionCollectionItem) GetConnectionId() string { + if o == nil || IsNil(o.ConnectionId) { var ret string return ret } - return *o.ConnType + return *o.ConnectionId } -// GetConnTypeOk returns a tuple with the ConnType field value if set, nil otherwise +// GetConnectionIdOk returns a tuple with the ConnectionId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ConnectionCollectionItem) GetConnTypeOk() (*string, bool) { - if o == nil || o.ConnType == nil { +func (o *ConnectionCollectionItem) GetConnectionIdOk() (*string, bool) { + if o == nil || IsNil(o.ConnectionId) { return nil, false } - return o.ConnType, true + return o.ConnectionId, true } -// HasConnType returns a boolean if a field has been set. -func (o *ConnectionCollectionItem) HasConnType() bool { - if o != nil && o.ConnType != nil { +// HasConnectionId returns a boolean if a field has been set. +func (o *ConnectionCollectionItem) HasConnectionId() bool { + if o != nil && !IsNil(o.ConnectionId) { return true } return false } -// SetConnType gets a reference to the given string and assigns it to the ConnType field. -func (o *ConnectionCollectionItem) SetConnType(v string) { - o.ConnType = &v +// SetConnectionId gets a reference to the given string and assigns it to the ConnectionId field. +func (o *ConnectionCollectionItem) SetConnectionId(v string) { + o.ConnectionId = &v } // GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConnectionCollectionItem) GetDescription() string { - if o == nil || o.Description.Get() == nil { + if o == nil || IsNil(o.Description.Get()) { var ret string return ret } @@ -144,7 +130,7 @@ func (o *ConnectionCollectionItem) GetDescription() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConnectionCollectionItem) GetDescriptionOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Description.Get(), o.Description.IsSet() @@ -175,7 +161,7 @@ func (o *ConnectionCollectionItem) UnsetDescription() { // GetHost returns the Host field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConnectionCollectionItem) GetHost() string { - if o == nil || o.Host.Get() == nil { + if o == nil || IsNil(o.Host.Get()) { var ret string return ret } @@ -186,7 +172,7 @@ func (o *ConnectionCollectionItem) GetHost() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConnectionCollectionItem) GetHostOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Host.Get(), o.Host.IsSet() @@ -217,7 +203,7 @@ func (o *ConnectionCollectionItem) UnsetHost() { // GetLogin returns the Login field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ConnectionCollectionItem) GetLogin() string { - if o == nil || o.Login.Get() == nil { + if o == nil || IsNil(o.Login.Get()) { var ret string return ret } @@ -228,7 +214,7 @@ func (o *ConnectionCollectionItem) GetLogin() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *ConnectionCollectionItem) GetLoginOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Login.Get(), o.Login.IsSet() @@ -257,98 +243,106 @@ func (o *ConnectionCollectionItem) UnsetLogin() { o.Login.Unset() } -// GetSchema returns the Schema field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ConnectionCollectionItem) GetSchema() string { - if o == nil || o.Schema.Get() == nil { - var ret string +// GetPort returns the Port field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConnectionCollectionItem) GetPort() int32 { + if o == nil || IsNil(o.Port.Get()) { + var ret int32 return ret } - return *o.Schema.Get() + return *o.Port.Get() } -// GetSchemaOk returns a tuple with the Schema field value if set, nil otherwise +// GetPortOk returns a tuple with the Port field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ConnectionCollectionItem) GetSchemaOk() (*string, bool) { - if o == nil { +func (o *ConnectionCollectionItem) GetPortOk() (*int32, bool) { + if o == nil { return nil, false } - return o.Schema.Get(), o.Schema.IsSet() + return o.Port.Get(), o.Port.IsSet() } -// HasSchema returns a boolean if a field has been set. -func (o *ConnectionCollectionItem) HasSchema() bool { - if o != nil && o.Schema.IsSet() { +// HasPort returns a boolean if a field has been set. +func (o *ConnectionCollectionItem) HasPort() bool { + if o != nil && o.Port.IsSet() { return true } return false } -// SetSchema gets a reference to the given NullableString and assigns it to the Schema field. -func (o *ConnectionCollectionItem) SetSchema(v string) { - o.Schema.Set(&v) +// SetPort gets a reference to the given NullableInt32 and assigns it to the Port field. +func (o *ConnectionCollectionItem) SetPort(v int32) { + o.Port.Set(&v) } -// SetSchemaNil sets the value for Schema to be an explicit nil -func (o *ConnectionCollectionItem) SetSchemaNil() { - o.Schema.Set(nil) +// SetPortNil sets the value for Port to be an explicit nil +func (o *ConnectionCollectionItem) SetPortNil() { + o.Port.Set(nil) } -// UnsetSchema ensures that no value is present for Schema, not even an explicit nil -func (o *ConnectionCollectionItem) UnsetSchema() { - o.Schema.Unset() +// UnsetPort ensures that no value is present for Port, not even an explicit nil +func (o *ConnectionCollectionItem) UnsetPort() { + o.Port.Unset() } -// GetPort returns the Port field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *ConnectionCollectionItem) GetPort() int32 { - if o == nil || o.Port.Get() == nil { - var ret int32 +// GetSchema returns the Schema field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ConnectionCollectionItem) GetSchema() string { + if o == nil || IsNil(o.Schema.Get()) { + var ret string return ret } - return *o.Port.Get() + return *o.Schema.Get() } -// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// GetSchemaOk returns a tuple with the Schema field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *ConnectionCollectionItem) GetPortOk() (*int32, bool) { - if o == nil { +func (o *ConnectionCollectionItem) GetSchemaOk() (*string, bool) { + if o == nil { return nil, false } - return o.Port.Get(), o.Port.IsSet() + return o.Schema.Get(), o.Schema.IsSet() } -// HasPort returns a boolean if a field has been set. -func (o *ConnectionCollectionItem) HasPort() bool { - if o != nil && o.Port.IsSet() { +// HasSchema returns a boolean if a field has been set. +func (o *ConnectionCollectionItem) HasSchema() bool { + if o != nil && o.Schema.IsSet() { return true } return false } -// SetPort gets a reference to the given NullableInt32 and assigns it to the Port field. -func (o *ConnectionCollectionItem) SetPort(v int32) { - o.Port.Set(&v) +// SetSchema gets a reference to the given NullableString and assigns it to the Schema field. +func (o *ConnectionCollectionItem) SetSchema(v string) { + o.Schema.Set(&v) } -// SetPortNil sets the value for Port to be an explicit nil -func (o *ConnectionCollectionItem) SetPortNil() { - o.Port.Set(nil) +// SetSchemaNil sets the value for Schema to be an explicit nil +func (o *ConnectionCollectionItem) SetSchemaNil() { + o.Schema.Set(nil) } -// UnsetPort ensures that no value is present for Port, not even an explicit nil -func (o *ConnectionCollectionItem) UnsetPort() { - o.Port.Unset() +// UnsetSchema ensures that no value is present for Schema, not even an explicit nil +func (o *ConnectionCollectionItem) UnsetSchema() { + o.Schema.Unset() } func (o ConnectionCollectionItem) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.ConnectionId != nil { - toSerialize["connection_id"] = o.ConnectionId + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.ConnType != nil { + return json.Marshal(toSerialize) +} + +func (o ConnectionCollectionItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ConnType) { toSerialize["conn_type"] = o.ConnType } + if !IsNil(o.ConnectionId) { + toSerialize["connection_id"] = o.ConnectionId + } if o.Description.IsSet() { toSerialize["description"] = o.Description.Get() } @@ -358,13 +352,13 @@ func (o ConnectionCollectionItem) MarshalJSON() ([]byte, error) { if o.Login.IsSet() { toSerialize["login"] = o.Login.Get() } - if o.Schema.IsSet() { - toSerialize["schema"] = o.Schema.Get() - } if o.Port.IsSet() { toSerialize["port"] = o.Port.Get() } - return json.Marshal(toSerialize) + if o.Schema.IsSet() { + toSerialize["schema"] = o.Schema.Get() + } + return toSerialize, nil } type NullableConnectionCollectionItem struct { diff --git a/airflow/model_connection_test_.go b/airflow/model_connection_test_.go index 2ef8345..f57dc69 100644 --- a/airflow/model_connection_test_.go +++ b/airflow/model_connection_test_.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,12 +15,15 @@ import ( "encoding/json" ) +// checks if the ConnectionTest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConnectionTest{} + // ConnectionTest Connection test results. *New in version 2.2.0* type ConnectionTest struct { - // The status of the request. - Status *bool `json:"status,omitempty"` // The success or failure message of the request. Message *string `json:"message,omitempty"` + // The status of the request. + Status *bool `json:"status,omitempty"` } // NewConnectionTest instantiates a new ConnectionTest object @@ -57,79 +43,87 @@ func NewConnectionTestWithDefaults() *ConnectionTest { return &this } -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *ConnectionTest) GetStatus() bool { - if o == nil || o.Status == nil { - var ret bool +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *ConnectionTest) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string return ret } - return *o.Status + return *o.Message } -// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ConnectionTest) GetStatusOk() (*bool, bool) { - if o == nil || o.Status == nil { +func (o *ConnectionTest) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { return nil, false } - return o.Status, true + return o.Message, true } -// HasStatus returns a boolean if a field has been set. -func (o *ConnectionTest) HasStatus() bool { - if o != nil && o.Status != nil { +// HasMessage returns a boolean if a field has been set. +func (o *ConnectionTest) HasMessage() bool { + if o != nil && !IsNil(o.Message) { return true } return false } -// SetStatus gets a reference to the given bool and assigns it to the Status field. -func (o *ConnectionTest) SetStatus(v bool) { - o.Status = &v +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *ConnectionTest) SetMessage(v string) { + o.Message = &v } -// GetMessage returns the Message field value if set, zero value otherwise. -func (o *ConnectionTest) GetMessage() string { - if o == nil || o.Message == nil { - var ret string +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *ConnectionTest) GetStatus() bool { + if o == nil || IsNil(o.Status) { + var ret bool return ret } - return *o.Message + return *o.Status } -// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ConnectionTest) GetMessageOk() (*string, bool) { - if o == nil || o.Message == nil { +func (o *ConnectionTest) GetStatusOk() (*bool, bool) { + if o == nil || IsNil(o.Status) { return nil, false } - return o.Message, true + return o.Status, true } -// HasMessage returns a boolean if a field has been set. -func (o *ConnectionTest) HasMessage() bool { - if o != nil && o.Message != nil { +// HasStatus returns a boolean if a field has been set. +func (o *ConnectionTest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { return true } return false } -// SetMessage gets a reference to the given string and assigns it to the Message field. -func (o *ConnectionTest) SetMessage(v string) { - o.Message = &v +// SetStatus gets a reference to the given bool and assigns it to the Status field. +func (o *ConnectionTest) SetStatus(v bool) { + o.Status = &v } func (o ConnectionTest) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Status != nil { - toSerialize["status"] = o.Status + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.Message != nil { + return json.Marshal(toSerialize) +} + +func (o ConnectionTest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Message) { toSerialize["message"] = o.Message } - return json.Marshal(toSerialize) + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + return toSerialize, nil } type NullableConnectionTest struct { diff --git a/airflow/model_create_dataset_event.go b/airflow/model_create_dataset_event.go new file mode 100644 index 0000000..48be61a --- /dev/null +++ b/airflow/model_create_dataset_event.go @@ -0,0 +1,198 @@ +/* +Airflow API (Stable) + +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. + +API version: 2.10.5 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package airflow + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the CreateDatasetEvent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateDatasetEvent{} + +// CreateDatasetEvent struct for CreateDatasetEvent +type CreateDatasetEvent struct { + // The URI of the dataset + DatasetUri string `json:"dataset_uri"` + // The dataset event extra + Extra map[string]interface{} `json:"extra,omitempty"` +} + +type _CreateDatasetEvent CreateDatasetEvent + +// NewCreateDatasetEvent instantiates a new CreateDatasetEvent object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateDatasetEvent(datasetUri string) *CreateDatasetEvent { + this := CreateDatasetEvent{} + this.DatasetUri = datasetUri + return &this +} + +// NewCreateDatasetEventWithDefaults instantiates a new CreateDatasetEvent object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateDatasetEventWithDefaults() *CreateDatasetEvent { + this := CreateDatasetEvent{} + return &this +} + +// GetDatasetUri returns the DatasetUri field value +func (o *CreateDatasetEvent) GetDatasetUri() string { + if o == nil { + var ret string + return ret + } + + return o.DatasetUri +} + +// GetDatasetUriOk returns a tuple with the DatasetUri field value +// and a boolean to check if the value has been set. +func (o *CreateDatasetEvent) GetDatasetUriOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DatasetUri, true +} + +// SetDatasetUri sets field value +func (o *CreateDatasetEvent) SetDatasetUri(v string) { + o.DatasetUri = v +} + +// GetExtra returns the Extra field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateDatasetEvent) GetExtra() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Extra +} + +// GetExtraOk returns a tuple with the Extra field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateDatasetEvent) GetExtraOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Extra) { + return map[string]interface{}{}, false + } + return o.Extra, true +} + +// HasExtra returns a boolean if a field has been set. +func (o *CreateDatasetEvent) HasExtra() bool { + if o != nil && !IsNil(o.Extra) { + return true + } + + return false +} + +// SetExtra gets a reference to the given map[string]interface{} and assigns it to the Extra field. +func (o *CreateDatasetEvent) SetExtra(v map[string]interface{}) { + o.Extra = v +} + +func (o CreateDatasetEvent) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateDatasetEvent) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["dataset_uri"] = o.DatasetUri + if o.Extra != nil { + toSerialize["extra"] = o.Extra + } + return toSerialize, nil +} + +func (o *CreateDatasetEvent) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "dataset_uri", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateDatasetEvent := _CreateDatasetEvent{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateDatasetEvent) + + if err != nil { + return err + } + + *o = CreateDatasetEvent(varCreateDatasetEvent) + + return err +} + +type NullableCreateDatasetEvent struct { + value *CreateDatasetEvent + isSet bool +} + +func (v NullableCreateDatasetEvent) Get() *CreateDatasetEvent { + return v.value +} + +func (v *NullableCreateDatasetEvent) Set(val *CreateDatasetEvent) { + v.value = val + v.isSet = true +} + +func (v NullableCreateDatasetEvent) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateDatasetEvent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateDatasetEvent(val *CreateDatasetEvent) *NullableCreateDatasetEvent { + return &NullableCreateDatasetEvent{value: val, isSet: true} +} + +func (v NullableCreateDatasetEvent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateDatasetEvent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/model_cron_expression.go b/airflow/model_cron_expression.go index 17d3e98..b608cf3 100644 --- a/airflow/model_cron_expression.go +++ b/airflow/model_cron_expression.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -30,14 +13,21 @@ package airflow import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the CronExpression type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CronExpression{} + // CronExpression Cron expression type CronExpression struct { Type string `json:"__type"` Value string `json:"value"` } +type _CronExpression CronExpression + // NewCronExpression instantiates a new CronExpression object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -70,7 +60,7 @@ func (o *CronExpression) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *CronExpression) GetTypeOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Type, true @@ -94,7 +84,7 @@ func (o *CronExpression) GetValue() string { // GetValueOk returns a tuple with the Value field value // and a boolean to check if the value has been set. func (o *CronExpression) GetValueOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Value, true @@ -106,14 +96,56 @@ func (o *CronExpression) SetValue(v string) { } func (o CronExpression) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CronExpression) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["__type"] = o.Type + toSerialize["__type"] = o.Type + toSerialize["value"] = o.Value + return toSerialize, nil +} + +func (o *CronExpression) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "__type", + "value", } - if true { - toSerialize["value"] = o.Value + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - return json.Marshal(toSerialize) + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCronExpression := _CronExpression{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCronExpression) + + if err != nil { + return err + } + + *o = CronExpression(varCronExpression) + + return err } type NullableCronExpression struct { diff --git a/airflow/model_dag.go b/airflow/model_dag.go index ea830f0..590ab0a 100644 --- a/airflow/model_dag.go +++ b/airflow/model_dag.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -33,58 +16,65 @@ import ( "time" ) +// checks if the DAG type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DAG{} + // DAG DAG type DAG struct { + // Human centric display text for the DAG. *New in version 2.9.0* + DagDisplayName *string `json:"dag_display_name,omitempty"` // The ID of the DAG. DagId *string `json:"dag_id,omitempty"` - // If the DAG is SubDAG then it is the top level DAG identifier. Otherwise, null. - RootDagId NullableString `json:"root_dag_id,omitempty"` - // Whether the DAG is paused. - IsPaused NullableBool `json:"is_paused,omitempty"` + // Default view of the DAG inside the webserver *New in version 2.3.0* + DefaultView NullableString `json:"default_view,omitempty"` + // User-provided DAG description, which can consist of several sentences or paragraphs that describe DAG contents. + Description NullableString `json:"description,omitempty"` + // The key containing the encrypted path to the file. Encryption and decryption take place only on the server. This prevents the client from reading an non-DAG file. This also ensures API extensibility, because the format of encrypted data may change. + FileToken *string `json:"file_token,omitempty"` + // The absolute path to the file. + Fileloc *string `json:"fileloc,omitempty"` + // Whether the DAG has import errors *New in version 2.3.0* + HasImportErrors NullableBool `json:"has_import_errors,omitempty"` + // Whether the DAG has task concurrency limits *New in version 2.3.0* + HasTaskConcurrencyLimits NullableBool `json:"has_task_concurrency_limits,omitempty"` // Whether the DAG is currently seen by the scheduler(s). *New in version 2.1.1* *Changed in version 2.2.0*: Field is read-only. IsActive NullableBool `json:"is_active,omitempty"` + // Whether the DAG is paused. + IsPaused NullableBool `json:"is_paused,omitempty"` // Whether the DAG is SubDAG. IsSubdag *bool `json:"is_subdag,omitempty"` + // Time when the DAG last received a refresh signal (e.g. the DAG's \"refresh\" button was clicked in the web UI) *New in version 2.3.0* + LastExpired NullableTime `json:"last_expired,omitempty"` // The last time the DAG was parsed. *New in version 2.3.0* LastParsedTime NullableTime `json:"last_parsed_time,omitempty"` // The last time the DAG was pickled. *New in version 2.3.0* LastPickled NullableTime `json:"last_pickled,omitempty"` - // Time when the DAG last received a refresh signal (e.g. the DAG's \"refresh\" button was clicked in the web UI) *New in version 2.3.0* - LastExpired NullableTime `json:"last_expired,omitempty"` - // Whether (one of) the scheduler is scheduling this DAG at the moment *New in version 2.3.0* - SchedulerLock NullableBool `json:"scheduler_lock,omitempty"` - // Foreign key to the latest pickle_id *New in version 2.3.0* - PickleId NullableString `json:"pickle_id,omitempty"` - // Default view of the DAG inside the webserver *New in version 2.3.0* - DefaultView NullableString `json:"default_view,omitempty"` - // The absolute path to the file. - Fileloc *string `json:"fileloc,omitempty"` - // The key containing the encrypted path to the file. Encryption and decryption take place only on the server. This prevents the client from reading an non-DAG file. This also ensures API extensibility, because the format of encrypted data may change. - FileToken *string `json:"file_token,omitempty"` - Owners *[]string `json:"owners,omitempty"` - // User-provided DAG description, which can consist of several sentences or paragraphs that describe DAG contents. - Description NullableString `json:"description,omitempty"` - ScheduleInterval NullableScheduleInterval `json:"schedule_interval,omitempty"` - // Timetable/Schedule Interval description. *New in version 2.3.0* - TimetableDescription NullableString `json:"timetable_description,omitempty"` - // List of tags. - Tags []Tag `json:"tags,omitempty"` - // Maximum number of active tasks that can be run on the DAG *New in version 2.3.0* - MaxActiveTasks NullableInt32 `json:"max_active_tasks,omitempty"` // Maximum number of active DAG runs for the DAG *New in version 2.3.0* MaxActiveRuns NullableInt32 `json:"max_active_runs,omitempty"` - // Whether the DAG has task concurrency limits *New in version 2.3.0* - HasTaskConcurrencyLimits NullableBool `json:"has_task_concurrency_limits,omitempty"` - // Whether the DAG has import errors *New in version 2.3.0* - HasImportErrors NullableBool `json:"has_import_errors,omitempty"` + // Maximum number of active tasks that can be run on the DAG *New in version 2.3.0* + MaxActiveTasks NullableInt32 `json:"max_active_tasks,omitempty"` + // (experimental) The maximum number of consecutive DAG failures before DAG is automatically paused. *New in version 2.9.0* + MaxConsecutiveFailedDagRuns NullableInt32 `json:"max_consecutive_failed_dag_runs,omitempty"` // The logical date of the next dag run. *New in version 2.3.0* NextDagrun NullableTime `json:"next_dagrun,omitempty"` - // The start of the interval of the next dag run. *New in version 2.3.0* - NextDagrunDataIntervalStart NullableTime `json:"next_dagrun_data_interval_start,omitempty"` - // The end of the interval of the next dag run. *New in version 2.3.0* - NextDagrunDataIntervalEnd NullableTime `json:"next_dagrun_data_interval_end,omitempty"` // Earliest time at which this ``next_dagrun`` can be created. *New in version 2.3.0* NextDagrunCreateAfter NullableTime `json:"next_dagrun_create_after,omitempty"` + // The end of the interval of the next dag run. *New in version 2.3.0* + NextDagrunDataIntervalEnd NullableTime `json:"next_dagrun_data_interval_end,omitempty"` + // The start of the interval of the next dag run. *New in version 2.3.0* + NextDagrunDataIntervalStart NullableTime `json:"next_dagrun_data_interval_start,omitempty"` + Owners []string `json:"owners,omitempty"` + // Foreign key to the latest pickle_id *New in version 2.3.0* + PickleId NullableString `json:"pickle_id,omitempty"` + // If the DAG is SubDAG then it is the top level DAG identifier. Otherwise, null. + RootDagId NullableString `json:"root_dag_id,omitempty"` + ScheduleInterval NullableScheduleInterval `json:"schedule_interval,omitempty"` + // Whether (one of) the scheduler is scheduling this DAG at the moment *New in version 2.3.0* + SchedulerLock NullableBool `json:"scheduler_lock,omitempty"` + // List of tags. + Tags []Tag `json:"tags,omitempty"` + // Timetable/Schedule Interval description. *New in version 2.3.0* + TimetableDescription NullableString `json:"timetable_description,omitempty"` } // NewDAG instantiates a new DAG object @@ -104,9 +94,41 @@ func NewDAGWithDefaults() *DAG { return &this } +// GetDagDisplayName returns the DagDisplayName field value if set, zero value otherwise. +func (o *DAG) GetDagDisplayName() string { + if o == nil || IsNil(o.DagDisplayName) { + var ret string + return ret + } + return *o.DagDisplayName +} + +// GetDagDisplayNameOk returns a tuple with the DagDisplayName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DAG) GetDagDisplayNameOk() (*string, bool) { + if o == nil || IsNil(o.DagDisplayName) { + return nil, false + } + return o.DagDisplayName, true +} + +// HasDagDisplayName returns a boolean if a field has been set. +func (o *DAG) HasDagDisplayName() bool { + if o != nil && !IsNil(o.DagDisplayName) { + return true + } + + return false +} + +// SetDagDisplayName gets a reference to the given string and assigns it to the DagDisplayName field. +func (o *DAG) SetDagDisplayName(v string) { + o.DagDisplayName = &v +} + // GetDagId returns the DagId field value if set, zero value otherwise. func (o *DAG) GetDagId() string { - if o == nil || o.DagId == nil { + if o == nil || IsNil(o.DagId) { var ret string return ret } @@ -116,7 +138,7 @@ func (o *DAG) GetDagId() string { // GetDagIdOk returns a tuple with the DagId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *DAG) GetDagIdOk() (*string, bool) { - if o == nil || o.DagId == nil { + if o == nil || IsNil(o.DagId) { return nil, false } return o.DagId, true @@ -124,7 +146,7 @@ func (o *DAG) GetDagIdOk() (*string, bool) { // HasDagId returns a boolean if a field has been set. func (o *DAG) HasDagId() bool { - if o != nil && o.DagId != nil { + if o != nil && !IsNil(o.DagId) { return true } @@ -136,1088 +158,1144 @@ func (o *DAG) SetDagId(v string) { o.DagId = &v } -// GetRootDagId returns the RootDagId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAG) GetRootDagId() string { - if o == nil || o.RootDagId.Get() == nil { +// GetDefaultView returns the DefaultView field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAG) GetDefaultView() string { + if o == nil || IsNil(o.DefaultView.Get()) { var ret string return ret } - return *o.RootDagId.Get() + return *o.DefaultView.Get() } -// GetRootDagIdOk returns a tuple with the RootDagId field value if set, nil otherwise +// GetDefaultViewOk returns a tuple with the DefaultView field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAG) GetRootDagIdOk() (*string, bool) { - if o == nil { +func (o *DAG) GetDefaultViewOk() (*string, bool) { + if o == nil { return nil, false } - return o.RootDagId.Get(), o.RootDagId.IsSet() + return o.DefaultView.Get(), o.DefaultView.IsSet() } -// HasRootDagId returns a boolean if a field has been set. -func (o *DAG) HasRootDagId() bool { - if o != nil && o.RootDagId.IsSet() { +// HasDefaultView returns a boolean if a field has been set. +func (o *DAG) HasDefaultView() bool { + if o != nil && o.DefaultView.IsSet() { return true } return false } -// SetRootDagId gets a reference to the given NullableString and assigns it to the RootDagId field. -func (o *DAG) SetRootDagId(v string) { - o.RootDagId.Set(&v) +// SetDefaultView gets a reference to the given NullableString and assigns it to the DefaultView field. +func (o *DAG) SetDefaultView(v string) { + o.DefaultView.Set(&v) } -// SetRootDagIdNil sets the value for RootDagId to be an explicit nil -func (o *DAG) SetRootDagIdNil() { - o.RootDagId.Set(nil) +// SetDefaultViewNil sets the value for DefaultView to be an explicit nil +func (o *DAG) SetDefaultViewNil() { + o.DefaultView.Set(nil) } -// UnsetRootDagId ensures that no value is present for RootDagId, not even an explicit nil -func (o *DAG) UnsetRootDagId() { - o.RootDagId.Unset() +// UnsetDefaultView ensures that no value is present for DefaultView, not even an explicit nil +func (o *DAG) UnsetDefaultView() { + o.DefaultView.Unset() } -// GetIsPaused returns the IsPaused field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAG) GetIsPaused() bool { - if o == nil || o.IsPaused.Get() == nil { - var ret bool +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAG) GetDescription() string { + if o == nil || IsNil(o.Description.Get()) { + var ret string return ret } - return *o.IsPaused.Get() + return *o.Description.Get() } -// GetIsPausedOk returns a tuple with the IsPaused field value if set, nil otherwise +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAG) GetIsPausedOk() (*bool, bool) { - if o == nil { +func (o *DAG) GetDescriptionOk() (*string, bool) { + if o == nil { return nil, false } - return o.IsPaused.Get(), o.IsPaused.IsSet() + return o.Description.Get(), o.Description.IsSet() } -// HasIsPaused returns a boolean if a field has been set. -func (o *DAG) HasIsPaused() bool { - if o != nil && o.IsPaused.IsSet() { +// HasDescription returns a boolean if a field has been set. +func (o *DAG) HasDescription() bool { + if o != nil && o.Description.IsSet() { return true } return false } -// SetIsPaused gets a reference to the given NullableBool and assigns it to the IsPaused field. -func (o *DAG) SetIsPaused(v bool) { - o.IsPaused.Set(&v) +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. +func (o *DAG) SetDescription(v string) { + o.Description.Set(&v) } -// SetIsPausedNil sets the value for IsPaused to be an explicit nil -func (o *DAG) SetIsPausedNil() { - o.IsPaused.Set(nil) +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *DAG) SetDescriptionNil() { + o.Description.Set(nil) } -// UnsetIsPaused ensures that no value is present for IsPaused, not even an explicit nil -func (o *DAG) UnsetIsPaused() { - o.IsPaused.Unset() +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *DAG) UnsetDescription() { + o.Description.Unset() } -// GetIsActive returns the IsActive field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAG) GetIsActive() bool { - if o == nil || o.IsActive.Get() == nil { - var ret bool +// GetFileToken returns the FileToken field value if set, zero value otherwise. +func (o *DAG) GetFileToken() string { + if o == nil || IsNil(o.FileToken) { + var ret string return ret } - return *o.IsActive.Get() + return *o.FileToken } -// GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise +// GetFileTokenOk returns a tuple with the FileToken field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAG) GetIsActiveOk() (*bool, bool) { - if o == nil { +func (o *DAG) GetFileTokenOk() (*string, bool) { + if o == nil || IsNil(o.FileToken) { return nil, false } - return o.IsActive.Get(), o.IsActive.IsSet() + return o.FileToken, true } -// HasIsActive returns a boolean if a field has been set. -func (o *DAG) HasIsActive() bool { - if o != nil && o.IsActive.IsSet() { +// HasFileToken returns a boolean if a field has been set. +func (o *DAG) HasFileToken() bool { + if o != nil && !IsNil(o.FileToken) { return true } return false } -// SetIsActive gets a reference to the given NullableBool and assigns it to the IsActive field. -func (o *DAG) SetIsActive(v bool) { - o.IsActive.Set(&v) -} -// SetIsActiveNil sets the value for IsActive to be an explicit nil -func (o *DAG) SetIsActiveNil() { - o.IsActive.Set(nil) -} - -// UnsetIsActive ensures that no value is present for IsActive, not even an explicit nil -func (o *DAG) UnsetIsActive() { - o.IsActive.Unset() +// SetFileToken gets a reference to the given string and assigns it to the FileToken field. +func (o *DAG) SetFileToken(v string) { + o.FileToken = &v } -// GetIsSubdag returns the IsSubdag field value if set, zero value otherwise. -func (o *DAG) GetIsSubdag() bool { - if o == nil || o.IsSubdag == nil { - var ret bool +// GetFileloc returns the Fileloc field value if set, zero value otherwise. +func (o *DAG) GetFileloc() string { + if o == nil || IsNil(o.Fileloc) { + var ret string return ret } - return *o.IsSubdag + return *o.Fileloc } -// GetIsSubdagOk returns a tuple with the IsSubdag field value if set, nil otherwise +// GetFilelocOk returns a tuple with the Fileloc field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DAG) GetIsSubdagOk() (*bool, bool) { - if o == nil || o.IsSubdag == nil { +func (o *DAG) GetFilelocOk() (*string, bool) { + if o == nil || IsNil(o.Fileloc) { return nil, false } - return o.IsSubdag, true + return o.Fileloc, true } -// HasIsSubdag returns a boolean if a field has been set. -func (o *DAG) HasIsSubdag() bool { - if o != nil && o.IsSubdag != nil { +// HasFileloc returns a boolean if a field has been set. +func (o *DAG) HasFileloc() bool { + if o != nil && !IsNil(o.Fileloc) { return true } return false } -// SetIsSubdag gets a reference to the given bool and assigns it to the IsSubdag field. -func (o *DAG) SetIsSubdag(v bool) { - o.IsSubdag = &v +// SetFileloc gets a reference to the given string and assigns it to the Fileloc field. +func (o *DAG) SetFileloc(v string) { + o.Fileloc = &v } -// GetLastParsedTime returns the LastParsedTime field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAG) GetLastParsedTime() time.Time { - if o == nil || o.LastParsedTime.Get() == nil { - var ret time.Time +// GetHasImportErrors returns the HasImportErrors field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAG) GetHasImportErrors() bool { + if o == nil || IsNil(o.HasImportErrors.Get()) { + var ret bool return ret } - return *o.LastParsedTime.Get() + return *o.HasImportErrors.Get() } -// GetLastParsedTimeOk returns a tuple with the LastParsedTime field value if set, nil otherwise +// GetHasImportErrorsOk returns a tuple with the HasImportErrors field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAG) GetLastParsedTimeOk() (*time.Time, bool) { - if o == nil { +func (o *DAG) GetHasImportErrorsOk() (*bool, bool) { + if o == nil { return nil, false } - return o.LastParsedTime.Get(), o.LastParsedTime.IsSet() + return o.HasImportErrors.Get(), o.HasImportErrors.IsSet() } -// HasLastParsedTime returns a boolean if a field has been set. -func (o *DAG) HasLastParsedTime() bool { - if o != nil && o.LastParsedTime.IsSet() { +// HasHasImportErrors returns a boolean if a field has been set. +func (o *DAG) HasHasImportErrors() bool { + if o != nil && o.HasImportErrors.IsSet() { return true } return false } -// SetLastParsedTime gets a reference to the given NullableTime and assigns it to the LastParsedTime field. -func (o *DAG) SetLastParsedTime(v time.Time) { - o.LastParsedTime.Set(&v) -} -// SetLastParsedTimeNil sets the value for LastParsedTime to be an explicit nil -func (o *DAG) SetLastParsedTimeNil() { - o.LastParsedTime.Set(nil) +// SetHasImportErrors gets a reference to the given NullableBool and assigns it to the HasImportErrors field. +func (o *DAG) SetHasImportErrors(v bool) { + o.HasImportErrors.Set(&v) } - -// UnsetLastParsedTime ensures that no value is present for LastParsedTime, not even an explicit nil -func (o *DAG) UnsetLastParsedTime() { - o.LastParsedTime.Unset() +// SetHasImportErrorsNil sets the value for HasImportErrors to be an explicit nil +func (o *DAG) SetHasImportErrorsNil() { + o.HasImportErrors.Set(nil) } -// GetLastPickled returns the LastPickled field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAG) GetLastPickled() time.Time { - if o == nil || o.LastPickled.Get() == nil { - var ret time.Time +// UnsetHasImportErrors ensures that no value is present for HasImportErrors, not even an explicit nil +func (o *DAG) UnsetHasImportErrors() { + o.HasImportErrors.Unset() +} + +// GetHasTaskConcurrencyLimits returns the HasTaskConcurrencyLimits field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAG) GetHasTaskConcurrencyLimits() bool { + if o == nil || IsNil(o.HasTaskConcurrencyLimits.Get()) { + var ret bool return ret } - return *o.LastPickled.Get() + return *o.HasTaskConcurrencyLimits.Get() } -// GetLastPickledOk returns a tuple with the LastPickled field value if set, nil otherwise +// GetHasTaskConcurrencyLimitsOk returns a tuple with the HasTaskConcurrencyLimits field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAG) GetLastPickledOk() (*time.Time, bool) { - if o == nil { +func (o *DAG) GetHasTaskConcurrencyLimitsOk() (*bool, bool) { + if o == nil { return nil, false } - return o.LastPickled.Get(), o.LastPickled.IsSet() + return o.HasTaskConcurrencyLimits.Get(), o.HasTaskConcurrencyLimits.IsSet() } -// HasLastPickled returns a boolean if a field has been set. -func (o *DAG) HasLastPickled() bool { - if o != nil && o.LastPickled.IsSet() { +// HasHasTaskConcurrencyLimits returns a boolean if a field has been set. +func (o *DAG) HasHasTaskConcurrencyLimits() bool { + if o != nil && o.HasTaskConcurrencyLimits.IsSet() { return true } return false } -// SetLastPickled gets a reference to the given NullableTime and assigns it to the LastPickled field. -func (o *DAG) SetLastPickled(v time.Time) { - o.LastPickled.Set(&v) +// SetHasTaskConcurrencyLimits gets a reference to the given NullableBool and assigns it to the HasTaskConcurrencyLimits field. +func (o *DAG) SetHasTaskConcurrencyLimits(v bool) { + o.HasTaskConcurrencyLimits.Set(&v) } -// SetLastPickledNil sets the value for LastPickled to be an explicit nil -func (o *DAG) SetLastPickledNil() { - o.LastPickled.Set(nil) +// SetHasTaskConcurrencyLimitsNil sets the value for HasTaskConcurrencyLimits to be an explicit nil +func (o *DAG) SetHasTaskConcurrencyLimitsNil() { + o.HasTaskConcurrencyLimits.Set(nil) } -// UnsetLastPickled ensures that no value is present for LastPickled, not even an explicit nil -func (o *DAG) UnsetLastPickled() { - o.LastPickled.Unset() +// UnsetHasTaskConcurrencyLimits ensures that no value is present for HasTaskConcurrencyLimits, not even an explicit nil +func (o *DAG) UnsetHasTaskConcurrencyLimits() { + o.HasTaskConcurrencyLimits.Unset() } -// GetLastExpired returns the LastExpired field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAG) GetLastExpired() time.Time { - if o == nil || o.LastExpired.Get() == nil { - var ret time.Time +// GetIsActive returns the IsActive field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAG) GetIsActive() bool { + if o == nil || IsNil(o.IsActive.Get()) { + var ret bool return ret } - return *o.LastExpired.Get() + return *o.IsActive.Get() } -// GetLastExpiredOk returns a tuple with the LastExpired field value if set, nil otherwise +// GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAG) GetLastExpiredOk() (*time.Time, bool) { - if o == nil { +func (o *DAG) GetIsActiveOk() (*bool, bool) { + if o == nil { return nil, false } - return o.LastExpired.Get(), o.LastExpired.IsSet() + return o.IsActive.Get(), o.IsActive.IsSet() } -// HasLastExpired returns a boolean if a field has been set. -func (o *DAG) HasLastExpired() bool { - if o != nil && o.LastExpired.IsSet() { +// HasIsActive returns a boolean if a field has been set. +func (o *DAG) HasIsActive() bool { + if o != nil && o.IsActive.IsSet() { return true } return false } -// SetLastExpired gets a reference to the given NullableTime and assigns it to the LastExpired field. -func (o *DAG) SetLastExpired(v time.Time) { - o.LastExpired.Set(&v) +// SetIsActive gets a reference to the given NullableBool and assigns it to the IsActive field. +func (o *DAG) SetIsActive(v bool) { + o.IsActive.Set(&v) } -// SetLastExpiredNil sets the value for LastExpired to be an explicit nil -func (o *DAG) SetLastExpiredNil() { - o.LastExpired.Set(nil) +// SetIsActiveNil sets the value for IsActive to be an explicit nil +func (o *DAG) SetIsActiveNil() { + o.IsActive.Set(nil) } -// UnsetLastExpired ensures that no value is present for LastExpired, not even an explicit nil -func (o *DAG) UnsetLastExpired() { - o.LastExpired.Unset() +// UnsetIsActive ensures that no value is present for IsActive, not even an explicit nil +func (o *DAG) UnsetIsActive() { + o.IsActive.Unset() } -// GetSchedulerLock returns the SchedulerLock field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAG) GetSchedulerLock() bool { - if o == nil || o.SchedulerLock.Get() == nil { +// GetIsPaused returns the IsPaused field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAG) GetIsPaused() bool { + if o == nil || IsNil(o.IsPaused.Get()) { var ret bool return ret } - return *o.SchedulerLock.Get() + return *o.IsPaused.Get() } -// GetSchedulerLockOk returns a tuple with the SchedulerLock field value if set, nil otherwise +// GetIsPausedOk returns a tuple with the IsPaused field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAG) GetSchedulerLockOk() (*bool, bool) { - if o == nil { +func (o *DAG) GetIsPausedOk() (*bool, bool) { + if o == nil { return nil, false } - return o.SchedulerLock.Get(), o.SchedulerLock.IsSet() + return o.IsPaused.Get(), o.IsPaused.IsSet() } -// HasSchedulerLock returns a boolean if a field has been set. -func (o *DAG) HasSchedulerLock() bool { - if o != nil && o.SchedulerLock.IsSet() { +// HasIsPaused returns a boolean if a field has been set. +func (o *DAG) HasIsPaused() bool { + if o != nil && o.IsPaused.IsSet() { return true } return false } -// SetSchedulerLock gets a reference to the given NullableBool and assigns it to the SchedulerLock field. -func (o *DAG) SetSchedulerLock(v bool) { - o.SchedulerLock.Set(&v) +// SetIsPaused gets a reference to the given NullableBool and assigns it to the IsPaused field. +func (o *DAG) SetIsPaused(v bool) { + o.IsPaused.Set(&v) } -// SetSchedulerLockNil sets the value for SchedulerLock to be an explicit nil -func (o *DAG) SetSchedulerLockNil() { - o.SchedulerLock.Set(nil) +// SetIsPausedNil sets the value for IsPaused to be an explicit nil +func (o *DAG) SetIsPausedNil() { + o.IsPaused.Set(nil) } -// UnsetSchedulerLock ensures that no value is present for SchedulerLock, not even an explicit nil -func (o *DAG) UnsetSchedulerLock() { - o.SchedulerLock.Unset() +// UnsetIsPaused ensures that no value is present for IsPaused, not even an explicit nil +func (o *DAG) UnsetIsPaused() { + o.IsPaused.Unset() } -// GetPickleId returns the PickleId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAG) GetPickleId() string { - if o == nil || o.PickleId.Get() == nil { - var ret string +// GetIsSubdag returns the IsSubdag field value if set, zero value otherwise. +func (o *DAG) GetIsSubdag() bool { + if o == nil || IsNil(o.IsSubdag) { + var ret bool return ret } - return *o.PickleId.Get() + return *o.IsSubdag } -// GetPickleIdOk returns a tuple with the PickleId field value if set, nil otherwise +// GetIsSubdagOk returns a tuple with the IsSubdag field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAG) GetPickleIdOk() (*string, bool) { - if o == nil { +func (o *DAG) GetIsSubdagOk() (*bool, bool) { + if o == nil || IsNil(o.IsSubdag) { return nil, false } - return o.PickleId.Get(), o.PickleId.IsSet() + return o.IsSubdag, true } -// HasPickleId returns a boolean if a field has been set. -func (o *DAG) HasPickleId() bool { - if o != nil && o.PickleId.IsSet() { +// HasIsSubdag returns a boolean if a field has been set. +func (o *DAG) HasIsSubdag() bool { + if o != nil && !IsNil(o.IsSubdag) { return true } return false } -// SetPickleId gets a reference to the given NullableString and assigns it to the PickleId field. -func (o *DAG) SetPickleId(v string) { - o.PickleId.Set(&v) -} -// SetPickleIdNil sets the value for PickleId to be an explicit nil -func (o *DAG) SetPickleIdNil() { - o.PickleId.Set(nil) -} - -// UnsetPickleId ensures that no value is present for PickleId, not even an explicit nil -func (o *DAG) UnsetPickleId() { - o.PickleId.Unset() +// SetIsSubdag gets a reference to the given bool and assigns it to the IsSubdag field. +func (o *DAG) SetIsSubdag(v bool) { + o.IsSubdag = &v } -// GetDefaultView returns the DefaultView field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAG) GetDefaultView() string { - if o == nil || o.DefaultView.Get() == nil { - var ret string +// GetLastExpired returns the LastExpired field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAG) GetLastExpired() time.Time { + if o == nil || IsNil(o.LastExpired.Get()) { + var ret time.Time return ret } - return *o.DefaultView.Get() + return *o.LastExpired.Get() } -// GetDefaultViewOk returns a tuple with the DefaultView field value if set, nil otherwise +// GetLastExpiredOk returns a tuple with the LastExpired field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAG) GetDefaultViewOk() (*string, bool) { - if o == nil { +func (o *DAG) GetLastExpiredOk() (*time.Time, bool) { + if o == nil { return nil, false } - return o.DefaultView.Get(), o.DefaultView.IsSet() + return o.LastExpired.Get(), o.LastExpired.IsSet() } -// HasDefaultView returns a boolean if a field has been set. -func (o *DAG) HasDefaultView() bool { - if o != nil && o.DefaultView.IsSet() { +// HasLastExpired returns a boolean if a field has been set. +func (o *DAG) HasLastExpired() bool { + if o != nil && o.LastExpired.IsSet() { return true } return false } -// SetDefaultView gets a reference to the given NullableString and assigns it to the DefaultView field. -func (o *DAG) SetDefaultView(v string) { - o.DefaultView.Set(&v) +// SetLastExpired gets a reference to the given NullableTime and assigns it to the LastExpired field. +func (o *DAG) SetLastExpired(v time.Time) { + o.LastExpired.Set(&v) } -// SetDefaultViewNil sets the value for DefaultView to be an explicit nil -func (o *DAG) SetDefaultViewNil() { - o.DefaultView.Set(nil) +// SetLastExpiredNil sets the value for LastExpired to be an explicit nil +func (o *DAG) SetLastExpiredNil() { + o.LastExpired.Set(nil) } -// UnsetDefaultView ensures that no value is present for DefaultView, not even an explicit nil -func (o *DAG) UnsetDefaultView() { - o.DefaultView.Unset() +// UnsetLastExpired ensures that no value is present for LastExpired, not even an explicit nil +func (o *DAG) UnsetLastExpired() { + o.LastExpired.Unset() } -// GetFileloc returns the Fileloc field value if set, zero value otherwise. -func (o *DAG) GetFileloc() string { - if o == nil || o.Fileloc == nil { - var ret string +// GetLastParsedTime returns the LastParsedTime field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAG) GetLastParsedTime() time.Time { + if o == nil || IsNil(o.LastParsedTime.Get()) { + var ret time.Time return ret } - return *o.Fileloc + return *o.LastParsedTime.Get() } -// GetFilelocOk returns a tuple with the Fileloc field value if set, nil otherwise +// GetLastParsedTimeOk returns a tuple with the LastParsedTime field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DAG) GetFilelocOk() (*string, bool) { - if o == nil || o.Fileloc == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DAG) GetLastParsedTimeOk() (*time.Time, bool) { + if o == nil { return nil, false } - return o.Fileloc, true + return o.LastParsedTime.Get(), o.LastParsedTime.IsSet() } -// HasFileloc returns a boolean if a field has been set. -func (o *DAG) HasFileloc() bool { - if o != nil && o.Fileloc != nil { +// HasLastParsedTime returns a boolean if a field has been set. +func (o *DAG) HasLastParsedTime() bool { + if o != nil && o.LastParsedTime.IsSet() { return true } return false } -// SetFileloc gets a reference to the given string and assigns it to the Fileloc field. -func (o *DAG) SetFileloc(v string) { - o.Fileloc = &v +// SetLastParsedTime gets a reference to the given NullableTime and assigns it to the LastParsedTime field. +func (o *DAG) SetLastParsedTime(v time.Time) { + o.LastParsedTime.Set(&v) +} +// SetLastParsedTimeNil sets the value for LastParsedTime to be an explicit nil +func (o *DAG) SetLastParsedTimeNil() { + o.LastParsedTime.Set(nil) } -// GetFileToken returns the FileToken field value if set, zero value otherwise. -func (o *DAG) GetFileToken() string { - if o == nil || o.FileToken == nil { - var ret string +// UnsetLastParsedTime ensures that no value is present for LastParsedTime, not even an explicit nil +func (o *DAG) UnsetLastParsedTime() { + o.LastParsedTime.Unset() +} + +// GetLastPickled returns the LastPickled field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAG) GetLastPickled() time.Time { + if o == nil || IsNil(o.LastPickled.Get()) { + var ret time.Time return ret } - return *o.FileToken + return *o.LastPickled.Get() } -// GetFileTokenOk returns a tuple with the FileToken field value if set, nil otherwise +// GetLastPickledOk returns a tuple with the LastPickled field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DAG) GetFileTokenOk() (*string, bool) { - if o == nil || o.FileToken == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DAG) GetLastPickledOk() (*time.Time, bool) { + if o == nil { return nil, false } - return o.FileToken, true + return o.LastPickled.Get(), o.LastPickled.IsSet() } -// HasFileToken returns a boolean if a field has been set. -func (o *DAG) HasFileToken() bool { - if o != nil && o.FileToken != nil { +// HasLastPickled returns a boolean if a field has been set. +func (o *DAG) HasLastPickled() bool { + if o != nil && o.LastPickled.IsSet() { return true } return false } -// SetFileToken gets a reference to the given string and assigns it to the FileToken field. -func (o *DAG) SetFileToken(v string) { - o.FileToken = &v +// SetLastPickled gets a reference to the given NullableTime and assigns it to the LastPickled field. +func (o *DAG) SetLastPickled(v time.Time) { + o.LastPickled.Set(&v) +} +// SetLastPickledNil sets the value for LastPickled to be an explicit nil +func (o *DAG) SetLastPickledNil() { + o.LastPickled.Set(nil) } -// GetOwners returns the Owners field value if set, zero value otherwise. -func (o *DAG) GetOwners() []string { - if o == nil || o.Owners == nil { - var ret []string +// UnsetLastPickled ensures that no value is present for LastPickled, not even an explicit nil +func (o *DAG) UnsetLastPickled() { + o.LastPickled.Unset() +} + +// GetMaxActiveRuns returns the MaxActiveRuns field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAG) GetMaxActiveRuns() int32 { + if o == nil || IsNil(o.MaxActiveRuns.Get()) { + var ret int32 return ret } - return *o.Owners + return *o.MaxActiveRuns.Get() } -// GetOwnersOk returns a tuple with the Owners field value if set, nil otherwise +// GetMaxActiveRunsOk returns a tuple with the MaxActiveRuns field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DAG) GetOwnersOk() (*[]string, bool) { - if o == nil || o.Owners == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DAG) GetMaxActiveRunsOk() (*int32, bool) { + if o == nil { return nil, false } - return o.Owners, true + return o.MaxActiveRuns.Get(), o.MaxActiveRuns.IsSet() } -// HasOwners returns a boolean if a field has been set. -func (o *DAG) HasOwners() bool { - if o != nil && o.Owners != nil { +// HasMaxActiveRuns returns a boolean if a field has been set. +func (o *DAG) HasMaxActiveRuns() bool { + if o != nil && o.MaxActiveRuns.IsSet() { return true } return false } -// SetOwners gets a reference to the given []string and assigns it to the Owners field. -func (o *DAG) SetOwners(v []string) { - o.Owners = &v +// SetMaxActiveRuns gets a reference to the given NullableInt32 and assigns it to the MaxActiveRuns field. +func (o *DAG) SetMaxActiveRuns(v int32) { + o.MaxActiveRuns.Set(&v) +} +// SetMaxActiveRunsNil sets the value for MaxActiveRuns to be an explicit nil +func (o *DAG) SetMaxActiveRunsNil() { + o.MaxActiveRuns.Set(nil) } -// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAG) GetDescription() string { - if o == nil || o.Description.Get() == nil { - var ret string +// UnsetMaxActiveRuns ensures that no value is present for MaxActiveRuns, not even an explicit nil +func (o *DAG) UnsetMaxActiveRuns() { + o.MaxActiveRuns.Unset() +} + +// GetMaxActiveTasks returns the MaxActiveTasks field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAG) GetMaxActiveTasks() int32 { + if o == nil || IsNil(o.MaxActiveTasks.Get()) { + var ret int32 return ret } - return *o.Description.Get() + return *o.MaxActiveTasks.Get() } -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// GetMaxActiveTasksOk returns a tuple with the MaxActiveTasks field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAG) GetDescriptionOk() (*string, bool) { - if o == nil { +func (o *DAG) GetMaxActiveTasksOk() (*int32, bool) { + if o == nil { return nil, false } - return o.Description.Get(), o.Description.IsSet() + return o.MaxActiveTasks.Get(), o.MaxActiveTasks.IsSet() } -// HasDescription returns a boolean if a field has been set. -func (o *DAG) HasDescription() bool { - if o != nil && o.Description.IsSet() { +// HasMaxActiveTasks returns a boolean if a field has been set. +func (o *DAG) HasMaxActiveTasks() bool { + if o != nil && o.MaxActiveTasks.IsSet() { return true } return false } -// SetDescription gets a reference to the given NullableString and assigns it to the Description field. -func (o *DAG) SetDescription(v string) { - o.Description.Set(&v) +// SetMaxActiveTasks gets a reference to the given NullableInt32 and assigns it to the MaxActiveTasks field. +func (o *DAG) SetMaxActiveTasks(v int32) { + o.MaxActiveTasks.Set(&v) } -// SetDescriptionNil sets the value for Description to be an explicit nil -func (o *DAG) SetDescriptionNil() { - o.Description.Set(nil) +// SetMaxActiveTasksNil sets the value for MaxActiveTasks to be an explicit nil +func (o *DAG) SetMaxActiveTasksNil() { + o.MaxActiveTasks.Set(nil) } -// UnsetDescription ensures that no value is present for Description, not even an explicit nil -func (o *DAG) UnsetDescription() { - o.Description.Unset() +// UnsetMaxActiveTasks ensures that no value is present for MaxActiveTasks, not even an explicit nil +func (o *DAG) UnsetMaxActiveTasks() { + o.MaxActiveTasks.Unset() } -// GetScheduleInterval returns the ScheduleInterval field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAG) GetScheduleInterval() ScheduleInterval { - if o == nil || o.ScheduleInterval.Get() == nil { - var ret ScheduleInterval +// GetMaxConsecutiveFailedDagRuns returns the MaxConsecutiveFailedDagRuns field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAG) GetMaxConsecutiveFailedDagRuns() int32 { + if o == nil || IsNil(o.MaxConsecutiveFailedDagRuns.Get()) { + var ret int32 return ret } - return *o.ScheduleInterval.Get() + return *o.MaxConsecutiveFailedDagRuns.Get() } -// GetScheduleIntervalOk returns a tuple with the ScheduleInterval field value if set, nil otherwise +// GetMaxConsecutiveFailedDagRunsOk returns a tuple with the MaxConsecutiveFailedDagRuns field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAG) GetScheduleIntervalOk() (*ScheduleInterval, bool) { - if o == nil { +func (o *DAG) GetMaxConsecutiveFailedDagRunsOk() (*int32, bool) { + if o == nil { return nil, false } - return o.ScheduleInterval.Get(), o.ScheduleInterval.IsSet() + return o.MaxConsecutiveFailedDagRuns.Get(), o.MaxConsecutiveFailedDagRuns.IsSet() } -// HasScheduleInterval returns a boolean if a field has been set. -func (o *DAG) HasScheduleInterval() bool { - if o != nil && o.ScheduleInterval.IsSet() { +// HasMaxConsecutiveFailedDagRuns returns a boolean if a field has been set. +func (o *DAG) HasMaxConsecutiveFailedDagRuns() bool { + if o != nil && o.MaxConsecutiveFailedDagRuns.IsSet() { return true } return false } -// SetScheduleInterval gets a reference to the given NullableScheduleInterval and assigns it to the ScheduleInterval field. -func (o *DAG) SetScheduleInterval(v ScheduleInterval) { - o.ScheduleInterval.Set(&v) +// SetMaxConsecutiveFailedDagRuns gets a reference to the given NullableInt32 and assigns it to the MaxConsecutiveFailedDagRuns field. +func (o *DAG) SetMaxConsecutiveFailedDagRuns(v int32) { + o.MaxConsecutiveFailedDagRuns.Set(&v) } -// SetScheduleIntervalNil sets the value for ScheduleInterval to be an explicit nil -func (o *DAG) SetScheduleIntervalNil() { - o.ScheduleInterval.Set(nil) +// SetMaxConsecutiveFailedDagRunsNil sets the value for MaxConsecutiveFailedDagRuns to be an explicit nil +func (o *DAG) SetMaxConsecutiveFailedDagRunsNil() { + o.MaxConsecutiveFailedDagRuns.Set(nil) } -// UnsetScheduleInterval ensures that no value is present for ScheduleInterval, not even an explicit nil -func (o *DAG) UnsetScheduleInterval() { - o.ScheduleInterval.Unset() +// UnsetMaxConsecutiveFailedDagRuns ensures that no value is present for MaxConsecutiveFailedDagRuns, not even an explicit nil +func (o *DAG) UnsetMaxConsecutiveFailedDagRuns() { + o.MaxConsecutiveFailedDagRuns.Unset() } -// GetTimetableDescription returns the TimetableDescription field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAG) GetTimetableDescription() string { - if o == nil || o.TimetableDescription.Get() == nil { - var ret string +// GetNextDagrun returns the NextDagrun field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAG) GetNextDagrun() time.Time { + if o == nil || IsNil(o.NextDagrun.Get()) { + var ret time.Time return ret } - return *o.TimetableDescription.Get() + return *o.NextDagrun.Get() } -// GetTimetableDescriptionOk returns a tuple with the TimetableDescription field value if set, nil otherwise +// GetNextDagrunOk returns a tuple with the NextDagrun field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAG) GetTimetableDescriptionOk() (*string, bool) { - if o == nil { +func (o *DAG) GetNextDagrunOk() (*time.Time, bool) { + if o == nil { return nil, false } - return o.TimetableDescription.Get(), o.TimetableDescription.IsSet() + return o.NextDagrun.Get(), o.NextDagrun.IsSet() } -// HasTimetableDescription returns a boolean if a field has been set. -func (o *DAG) HasTimetableDescription() bool { - if o != nil && o.TimetableDescription.IsSet() { +// HasNextDagrun returns a boolean if a field has been set. +func (o *DAG) HasNextDagrun() bool { + if o != nil && o.NextDagrun.IsSet() { return true } return false } -// SetTimetableDescription gets a reference to the given NullableString and assigns it to the TimetableDescription field. -func (o *DAG) SetTimetableDescription(v string) { - o.TimetableDescription.Set(&v) +// SetNextDagrun gets a reference to the given NullableTime and assigns it to the NextDagrun field. +func (o *DAG) SetNextDagrun(v time.Time) { + o.NextDagrun.Set(&v) } -// SetTimetableDescriptionNil sets the value for TimetableDescription to be an explicit nil -func (o *DAG) SetTimetableDescriptionNil() { - o.TimetableDescription.Set(nil) +// SetNextDagrunNil sets the value for NextDagrun to be an explicit nil +func (o *DAG) SetNextDagrunNil() { + o.NextDagrun.Set(nil) } -// UnsetTimetableDescription ensures that no value is present for TimetableDescription, not even an explicit nil -func (o *DAG) UnsetTimetableDescription() { - o.TimetableDescription.Unset() +// UnsetNextDagrun ensures that no value is present for NextDagrun, not even an explicit nil +func (o *DAG) UnsetNextDagrun() { + o.NextDagrun.Unset() } -// GetTags returns the Tags field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAG) GetTags() []Tag { - if o == nil { - var ret []Tag +// GetNextDagrunCreateAfter returns the NextDagrunCreateAfter field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAG) GetNextDagrunCreateAfter() time.Time { + if o == nil || IsNil(o.NextDagrunCreateAfter.Get()) { + var ret time.Time return ret } - return o.Tags + return *o.NextDagrunCreateAfter.Get() } -// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// GetNextDagrunCreateAfterOk returns a tuple with the NextDagrunCreateAfter field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAG) GetTagsOk() (*[]Tag, bool) { - if o == nil || o.Tags == nil { +func (o *DAG) GetNextDagrunCreateAfterOk() (*time.Time, bool) { + if o == nil { return nil, false } - return &o.Tags, true + return o.NextDagrunCreateAfter.Get(), o.NextDagrunCreateAfter.IsSet() } -// HasTags returns a boolean if a field has been set. -func (o *DAG) HasTags() bool { - if o != nil && o.Tags != nil { +// HasNextDagrunCreateAfter returns a boolean if a field has been set. +func (o *DAG) HasNextDagrunCreateAfter() bool { + if o != nil && o.NextDagrunCreateAfter.IsSet() { return true } return false } -// SetTags gets a reference to the given []Tag and assigns it to the Tags field. -func (o *DAG) SetTags(v []Tag) { - o.Tags = v +// SetNextDagrunCreateAfter gets a reference to the given NullableTime and assigns it to the NextDagrunCreateAfter field. +func (o *DAG) SetNextDagrunCreateAfter(v time.Time) { + o.NextDagrunCreateAfter.Set(&v) +} +// SetNextDagrunCreateAfterNil sets the value for NextDagrunCreateAfter to be an explicit nil +func (o *DAG) SetNextDagrunCreateAfterNil() { + o.NextDagrunCreateAfter.Set(nil) } -// GetMaxActiveTasks returns the MaxActiveTasks field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAG) GetMaxActiveTasks() int32 { - if o == nil || o.MaxActiveTasks.Get() == nil { - var ret int32 +// UnsetNextDagrunCreateAfter ensures that no value is present for NextDagrunCreateAfter, not even an explicit nil +func (o *DAG) UnsetNextDagrunCreateAfter() { + o.NextDagrunCreateAfter.Unset() +} + +// GetNextDagrunDataIntervalEnd returns the NextDagrunDataIntervalEnd field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAG) GetNextDagrunDataIntervalEnd() time.Time { + if o == nil || IsNil(o.NextDagrunDataIntervalEnd.Get()) { + var ret time.Time return ret } - return *o.MaxActiveTasks.Get() + return *o.NextDagrunDataIntervalEnd.Get() } -// GetMaxActiveTasksOk returns a tuple with the MaxActiveTasks field value if set, nil otherwise +// GetNextDagrunDataIntervalEndOk returns a tuple with the NextDagrunDataIntervalEnd field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAG) GetMaxActiveTasksOk() (*int32, bool) { - if o == nil { +func (o *DAG) GetNextDagrunDataIntervalEndOk() (*time.Time, bool) { + if o == nil { return nil, false } - return o.MaxActiveTasks.Get(), o.MaxActiveTasks.IsSet() + return o.NextDagrunDataIntervalEnd.Get(), o.NextDagrunDataIntervalEnd.IsSet() } -// HasMaxActiveTasks returns a boolean if a field has been set. -func (o *DAG) HasMaxActiveTasks() bool { - if o != nil && o.MaxActiveTasks.IsSet() { +// HasNextDagrunDataIntervalEnd returns a boolean if a field has been set. +func (o *DAG) HasNextDagrunDataIntervalEnd() bool { + if o != nil && o.NextDagrunDataIntervalEnd.IsSet() { return true } return false } -// SetMaxActiveTasks gets a reference to the given NullableInt32 and assigns it to the MaxActiveTasks field. -func (o *DAG) SetMaxActiveTasks(v int32) { - o.MaxActiveTasks.Set(&v) +// SetNextDagrunDataIntervalEnd gets a reference to the given NullableTime and assigns it to the NextDagrunDataIntervalEnd field. +func (o *DAG) SetNextDagrunDataIntervalEnd(v time.Time) { + o.NextDagrunDataIntervalEnd.Set(&v) } -// SetMaxActiveTasksNil sets the value for MaxActiveTasks to be an explicit nil -func (o *DAG) SetMaxActiveTasksNil() { - o.MaxActiveTasks.Set(nil) +// SetNextDagrunDataIntervalEndNil sets the value for NextDagrunDataIntervalEnd to be an explicit nil +func (o *DAG) SetNextDagrunDataIntervalEndNil() { + o.NextDagrunDataIntervalEnd.Set(nil) } -// UnsetMaxActiveTasks ensures that no value is present for MaxActiveTasks, not even an explicit nil -func (o *DAG) UnsetMaxActiveTasks() { - o.MaxActiveTasks.Unset() +// UnsetNextDagrunDataIntervalEnd ensures that no value is present for NextDagrunDataIntervalEnd, not even an explicit nil +func (o *DAG) UnsetNextDagrunDataIntervalEnd() { + o.NextDagrunDataIntervalEnd.Unset() } -// GetMaxActiveRuns returns the MaxActiveRuns field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAG) GetMaxActiveRuns() int32 { - if o == nil || o.MaxActiveRuns.Get() == nil { - var ret int32 +// GetNextDagrunDataIntervalStart returns the NextDagrunDataIntervalStart field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAG) GetNextDagrunDataIntervalStart() time.Time { + if o == nil || IsNil(o.NextDagrunDataIntervalStart.Get()) { + var ret time.Time return ret } - return *o.MaxActiveRuns.Get() + return *o.NextDagrunDataIntervalStart.Get() } -// GetMaxActiveRunsOk returns a tuple with the MaxActiveRuns field value if set, nil otherwise +// GetNextDagrunDataIntervalStartOk returns a tuple with the NextDagrunDataIntervalStart field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAG) GetMaxActiveRunsOk() (*int32, bool) { - if o == nil { +func (o *DAG) GetNextDagrunDataIntervalStartOk() (*time.Time, bool) { + if o == nil { return nil, false } - return o.MaxActiveRuns.Get(), o.MaxActiveRuns.IsSet() + return o.NextDagrunDataIntervalStart.Get(), o.NextDagrunDataIntervalStart.IsSet() } -// HasMaxActiveRuns returns a boolean if a field has been set. -func (o *DAG) HasMaxActiveRuns() bool { - if o != nil && o.MaxActiveRuns.IsSet() { +// HasNextDagrunDataIntervalStart returns a boolean if a field has been set. +func (o *DAG) HasNextDagrunDataIntervalStart() bool { + if o != nil && o.NextDagrunDataIntervalStart.IsSet() { return true } return false } -// SetMaxActiveRuns gets a reference to the given NullableInt32 and assigns it to the MaxActiveRuns field. -func (o *DAG) SetMaxActiveRuns(v int32) { - o.MaxActiveRuns.Set(&v) +// SetNextDagrunDataIntervalStart gets a reference to the given NullableTime and assigns it to the NextDagrunDataIntervalStart field. +func (o *DAG) SetNextDagrunDataIntervalStart(v time.Time) { + o.NextDagrunDataIntervalStart.Set(&v) } -// SetMaxActiveRunsNil sets the value for MaxActiveRuns to be an explicit nil -func (o *DAG) SetMaxActiveRunsNil() { - o.MaxActiveRuns.Set(nil) +// SetNextDagrunDataIntervalStartNil sets the value for NextDagrunDataIntervalStart to be an explicit nil +func (o *DAG) SetNextDagrunDataIntervalStartNil() { + o.NextDagrunDataIntervalStart.Set(nil) } -// UnsetMaxActiveRuns ensures that no value is present for MaxActiveRuns, not even an explicit nil -func (o *DAG) UnsetMaxActiveRuns() { - o.MaxActiveRuns.Unset() +// UnsetNextDagrunDataIntervalStart ensures that no value is present for NextDagrunDataIntervalStart, not even an explicit nil +func (o *DAG) UnsetNextDagrunDataIntervalStart() { + o.NextDagrunDataIntervalStart.Unset() } -// GetHasTaskConcurrencyLimits returns the HasTaskConcurrencyLimits field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAG) GetHasTaskConcurrencyLimits() bool { - if o == nil || o.HasTaskConcurrencyLimits.Get() == nil { - var ret bool +// GetOwners returns the Owners field value if set, zero value otherwise. +func (o *DAG) GetOwners() []string { + if o == nil || IsNil(o.Owners) { + var ret []string return ret } - return *o.HasTaskConcurrencyLimits.Get() + return o.Owners } -// GetHasTaskConcurrencyLimitsOk returns a tuple with the HasTaskConcurrencyLimits field value if set, nil otherwise +// GetOwnersOk returns a tuple with the Owners field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAG) GetHasTaskConcurrencyLimitsOk() (*bool, bool) { - if o == nil { +func (o *DAG) GetOwnersOk() ([]string, bool) { + if o == nil || IsNil(o.Owners) { return nil, false } - return o.HasTaskConcurrencyLimits.Get(), o.HasTaskConcurrencyLimits.IsSet() + return o.Owners, true } -// HasHasTaskConcurrencyLimits returns a boolean if a field has been set. -func (o *DAG) HasHasTaskConcurrencyLimits() bool { - if o != nil && o.HasTaskConcurrencyLimits.IsSet() { +// HasOwners returns a boolean if a field has been set. +func (o *DAG) HasOwners() bool { + if o != nil && !IsNil(o.Owners) { return true } return false } -// SetHasTaskConcurrencyLimits gets a reference to the given NullableBool and assigns it to the HasTaskConcurrencyLimits field. -func (o *DAG) SetHasTaskConcurrencyLimits(v bool) { - o.HasTaskConcurrencyLimits.Set(&v) -} -// SetHasTaskConcurrencyLimitsNil sets the value for HasTaskConcurrencyLimits to be an explicit nil -func (o *DAG) SetHasTaskConcurrencyLimitsNil() { - o.HasTaskConcurrencyLimits.Set(nil) -} - -// UnsetHasTaskConcurrencyLimits ensures that no value is present for HasTaskConcurrencyLimits, not even an explicit nil -func (o *DAG) UnsetHasTaskConcurrencyLimits() { - o.HasTaskConcurrencyLimits.Unset() +// SetOwners gets a reference to the given []string and assigns it to the Owners field. +func (o *DAG) SetOwners(v []string) { + o.Owners = v } -// GetHasImportErrors returns the HasImportErrors field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAG) GetHasImportErrors() bool { - if o == nil || o.HasImportErrors.Get() == nil { - var ret bool +// GetPickleId returns the PickleId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAG) GetPickleId() string { + if o == nil || IsNil(o.PickleId.Get()) { + var ret string return ret } - return *o.HasImportErrors.Get() + return *o.PickleId.Get() } -// GetHasImportErrorsOk returns a tuple with the HasImportErrors field value if set, nil otherwise +// GetPickleIdOk returns a tuple with the PickleId field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAG) GetHasImportErrorsOk() (*bool, bool) { - if o == nil { +func (o *DAG) GetPickleIdOk() (*string, bool) { + if o == nil { return nil, false } - return o.HasImportErrors.Get(), o.HasImportErrors.IsSet() + return o.PickleId.Get(), o.PickleId.IsSet() } -// HasHasImportErrors returns a boolean if a field has been set. -func (o *DAG) HasHasImportErrors() bool { - if o != nil && o.HasImportErrors.IsSet() { +// HasPickleId returns a boolean if a field has been set. +func (o *DAG) HasPickleId() bool { + if o != nil && o.PickleId.IsSet() { return true } return false } -// SetHasImportErrors gets a reference to the given NullableBool and assigns it to the HasImportErrors field. -func (o *DAG) SetHasImportErrors(v bool) { - o.HasImportErrors.Set(&v) +// SetPickleId gets a reference to the given NullableString and assigns it to the PickleId field. +func (o *DAG) SetPickleId(v string) { + o.PickleId.Set(&v) } -// SetHasImportErrorsNil sets the value for HasImportErrors to be an explicit nil -func (o *DAG) SetHasImportErrorsNil() { - o.HasImportErrors.Set(nil) +// SetPickleIdNil sets the value for PickleId to be an explicit nil +func (o *DAG) SetPickleIdNil() { + o.PickleId.Set(nil) } -// UnsetHasImportErrors ensures that no value is present for HasImportErrors, not even an explicit nil -func (o *DAG) UnsetHasImportErrors() { - o.HasImportErrors.Unset() +// UnsetPickleId ensures that no value is present for PickleId, not even an explicit nil +func (o *DAG) UnsetPickleId() { + o.PickleId.Unset() } -// GetNextDagrun returns the NextDagrun field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAG) GetNextDagrun() time.Time { - if o == nil || o.NextDagrun.Get() == nil { - var ret time.Time +// GetRootDagId returns the RootDagId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAG) GetRootDagId() string { + if o == nil || IsNil(o.RootDagId.Get()) { + var ret string return ret } - return *o.NextDagrun.Get() + return *o.RootDagId.Get() } -// GetNextDagrunOk returns a tuple with the NextDagrun field value if set, nil otherwise +// GetRootDagIdOk returns a tuple with the RootDagId field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAG) GetNextDagrunOk() (*time.Time, bool) { - if o == nil { +func (o *DAG) GetRootDagIdOk() (*string, bool) { + if o == nil { return nil, false } - return o.NextDagrun.Get(), o.NextDagrun.IsSet() + return o.RootDagId.Get(), o.RootDagId.IsSet() } -// HasNextDagrun returns a boolean if a field has been set. -func (o *DAG) HasNextDagrun() bool { - if o != nil && o.NextDagrun.IsSet() { +// HasRootDagId returns a boolean if a field has been set. +func (o *DAG) HasRootDagId() bool { + if o != nil && o.RootDagId.IsSet() { return true } return false } -// SetNextDagrun gets a reference to the given NullableTime and assigns it to the NextDagrun field. -func (o *DAG) SetNextDagrun(v time.Time) { - o.NextDagrun.Set(&v) +// SetRootDagId gets a reference to the given NullableString and assigns it to the RootDagId field. +func (o *DAG) SetRootDagId(v string) { + o.RootDagId.Set(&v) } -// SetNextDagrunNil sets the value for NextDagrun to be an explicit nil -func (o *DAG) SetNextDagrunNil() { - o.NextDagrun.Set(nil) +// SetRootDagIdNil sets the value for RootDagId to be an explicit nil +func (o *DAG) SetRootDagIdNil() { + o.RootDagId.Set(nil) } -// UnsetNextDagrun ensures that no value is present for NextDagrun, not even an explicit nil -func (o *DAG) UnsetNextDagrun() { - o.NextDagrun.Unset() +// UnsetRootDagId ensures that no value is present for RootDagId, not even an explicit nil +func (o *DAG) UnsetRootDagId() { + o.RootDagId.Unset() } -// GetNextDagrunDataIntervalStart returns the NextDagrunDataIntervalStart field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAG) GetNextDagrunDataIntervalStart() time.Time { - if o == nil || o.NextDagrunDataIntervalStart.Get() == nil { - var ret time.Time +// GetScheduleInterval returns the ScheduleInterval field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAG) GetScheduleInterval() ScheduleInterval { + if o == nil || IsNil(o.ScheduleInterval.Get()) { + var ret ScheduleInterval return ret } - return *o.NextDagrunDataIntervalStart.Get() + return *o.ScheduleInterval.Get() } -// GetNextDagrunDataIntervalStartOk returns a tuple with the NextDagrunDataIntervalStart field value if set, nil otherwise +// GetScheduleIntervalOk returns a tuple with the ScheduleInterval field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAG) GetNextDagrunDataIntervalStartOk() (*time.Time, bool) { - if o == nil { +func (o *DAG) GetScheduleIntervalOk() (*ScheduleInterval, bool) { + if o == nil { return nil, false } - return o.NextDagrunDataIntervalStart.Get(), o.NextDagrunDataIntervalStart.IsSet() + return o.ScheduleInterval.Get(), o.ScheduleInterval.IsSet() } -// HasNextDagrunDataIntervalStart returns a boolean if a field has been set. -func (o *DAG) HasNextDagrunDataIntervalStart() bool { - if o != nil && o.NextDagrunDataIntervalStart.IsSet() { +// HasScheduleInterval returns a boolean if a field has been set. +func (o *DAG) HasScheduleInterval() bool { + if o != nil && o.ScheduleInterval.IsSet() { return true } return false } -// SetNextDagrunDataIntervalStart gets a reference to the given NullableTime and assigns it to the NextDagrunDataIntervalStart field. -func (o *DAG) SetNextDagrunDataIntervalStart(v time.Time) { - o.NextDagrunDataIntervalStart.Set(&v) +// SetScheduleInterval gets a reference to the given NullableScheduleInterval and assigns it to the ScheduleInterval field. +func (o *DAG) SetScheduleInterval(v ScheduleInterval) { + o.ScheduleInterval.Set(&v) } -// SetNextDagrunDataIntervalStartNil sets the value for NextDagrunDataIntervalStart to be an explicit nil -func (o *DAG) SetNextDagrunDataIntervalStartNil() { - o.NextDagrunDataIntervalStart.Set(nil) +// SetScheduleIntervalNil sets the value for ScheduleInterval to be an explicit nil +func (o *DAG) SetScheduleIntervalNil() { + o.ScheduleInterval.Set(nil) } -// UnsetNextDagrunDataIntervalStart ensures that no value is present for NextDagrunDataIntervalStart, not even an explicit nil -func (o *DAG) UnsetNextDagrunDataIntervalStart() { - o.NextDagrunDataIntervalStart.Unset() +// UnsetScheduleInterval ensures that no value is present for ScheduleInterval, not even an explicit nil +func (o *DAG) UnsetScheduleInterval() { + o.ScheduleInterval.Unset() } -// GetNextDagrunDataIntervalEnd returns the NextDagrunDataIntervalEnd field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAG) GetNextDagrunDataIntervalEnd() time.Time { - if o == nil || o.NextDagrunDataIntervalEnd.Get() == nil { - var ret time.Time +// GetSchedulerLock returns the SchedulerLock field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAG) GetSchedulerLock() bool { + if o == nil || IsNil(o.SchedulerLock.Get()) { + var ret bool return ret } - return *o.NextDagrunDataIntervalEnd.Get() + return *o.SchedulerLock.Get() } -// GetNextDagrunDataIntervalEndOk returns a tuple with the NextDagrunDataIntervalEnd field value if set, nil otherwise +// GetSchedulerLockOk returns a tuple with the SchedulerLock field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAG) GetNextDagrunDataIntervalEndOk() (*time.Time, bool) { - if o == nil { +func (o *DAG) GetSchedulerLockOk() (*bool, bool) { + if o == nil { return nil, false } - return o.NextDagrunDataIntervalEnd.Get(), o.NextDagrunDataIntervalEnd.IsSet() + return o.SchedulerLock.Get(), o.SchedulerLock.IsSet() } -// HasNextDagrunDataIntervalEnd returns a boolean if a field has been set. -func (o *DAG) HasNextDagrunDataIntervalEnd() bool { - if o != nil && o.NextDagrunDataIntervalEnd.IsSet() { +// HasSchedulerLock returns a boolean if a field has been set. +func (o *DAG) HasSchedulerLock() bool { + if o != nil && o.SchedulerLock.IsSet() { return true } return false } -// SetNextDagrunDataIntervalEnd gets a reference to the given NullableTime and assigns it to the NextDagrunDataIntervalEnd field. -func (o *DAG) SetNextDagrunDataIntervalEnd(v time.Time) { - o.NextDagrunDataIntervalEnd.Set(&v) +// SetSchedulerLock gets a reference to the given NullableBool and assigns it to the SchedulerLock field. +func (o *DAG) SetSchedulerLock(v bool) { + o.SchedulerLock.Set(&v) } -// SetNextDagrunDataIntervalEndNil sets the value for NextDagrunDataIntervalEnd to be an explicit nil -func (o *DAG) SetNextDagrunDataIntervalEndNil() { - o.NextDagrunDataIntervalEnd.Set(nil) +// SetSchedulerLockNil sets the value for SchedulerLock to be an explicit nil +func (o *DAG) SetSchedulerLockNil() { + o.SchedulerLock.Set(nil) } -// UnsetNextDagrunDataIntervalEnd ensures that no value is present for NextDagrunDataIntervalEnd, not even an explicit nil -func (o *DAG) UnsetNextDagrunDataIntervalEnd() { - o.NextDagrunDataIntervalEnd.Unset() +// UnsetSchedulerLock ensures that no value is present for SchedulerLock, not even an explicit nil +func (o *DAG) UnsetSchedulerLock() { + o.SchedulerLock.Unset() } -// GetNextDagrunCreateAfter returns the NextDagrunCreateAfter field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAG) GetNextDagrunCreateAfter() time.Time { - if o == nil || o.NextDagrunCreateAfter.Get() == nil { - var ret time.Time +// GetTags returns the Tags field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAG) GetTags() []Tag { + if o == nil { + var ret []Tag return ret } - return *o.NextDagrunCreateAfter.Get() + return o.Tags } -// GetNextDagrunCreateAfterOk returns a tuple with the NextDagrunCreateAfter field value if set, nil otherwise +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAG) GetNextDagrunCreateAfterOk() (*time.Time, bool) { - if o == nil { +func (o *DAG) GetTagsOk() ([]Tag, bool) { + if o == nil || IsNil(o.Tags) { return nil, false } - return o.NextDagrunCreateAfter.Get(), o.NextDagrunCreateAfter.IsSet() + return o.Tags, true } -// HasNextDagrunCreateAfter returns a boolean if a field has been set. -func (o *DAG) HasNextDagrunCreateAfter() bool { - if o != nil && o.NextDagrunCreateAfter.IsSet() { +// HasTags returns a boolean if a field has been set. +func (o *DAG) HasTags() bool { + if o != nil && !IsNil(o.Tags) { return true } return false } -// SetNextDagrunCreateAfter gets a reference to the given NullableTime and assigns it to the NextDagrunCreateAfter field. -func (o *DAG) SetNextDagrunCreateAfter(v time.Time) { - o.NextDagrunCreateAfter.Set(&v) +// SetTags gets a reference to the given []Tag and assigns it to the Tags field. +func (o *DAG) SetTags(v []Tag) { + o.Tags = v } -// SetNextDagrunCreateAfterNil sets the value for NextDagrunCreateAfter to be an explicit nil -func (o *DAG) SetNextDagrunCreateAfterNil() { - o.NextDagrunCreateAfter.Set(nil) + +// GetTimetableDescription returns the TimetableDescription field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAG) GetTimetableDescription() string { + if o == nil || IsNil(o.TimetableDescription.Get()) { + var ret string + return ret + } + return *o.TimetableDescription.Get() } -// UnsetNextDagrunCreateAfter ensures that no value is present for NextDagrunCreateAfter, not even an explicit nil -func (o *DAG) UnsetNextDagrunCreateAfter() { - o.NextDagrunCreateAfter.Unset() +// GetTimetableDescriptionOk returns a tuple with the TimetableDescription field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DAG) GetTimetableDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.TimetableDescription.Get(), o.TimetableDescription.IsSet() +} + +// HasTimetableDescription returns a boolean if a field has been set. +func (o *DAG) HasTimetableDescription() bool { + if o != nil && o.TimetableDescription.IsSet() { + return true + } + + return false +} + +// SetTimetableDescription gets a reference to the given NullableString and assigns it to the TimetableDescription field. +func (o *DAG) SetTimetableDescription(v string) { + o.TimetableDescription.Set(&v) +} +// SetTimetableDescriptionNil sets the value for TimetableDescription to be an explicit nil +func (o *DAG) SetTimetableDescriptionNil() { + o.TimetableDescription.Set(nil) +} + +// UnsetTimetableDescription ensures that no value is present for TimetableDescription, not even an explicit nil +func (o *DAG) UnsetTimetableDescription() { + o.TimetableDescription.Unset() } func (o DAG) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DAG) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.DagId != nil { + if !IsNil(o.DagDisplayName) { + toSerialize["dag_display_name"] = o.DagDisplayName + } + if !IsNil(o.DagId) { toSerialize["dag_id"] = o.DagId } - if o.RootDagId.IsSet() { - toSerialize["root_dag_id"] = o.RootDagId.Get() + if o.DefaultView.IsSet() { + toSerialize["default_view"] = o.DefaultView.Get() } - if o.IsPaused.IsSet() { - toSerialize["is_paused"] = o.IsPaused.Get() + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() + } + if !IsNil(o.FileToken) { + toSerialize["file_token"] = o.FileToken + } + if !IsNil(o.Fileloc) { + toSerialize["fileloc"] = o.Fileloc + } + if o.HasImportErrors.IsSet() { + toSerialize["has_import_errors"] = o.HasImportErrors.Get() + } + if o.HasTaskConcurrencyLimits.IsSet() { + toSerialize["has_task_concurrency_limits"] = o.HasTaskConcurrencyLimits.Get() } if o.IsActive.IsSet() { toSerialize["is_active"] = o.IsActive.Get() } - if o.IsSubdag != nil { + if o.IsPaused.IsSet() { + toSerialize["is_paused"] = o.IsPaused.Get() + } + if !IsNil(o.IsSubdag) { toSerialize["is_subdag"] = o.IsSubdag } + if o.LastExpired.IsSet() { + toSerialize["last_expired"] = o.LastExpired.Get() + } if o.LastParsedTime.IsSet() { toSerialize["last_parsed_time"] = o.LastParsedTime.Get() } if o.LastPickled.IsSet() { toSerialize["last_pickled"] = o.LastPickled.Get() } - if o.LastExpired.IsSet() { - toSerialize["last_expired"] = o.LastExpired.Get() + if o.MaxActiveRuns.IsSet() { + toSerialize["max_active_runs"] = o.MaxActiveRuns.Get() } - if o.SchedulerLock.IsSet() { - toSerialize["scheduler_lock"] = o.SchedulerLock.Get() + if o.MaxActiveTasks.IsSet() { + toSerialize["max_active_tasks"] = o.MaxActiveTasks.Get() } - if o.PickleId.IsSet() { - toSerialize["pickle_id"] = o.PickleId.Get() + if o.MaxConsecutiveFailedDagRuns.IsSet() { + toSerialize["max_consecutive_failed_dag_runs"] = o.MaxConsecutiveFailedDagRuns.Get() } - if o.DefaultView.IsSet() { - toSerialize["default_view"] = o.DefaultView.Get() + if o.NextDagrun.IsSet() { + toSerialize["next_dagrun"] = o.NextDagrun.Get() } - if o.Fileloc != nil { - toSerialize["fileloc"] = o.Fileloc + if o.NextDagrunCreateAfter.IsSet() { + toSerialize["next_dagrun_create_after"] = o.NextDagrunCreateAfter.Get() } - if o.FileToken != nil { - toSerialize["file_token"] = o.FileToken + if o.NextDagrunDataIntervalEnd.IsSet() { + toSerialize["next_dagrun_data_interval_end"] = o.NextDagrunDataIntervalEnd.Get() } - if o.Owners != nil { + if o.NextDagrunDataIntervalStart.IsSet() { + toSerialize["next_dagrun_data_interval_start"] = o.NextDagrunDataIntervalStart.Get() + } + if !IsNil(o.Owners) { toSerialize["owners"] = o.Owners } - if o.Description.IsSet() { - toSerialize["description"] = o.Description.Get() + if o.PickleId.IsSet() { + toSerialize["pickle_id"] = o.PickleId.Get() + } + if o.RootDagId.IsSet() { + toSerialize["root_dag_id"] = o.RootDagId.Get() } if o.ScheduleInterval.IsSet() { toSerialize["schedule_interval"] = o.ScheduleInterval.Get() } - if o.TimetableDescription.IsSet() { - toSerialize["timetable_description"] = o.TimetableDescription.Get() + if o.SchedulerLock.IsSet() { + toSerialize["scheduler_lock"] = o.SchedulerLock.Get() } if o.Tags != nil { toSerialize["tags"] = o.Tags } - if o.MaxActiveTasks.IsSet() { - toSerialize["max_active_tasks"] = o.MaxActiveTasks.Get() - } - if o.MaxActiveRuns.IsSet() { - toSerialize["max_active_runs"] = o.MaxActiveRuns.Get() - } - if o.HasTaskConcurrencyLimits.IsSet() { - toSerialize["has_task_concurrency_limits"] = o.HasTaskConcurrencyLimits.Get() - } - if o.HasImportErrors.IsSet() { - toSerialize["has_import_errors"] = o.HasImportErrors.Get() - } - if o.NextDagrun.IsSet() { - toSerialize["next_dagrun"] = o.NextDagrun.Get() - } - if o.NextDagrunDataIntervalStart.IsSet() { - toSerialize["next_dagrun_data_interval_start"] = o.NextDagrunDataIntervalStart.Get() - } - if o.NextDagrunDataIntervalEnd.IsSet() { - toSerialize["next_dagrun_data_interval_end"] = o.NextDagrunDataIntervalEnd.Get() - } - if o.NextDagrunCreateAfter.IsSet() { - toSerialize["next_dagrun_create_after"] = o.NextDagrunCreateAfter.Get() + if o.TimetableDescription.IsSet() { + toSerialize["timetable_description"] = o.TimetableDescription.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableDAG struct { diff --git a/airflow/model_dag_collection.go b/airflow/model_dag_collection.go index 1633a43..108952d 100644 --- a/airflow/model_dag_collection.go +++ b/airflow/model_dag_collection.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,11 +15,14 @@ import ( "encoding/json" ) +// checks if the DAGCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DAGCollection{} + // DAGCollection Collection of DAGs. *Changed in version 2.1.0*: 'total_entries' field is added. type DAGCollection struct { - Dags *[]DAG `json:"dags,omitempty"` - // Count of objects in the current result set. + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. TotalEntries *int32 `json:"total_entries,omitempty"` + Dags []DAG `json:"dags,omitempty"` } // NewDAGCollection instantiates a new DAGCollection object @@ -56,79 +42,87 @@ func NewDAGCollectionWithDefaults() *DAGCollection { return &this } -// GetDags returns the Dags field value if set, zero value otherwise. -func (o *DAGCollection) GetDags() []DAG { - if o == nil || o.Dags == nil { - var ret []DAG +// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. +func (o *DAGCollection) GetTotalEntries() int32 { + if o == nil || IsNil(o.TotalEntries) { + var ret int32 return ret } - return *o.Dags + return *o.TotalEntries } -// GetDagsOk returns a tuple with the Dags field value if set, nil otherwise +// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DAGCollection) GetDagsOk() (*[]DAG, bool) { - if o == nil || o.Dags == nil { +func (o *DAGCollection) GetTotalEntriesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalEntries) { return nil, false } - return o.Dags, true + return o.TotalEntries, true } -// HasDags returns a boolean if a field has been set. -func (o *DAGCollection) HasDags() bool { - if o != nil && o.Dags != nil { +// HasTotalEntries returns a boolean if a field has been set. +func (o *DAGCollection) HasTotalEntries() bool { + if o != nil && !IsNil(o.TotalEntries) { return true } return false } -// SetDags gets a reference to the given []DAG and assigns it to the Dags field. -func (o *DAGCollection) SetDags(v []DAG) { - o.Dags = &v +// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. +func (o *DAGCollection) SetTotalEntries(v int32) { + o.TotalEntries = &v } -// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. -func (o *DAGCollection) GetTotalEntries() int32 { - if o == nil || o.TotalEntries == nil { - var ret int32 +// GetDags returns the Dags field value if set, zero value otherwise. +func (o *DAGCollection) GetDags() []DAG { + if o == nil || IsNil(o.Dags) { + var ret []DAG return ret } - return *o.TotalEntries + return o.Dags } -// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise +// GetDagsOk returns a tuple with the Dags field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DAGCollection) GetTotalEntriesOk() (*int32, bool) { - if o == nil || o.TotalEntries == nil { +func (o *DAGCollection) GetDagsOk() ([]DAG, bool) { + if o == nil || IsNil(o.Dags) { return nil, false } - return o.TotalEntries, true + return o.Dags, true } -// HasTotalEntries returns a boolean if a field has been set. -func (o *DAGCollection) HasTotalEntries() bool { - if o != nil && o.TotalEntries != nil { +// HasDags returns a boolean if a field has been set. +func (o *DAGCollection) HasDags() bool { + if o != nil && !IsNil(o.Dags) { return true } return false } -// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. -func (o *DAGCollection) SetTotalEntries(v int32) { - o.TotalEntries = &v +// SetDags gets a reference to the given []DAG and assigns it to the Dags field. +func (o *DAGCollection) SetDags(v []DAG) { + o.Dags = v } func (o DAGCollection) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Dags != nil { - toSerialize["dags"] = o.Dags + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.TotalEntries != nil { + return json.Marshal(toSerialize) +} + +func (o DAGCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalEntries) { toSerialize["total_entries"] = o.TotalEntries } - return json.Marshal(toSerialize) + if !IsNil(o.Dags) { + toSerialize["dags"] = o.Dags + } + return toSerialize, nil } type NullableDAGCollection struct { diff --git a/airflow/model_dag_detail.go b/airflow/model_dag_detail.go index 3b3dfc0..0baff26 100644 --- a/airflow/model_dag_detail.go +++ b/airflow/model_dag_detail.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -33,77 +16,86 @@ import ( "time" ) -// DAGDetail DAG details. For details see: [airflow.models.DAG](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/models/index.html#airflow.models.DAG) +// checks if the DAGDetail type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DAGDetail{} + +// DAGDetail DAG details. For details see: [airflow.models.dag.DAG](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/models/dag/index.html#airflow.models.dag.DAG) type DAGDetail struct { + // Human centric display text for the DAG. *New in version 2.9.0* + DagDisplayName *string `json:"dag_display_name,omitempty"` // The ID of the DAG. DagId *string `json:"dag_id,omitempty"` - // If the DAG is SubDAG then it is the top level DAG identifier. Otherwise, null. - RootDagId NullableString `json:"root_dag_id,omitempty"` - // Whether the DAG is paused. - IsPaused NullableBool `json:"is_paused,omitempty"` + DefaultView NullableString `json:"default_view,omitempty"` + // User-provided DAG description, which can consist of several sentences or paragraphs that describe DAG contents. + Description NullableString `json:"description,omitempty"` + // The key containing the encrypted path to the file. Encryption and decryption take place only on the server. This prevents the client from reading an non-DAG file. This also ensures API extensibility, because the format of encrypted data may change. + FileToken *string `json:"file_token,omitempty"` + // The absolute path to the file. + Fileloc *string `json:"fileloc,omitempty"` + // Whether the DAG has import errors *New in version 2.3.0* + HasImportErrors NullableBool `json:"has_import_errors,omitempty"` + // Whether the DAG has task concurrency limits *New in version 2.3.0* + HasTaskConcurrencyLimits NullableBool `json:"has_task_concurrency_limits,omitempty"` // Whether the DAG is currently seen by the scheduler(s). *New in version 2.1.1* *Changed in version 2.2.0*: Field is read-only. IsActive NullableBool `json:"is_active,omitempty"` + // Whether the DAG is paused. + IsPaused NullableBool `json:"is_paused,omitempty"` // Whether the DAG is SubDAG. IsSubdag *bool `json:"is_subdag,omitempty"` + // Time when the DAG last received a refresh signal (e.g. the DAG's \"refresh\" button was clicked in the web UI) *New in version 2.3.0* + LastExpired NullableTime `json:"last_expired,omitempty"` // The last time the DAG was parsed. *New in version 2.3.0* LastParsedTime NullableTime `json:"last_parsed_time,omitempty"` // The last time the DAG was pickled. *New in version 2.3.0* LastPickled NullableTime `json:"last_pickled,omitempty"` - // Time when the DAG last received a refresh signal (e.g. the DAG's \"refresh\" button was clicked in the web UI) *New in version 2.3.0* - LastExpired NullableTime `json:"last_expired,omitempty"` - // Whether (one of) the scheduler is scheduling this DAG at the moment *New in version 2.3.0* - SchedulerLock NullableBool `json:"scheduler_lock,omitempty"` - // Foreign key to the latest pickle_id *New in version 2.3.0* - PickleId NullableString `json:"pickle_id,omitempty"` - DefaultView *string `json:"default_view,omitempty"` - // The absolute path to the file. - Fileloc *string `json:"fileloc,omitempty"` - // The key containing the encrypted path to the file. Encryption and decryption take place only on the server. This prevents the client from reading an non-DAG file. This also ensures API extensibility, because the format of encrypted data may change. - FileToken *string `json:"file_token,omitempty"` - Owners *[]string `json:"owners,omitempty"` - // User-provided DAG description, which can consist of several sentences or paragraphs that describe DAG contents. - Description NullableString `json:"description,omitempty"` - ScheduleInterval NullableScheduleInterval `json:"schedule_interval,omitempty"` - // Timetable/Schedule Interval description. *New in version 2.3.0* - TimetableDescription NullableString `json:"timetable_description,omitempty"` - // List of tags. - Tags []Tag `json:"tags,omitempty"` - // Maximum number of active tasks that can be run on the DAG *New in version 2.3.0* - MaxActiveTasks NullableInt32 `json:"max_active_tasks,omitempty"` // Maximum number of active DAG runs for the DAG *New in version 2.3.0* MaxActiveRuns NullableInt32 `json:"max_active_runs,omitempty"` - // Whether the DAG has task concurrency limits *New in version 2.3.0* - HasTaskConcurrencyLimits NullableBool `json:"has_task_concurrency_limits,omitempty"` - // Whether the DAG has import errors *New in version 2.3.0* - HasImportErrors NullableBool `json:"has_import_errors,omitempty"` + // Maximum number of active tasks that can be run on the DAG *New in version 2.3.0* + MaxActiveTasks NullableInt32 `json:"max_active_tasks,omitempty"` + // (experimental) The maximum number of consecutive DAG failures before DAG is automatically paused. *New in version 2.9.0* + MaxConsecutiveFailedDagRuns NullableInt32 `json:"max_consecutive_failed_dag_runs,omitempty"` // The logical date of the next dag run. *New in version 2.3.0* NextDagrun NullableTime `json:"next_dagrun,omitempty"` - // The start of the interval of the next dag run. *New in version 2.3.0* - NextDagrunDataIntervalStart NullableTime `json:"next_dagrun_data_interval_start,omitempty"` - // The end of the interval of the next dag run. *New in version 2.3.0* - NextDagrunDataIntervalEnd NullableTime `json:"next_dagrun_data_interval_end,omitempty"` // Earliest time at which this ``next_dagrun`` can be created. *New in version 2.3.0* NextDagrunCreateAfter NullableTime `json:"next_dagrun_create_after,omitempty"` - Timezone *string `json:"timezone,omitempty"` - Catchup *bool `json:"catchup,omitempty"` - Orientation *string `json:"orientation,omitempty"` - Concurrency *float32 `json:"concurrency,omitempty"` - // The DAG's start date. *Changed in version 2.0.1*: Field becomes nullable. - StartDate NullableTime `json:"start_date,omitempty"` - DagRunTimeout *TimeDelta `json:"dag_run_timeout,omitempty"` + // The end of the interval of the next dag run. *New in version 2.3.0* + NextDagrunDataIntervalEnd NullableTime `json:"next_dagrun_data_interval_end,omitempty"` + // The start of the interval of the next dag run. *New in version 2.3.0* + NextDagrunDataIntervalStart NullableTime `json:"next_dagrun_data_interval_start,omitempty"` + Owners []string `json:"owners,omitempty"` + // Foreign key to the latest pickle_id *New in version 2.3.0* + PickleId NullableString `json:"pickle_id,omitempty"` + // If the DAG is SubDAG then it is the top level DAG identifier. Otherwise, null. + RootDagId NullableString `json:"root_dag_id,omitempty"` + ScheduleInterval NullableScheduleInterval `json:"schedule_interval,omitempty"` + // Whether (one of) the scheduler is scheduling this DAG at the moment *New in version 2.3.0* + SchedulerLock NullableBool `json:"scheduler_lock,omitempty"` + // List of tags. + Tags []Tag `json:"tags,omitempty"` + // Timetable/Schedule Interval description. *New in version 2.3.0* + TimetableDescription NullableString `json:"timetable_description,omitempty"` + Catchup NullableBool `json:"catchup,omitempty"` + Concurrency NullableFloat32 `json:"concurrency,omitempty"` + DagRunTimeout NullableTimeDelta `json:"dag_run_timeout,omitempty"` + // Nested dataset any/all conditions + DatasetExpression map[string]interface{} `json:"dataset_expression,omitempty"` DocMd NullableString `json:"doc_md,omitempty"` - // User-specified DAG params. *New in version 2.0.1* - Params *map[string]interface{} `json:"params,omitempty"` // The DAG's end date. *New in version 2.3.0*. EndDate NullableTime `json:"end_date,omitempty"` // Whether the DAG is paused upon creation. *New in version 2.3.0* IsPausedUponCreation NullableBool `json:"is_paused_upon_creation,omitempty"` // The last time the DAG was parsed. *New in version 2.3.0* LastParsed NullableTime `json:"last_parsed,omitempty"` - // The template search path. *New in version 2.3.0* - TemplateSearchPath []string `json:"template_search_path,omitempty"` + Orientation NullableString `json:"orientation,omitempty"` + // User-specified DAG params. *New in version 2.0.1* + Params map[string]interface{} `json:"params,omitempty"` // Whether to render templates as native Python objects. *New in version 2.3.0* RenderTemplateAsNativeObj NullableBool `json:"render_template_as_native_obj,omitempty"` + // The DAG's start date. *Changed in version 2.0.1*: Field becomes nullable. + StartDate NullableTime `json:"start_date,omitempty"` + // The template search path. *New in version 2.3.0* + TemplateSearchPath []string `json:"template_search_path,omitempty"` + Timezone *string `json:"timezone,omitempty"` } // NewDAGDetail instantiates a new DAGDetail object @@ -123,9 +115,41 @@ func NewDAGDetailWithDefaults() *DAGDetail { return &this } +// GetDagDisplayName returns the DagDisplayName field value if set, zero value otherwise. +func (o *DAGDetail) GetDagDisplayName() string { + if o == nil || IsNil(o.DagDisplayName) { + var ret string + return ret + } + return *o.DagDisplayName +} + +// GetDagDisplayNameOk returns a tuple with the DagDisplayName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DAGDetail) GetDagDisplayNameOk() (*string, bool) { + if o == nil || IsNil(o.DagDisplayName) { + return nil, false + } + return o.DagDisplayName, true +} + +// HasDagDisplayName returns a boolean if a field has been set. +func (o *DAGDetail) HasDagDisplayName() bool { + if o != nil && !IsNil(o.DagDisplayName) { + return true + } + + return false +} + +// SetDagDisplayName gets a reference to the given string and assigns it to the DagDisplayName field. +func (o *DAGDetail) SetDagDisplayName(v string) { + o.DagDisplayName = &v +} + // GetDagId returns the DagId field value if set, zero value otherwise. func (o *DAGDetail) GetDagId() string { - if o == nil || o.DagId == nil { + if o == nil || IsNil(o.DagId) { var ret string return ret } @@ -135,7 +159,7 @@ func (o *DAGDetail) GetDagId() string { // GetDagIdOk returns a tuple with the DagId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *DAGDetail) GetDagIdOk() (*string, bool) { - if o == nil || o.DagId == nil { + if o == nil || IsNil(o.DagId) { return nil, false } return o.DagId, true @@ -143,7 +167,7 @@ func (o *DAGDetail) GetDagIdOk() (*string, bool) { // HasDagId returns a boolean if a field has been set. func (o *DAGDetail) HasDagId() bool { - if o != nil && o.DagId != nil { + if o != nil && !IsNil(o.DagId) { return true } @@ -155,1202 +179,1211 @@ func (o *DAGDetail) SetDagId(v string) { o.DagId = &v } -// GetRootDagId returns the RootDagId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGDetail) GetRootDagId() string { - if o == nil || o.RootDagId.Get() == nil { +// GetDefaultView returns the DefaultView field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetDefaultView() string { + if o == nil || IsNil(o.DefaultView.Get()) { var ret string return ret } - return *o.RootDagId.Get() + return *o.DefaultView.Get() } -// GetRootDagIdOk returns a tuple with the RootDagId field value if set, nil otherwise +// GetDefaultViewOk returns a tuple with the DefaultView field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGDetail) GetRootDagIdOk() (*string, bool) { - if o == nil { +func (o *DAGDetail) GetDefaultViewOk() (*string, bool) { + if o == nil { return nil, false } - return o.RootDagId.Get(), o.RootDagId.IsSet() + return o.DefaultView.Get(), o.DefaultView.IsSet() } -// HasRootDagId returns a boolean if a field has been set. -func (o *DAGDetail) HasRootDagId() bool { - if o != nil && o.RootDagId.IsSet() { +// HasDefaultView returns a boolean if a field has been set. +func (o *DAGDetail) HasDefaultView() bool { + if o != nil && o.DefaultView.IsSet() { return true } return false } -// SetRootDagId gets a reference to the given NullableString and assigns it to the RootDagId field. -func (o *DAGDetail) SetRootDagId(v string) { - o.RootDagId.Set(&v) +// SetDefaultView gets a reference to the given NullableString and assigns it to the DefaultView field. +func (o *DAGDetail) SetDefaultView(v string) { + o.DefaultView.Set(&v) } -// SetRootDagIdNil sets the value for RootDagId to be an explicit nil -func (o *DAGDetail) SetRootDagIdNil() { - o.RootDagId.Set(nil) +// SetDefaultViewNil sets the value for DefaultView to be an explicit nil +func (o *DAGDetail) SetDefaultViewNil() { + o.DefaultView.Set(nil) } -// UnsetRootDagId ensures that no value is present for RootDagId, not even an explicit nil -func (o *DAGDetail) UnsetRootDagId() { - o.RootDagId.Unset() +// UnsetDefaultView ensures that no value is present for DefaultView, not even an explicit nil +func (o *DAGDetail) UnsetDefaultView() { + o.DefaultView.Unset() } -// GetIsPaused returns the IsPaused field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGDetail) GetIsPaused() bool { - if o == nil || o.IsPaused.Get() == nil { - var ret bool +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetDescription() string { + if o == nil || IsNil(o.Description.Get()) { + var ret string return ret } - return *o.IsPaused.Get() + return *o.Description.Get() } -// GetIsPausedOk returns a tuple with the IsPaused field value if set, nil otherwise +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGDetail) GetIsPausedOk() (*bool, bool) { - if o == nil { +func (o *DAGDetail) GetDescriptionOk() (*string, bool) { + if o == nil { return nil, false } - return o.IsPaused.Get(), o.IsPaused.IsSet() + return o.Description.Get(), o.Description.IsSet() } -// HasIsPaused returns a boolean if a field has been set. -func (o *DAGDetail) HasIsPaused() bool { - if o != nil && o.IsPaused.IsSet() { +// HasDescription returns a boolean if a field has been set. +func (o *DAGDetail) HasDescription() bool { + if o != nil && o.Description.IsSet() { return true } return false } -// SetIsPaused gets a reference to the given NullableBool and assigns it to the IsPaused field. -func (o *DAGDetail) SetIsPaused(v bool) { - o.IsPaused.Set(&v) +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. +func (o *DAGDetail) SetDescription(v string) { + o.Description.Set(&v) } -// SetIsPausedNil sets the value for IsPaused to be an explicit nil -func (o *DAGDetail) SetIsPausedNil() { - o.IsPaused.Set(nil) +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *DAGDetail) SetDescriptionNil() { + o.Description.Set(nil) } -// UnsetIsPaused ensures that no value is present for IsPaused, not even an explicit nil -func (o *DAGDetail) UnsetIsPaused() { - o.IsPaused.Unset() +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *DAGDetail) UnsetDescription() { + o.Description.Unset() } -// GetIsActive returns the IsActive field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGDetail) GetIsActive() bool { - if o == nil || o.IsActive.Get() == nil { - var ret bool +// GetFileToken returns the FileToken field value if set, zero value otherwise. +func (o *DAGDetail) GetFileToken() string { + if o == nil || IsNil(o.FileToken) { + var ret string return ret } - return *o.IsActive.Get() + return *o.FileToken } -// GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise +// GetFileTokenOk returns a tuple with the FileToken field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGDetail) GetIsActiveOk() (*bool, bool) { - if o == nil { +func (o *DAGDetail) GetFileTokenOk() (*string, bool) { + if o == nil || IsNil(o.FileToken) { return nil, false } - return o.IsActive.Get(), o.IsActive.IsSet() + return o.FileToken, true } -// HasIsActive returns a boolean if a field has been set. -func (o *DAGDetail) HasIsActive() bool { - if o != nil && o.IsActive.IsSet() { +// HasFileToken returns a boolean if a field has been set. +func (o *DAGDetail) HasFileToken() bool { + if o != nil && !IsNil(o.FileToken) { return true } return false } -// SetIsActive gets a reference to the given NullableBool and assigns it to the IsActive field. -func (o *DAGDetail) SetIsActive(v bool) { - o.IsActive.Set(&v) -} -// SetIsActiveNil sets the value for IsActive to be an explicit nil -func (o *DAGDetail) SetIsActiveNil() { - o.IsActive.Set(nil) -} - -// UnsetIsActive ensures that no value is present for IsActive, not even an explicit nil -func (o *DAGDetail) UnsetIsActive() { - o.IsActive.Unset() +// SetFileToken gets a reference to the given string and assigns it to the FileToken field. +func (o *DAGDetail) SetFileToken(v string) { + o.FileToken = &v } -// GetIsSubdag returns the IsSubdag field value if set, zero value otherwise. -func (o *DAGDetail) GetIsSubdag() bool { - if o == nil || o.IsSubdag == nil { - var ret bool +// GetFileloc returns the Fileloc field value if set, zero value otherwise. +func (o *DAGDetail) GetFileloc() string { + if o == nil || IsNil(o.Fileloc) { + var ret string return ret } - return *o.IsSubdag + return *o.Fileloc } -// GetIsSubdagOk returns a tuple with the IsSubdag field value if set, nil otherwise +// GetFilelocOk returns a tuple with the Fileloc field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DAGDetail) GetIsSubdagOk() (*bool, bool) { - if o == nil || o.IsSubdag == nil { +func (o *DAGDetail) GetFilelocOk() (*string, bool) { + if o == nil || IsNil(o.Fileloc) { return nil, false } - return o.IsSubdag, true + return o.Fileloc, true } -// HasIsSubdag returns a boolean if a field has been set. -func (o *DAGDetail) HasIsSubdag() bool { - if o != nil && o.IsSubdag != nil { +// HasFileloc returns a boolean if a field has been set. +func (o *DAGDetail) HasFileloc() bool { + if o != nil && !IsNil(o.Fileloc) { return true } return false } -// SetIsSubdag gets a reference to the given bool and assigns it to the IsSubdag field. -func (o *DAGDetail) SetIsSubdag(v bool) { - o.IsSubdag = &v +// SetFileloc gets a reference to the given string and assigns it to the Fileloc field. +func (o *DAGDetail) SetFileloc(v string) { + o.Fileloc = &v } -// GetLastParsedTime returns the LastParsedTime field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGDetail) GetLastParsedTime() time.Time { - if o == nil || o.LastParsedTime.Get() == nil { - var ret time.Time +// GetHasImportErrors returns the HasImportErrors field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetHasImportErrors() bool { + if o == nil || IsNil(o.HasImportErrors.Get()) { + var ret bool return ret } - return *o.LastParsedTime.Get() + return *o.HasImportErrors.Get() } -// GetLastParsedTimeOk returns a tuple with the LastParsedTime field value if set, nil otherwise +// GetHasImportErrorsOk returns a tuple with the HasImportErrors field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGDetail) GetLastParsedTimeOk() (*time.Time, bool) { - if o == nil { +func (o *DAGDetail) GetHasImportErrorsOk() (*bool, bool) { + if o == nil { return nil, false } - return o.LastParsedTime.Get(), o.LastParsedTime.IsSet() + return o.HasImportErrors.Get(), o.HasImportErrors.IsSet() } -// HasLastParsedTime returns a boolean if a field has been set. -func (o *DAGDetail) HasLastParsedTime() bool { - if o != nil && o.LastParsedTime.IsSet() { +// HasHasImportErrors returns a boolean if a field has been set. +func (o *DAGDetail) HasHasImportErrors() bool { + if o != nil && o.HasImportErrors.IsSet() { return true } return false } -// SetLastParsedTime gets a reference to the given NullableTime and assigns it to the LastParsedTime field. -func (o *DAGDetail) SetLastParsedTime(v time.Time) { - o.LastParsedTime.Set(&v) +// SetHasImportErrors gets a reference to the given NullableBool and assigns it to the HasImportErrors field. +func (o *DAGDetail) SetHasImportErrors(v bool) { + o.HasImportErrors.Set(&v) } -// SetLastParsedTimeNil sets the value for LastParsedTime to be an explicit nil -func (o *DAGDetail) SetLastParsedTimeNil() { - o.LastParsedTime.Set(nil) +// SetHasImportErrorsNil sets the value for HasImportErrors to be an explicit nil +func (o *DAGDetail) SetHasImportErrorsNil() { + o.HasImportErrors.Set(nil) } -// UnsetLastParsedTime ensures that no value is present for LastParsedTime, not even an explicit nil -func (o *DAGDetail) UnsetLastParsedTime() { - o.LastParsedTime.Unset() +// UnsetHasImportErrors ensures that no value is present for HasImportErrors, not even an explicit nil +func (o *DAGDetail) UnsetHasImportErrors() { + o.HasImportErrors.Unset() } -// GetLastPickled returns the LastPickled field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGDetail) GetLastPickled() time.Time { - if o == nil || o.LastPickled.Get() == nil { - var ret time.Time +// GetHasTaskConcurrencyLimits returns the HasTaskConcurrencyLimits field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetHasTaskConcurrencyLimits() bool { + if o == nil || IsNil(o.HasTaskConcurrencyLimits.Get()) { + var ret bool return ret } - return *o.LastPickled.Get() + return *o.HasTaskConcurrencyLimits.Get() } -// GetLastPickledOk returns a tuple with the LastPickled field value if set, nil otherwise +// GetHasTaskConcurrencyLimitsOk returns a tuple with the HasTaskConcurrencyLimits field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGDetail) GetLastPickledOk() (*time.Time, bool) { - if o == nil { +func (o *DAGDetail) GetHasTaskConcurrencyLimitsOk() (*bool, bool) { + if o == nil { return nil, false } - return o.LastPickled.Get(), o.LastPickled.IsSet() + return o.HasTaskConcurrencyLimits.Get(), o.HasTaskConcurrencyLimits.IsSet() } -// HasLastPickled returns a boolean if a field has been set. -func (o *DAGDetail) HasLastPickled() bool { - if o != nil && o.LastPickled.IsSet() { +// HasHasTaskConcurrencyLimits returns a boolean if a field has been set. +func (o *DAGDetail) HasHasTaskConcurrencyLimits() bool { + if o != nil && o.HasTaskConcurrencyLimits.IsSet() { return true } return false } -// SetLastPickled gets a reference to the given NullableTime and assigns it to the LastPickled field. -func (o *DAGDetail) SetLastPickled(v time.Time) { - o.LastPickled.Set(&v) +// SetHasTaskConcurrencyLimits gets a reference to the given NullableBool and assigns it to the HasTaskConcurrencyLimits field. +func (o *DAGDetail) SetHasTaskConcurrencyLimits(v bool) { + o.HasTaskConcurrencyLimits.Set(&v) } -// SetLastPickledNil sets the value for LastPickled to be an explicit nil -func (o *DAGDetail) SetLastPickledNil() { - o.LastPickled.Set(nil) +// SetHasTaskConcurrencyLimitsNil sets the value for HasTaskConcurrencyLimits to be an explicit nil +func (o *DAGDetail) SetHasTaskConcurrencyLimitsNil() { + o.HasTaskConcurrencyLimits.Set(nil) } -// UnsetLastPickled ensures that no value is present for LastPickled, not even an explicit nil -func (o *DAGDetail) UnsetLastPickled() { - o.LastPickled.Unset() +// UnsetHasTaskConcurrencyLimits ensures that no value is present for HasTaskConcurrencyLimits, not even an explicit nil +func (o *DAGDetail) UnsetHasTaskConcurrencyLimits() { + o.HasTaskConcurrencyLimits.Unset() } -// GetLastExpired returns the LastExpired field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGDetail) GetLastExpired() time.Time { - if o == nil || o.LastExpired.Get() == nil { - var ret time.Time +// GetIsActive returns the IsActive field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetIsActive() bool { + if o == nil || IsNil(o.IsActive.Get()) { + var ret bool return ret } - return *o.LastExpired.Get() + return *o.IsActive.Get() } -// GetLastExpiredOk returns a tuple with the LastExpired field value if set, nil otherwise +// GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGDetail) GetLastExpiredOk() (*time.Time, bool) { - if o == nil { +func (o *DAGDetail) GetIsActiveOk() (*bool, bool) { + if o == nil { return nil, false } - return o.LastExpired.Get(), o.LastExpired.IsSet() + return o.IsActive.Get(), o.IsActive.IsSet() } -// HasLastExpired returns a boolean if a field has been set. -func (o *DAGDetail) HasLastExpired() bool { - if o != nil && o.LastExpired.IsSet() { +// HasIsActive returns a boolean if a field has been set. +func (o *DAGDetail) HasIsActive() bool { + if o != nil && o.IsActive.IsSet() { return true } return false } -// SetLastExpired gets a reference to the given NullableTime and assigns it to the LastExpired field. -func (o *DAGDetail) SetLastExpired(v time.Time) { - o.LastExpired.Set(&v) +// SetIsActive gets a reference to the given NullableBool and assigns it to the IsActive field. +func (o *DAGDetail) SetIsActive(v bool) { + o.IsActive.Set(&v) } -// SetLastExpiredNil sets the value for LastExpired to be an explicit nil -func (o *DAGDetail) SetLastExpiredNil() { - o.LastExpired.Set(nil) +// SetIsActiveNil sets the value for IsActive to be an explicit nil +func (o *DAGDetail) SetIsActiveNil() { + o.IsActive.Set(nil) } -// UnsetLastExpired ensures that no value is present for LastExpired, not even an explicit nil -func (o *DAGDetail) UnsetLastExpired() { - o.LastExpired.Unset() +// UnsetIsActive ensures that no value is present for IsActive, not even an explicit nil +func (o *DAGDetail) UnsetIsActive() { + o.IsActive.Unset() } -// GetSchedulerLock returns the SchedulerLock field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGDetail) GetSchedulerLock() bool { - if o == nil || o.SchedulerLock.Get() == nil { +// GetIsPaused returns the IsPaused field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetIsPaused() bool { + if o == nil || IsNil(o.IsPaused.Get()) { var ret bool return ret } - return *o.SchedulerLock.Get() + return *o.IsPaused.Get() } -// GetSchedulerLockOk returns a tuple with the SchedulerLock field value if set, nil otherwise +// GetIsPausedOk returns a tuple with the IsPaused field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGDetail) GetSchedulerLockOk() (*bool, bool) { - if o == nil { +func (o *DAGDetail) GetIsPausedOk() (*bool, bool) { + if o == nil { return nil, false } - return o.SchedulerLock.Get(), o.SchedulerLock.IsSet() + return o.IsPaused.Get(), o.IsPaused.IsSet() } -// HasSchedulerLock returns a boolean if a field has been set. -func (o *DAGDetail) HasSchedulerLock() bool { - if o != nil && o.SchedulerLock.IsSet() { +// HasIsPaused returns a boolean if a field has been set. +func (o *DAGDetail) HasIsPaused() bool { + if o != nil && o.IsPaused.IsSet() { return true } return false } -// SetSchedulerLock gets a reference to the given NullableBool and assigns it to the SchedulerLock field. -func (o *DAGDetail) SetSchedulerLock(v bool) { - o.SchedulerLock.Set(&v) +// SetIsPaused gets a reference to the given NullableBool and assigns it to the IsPaused field. +func (o *DAGDetail) SetIsPaused(v bool) { + o.IsPaused.Set(&v) } -// SetSchedulerLockNil sets the value for SchedulerLock to be an explicit nil -func (o *DAGDetail) SetSchedulerLockNil() { - o.SchedulerLock.Set(nil) +// SetIsPausedNil sets the value for IsPaused to be an explicit nil +func (o *DAGDetail) SetIsPausedNil() { + o.IsPaused.Set(nil) } -// UnsetSchedulerLock ensures that no value is present for SchedulerLock, not even an explicit nil -func (o *DAGDetail) UnsetSchedulerLock() { - o.SchedulerLock.Unset() +// UnsetIsPaused ensures that no value is present for IsPaused, not even an explicit nil +func (o *DAGDetail) UnsetIsPaused() { + o.IsPaused.Unset() } -// GetPickleId returns the PickleId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGDetail) GetPickleId() string { - if o == nil || o.PickleId.Get() == nil { - var ret string +// GetIsSubdag returns the IsSubdag field value if set, zero value otherwise. +func (o *DAGDetail) GetIsSubdag() bool { + if o == nil || IsNil(o.IsSubdag) { + var ret bool return ret } - return *o.PickleId.Get() + return *o.IsSubdag } -// GetPickleIdOk returns a tuple with the PickleId field value if set, nil otherwise +// GetIsSubdagOk returns a tuple with the IsSubdag field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGDetail) GetPickleIdOk() (*string, bool) { - if o == nil { +func (o *DAGDetail) GetIsSubdagOk() (*bool, bool) { + if o == nil || IsNil(o.IsSubdag) { return nil, false } - return o.PickleId.Get(), o.PickleId.IsSet() + return o.IsSubdag, true } -// HasPickleId returns a boolean if a field has been set. -func (o *DAGDetail) HasPickleId() bool { - if o != nil && o.PickleId.IsSet() { +// HasIsSubdag returns a boolean if a field has been set. +func (o *DAGDetail) HasIsSubdag() bool { + if o != nil && !IsNil(o.IsSubdag) { return true } return false } -// SetPickleId gets a reference to the given NullableString and assigns it to the PickleId field. -func (o *DAGDetail) SetPickleId(v string) { - o.PickleId.Set(&v) -} -// SetPickleIdNil sets the value for PickleId to be an explicit nil -func (o *DAGDetail) SetPickleIdNil() { - o.PickleId.Set(nil) -} - -// UnsetPickleId ensures that no value is present for PickleId, not even an explicit nil -func (o *DAGDetail) UnsetPickleId() { - o.PickleId.Unset() +// SetIsSubdag gets a reference to the given bool and assigns it to the IsSubdag field. +func (o *DAGDetail) SetIsSubdag(v bool) { + o.IsSubdag = &v } -// GetDefaultView returns the DefaultView field value if set, zero value otherwise. -func (o *DAGDetail) GetDefaultView() string { - if o == nil || o.DefaultView == nil { - var ret string +// GetLastExpired returns the LastExpired field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetLastExpired() time.Time { + if o == nil || IsNil(o.LastExpired.Get()) { + var ret time.Time return ret } - return *o.DefaultView + return *o.LastExpired.Get() } -// GetDefaultViewOk returns a tuple with the DefaultView field value if set, nil otherwise +// GetLastExpiredOk returns a tuple with the LastExpired field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DAGDetail) GetDefaultViewOk() (*string, bool) { - if o == nil || o.DefaultView == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DAGDetail) GetLastExpiredOk() (*time.Time, bool) { + if o == nil { return nil, false } - return o.DefaultView, true + return o.LastExpired.Get(), o.LastExpired.IsSet() } -// HasDefaultView returns a boolean if a field has been set. -func (o *DAGDetail) HasDefaultView() bool { - if o != nil && o.DefaultView != nil { +// HasLastExpired returns a boolean if a field has been set. +func (o *DAGDetail) HasLastExpired() bool { + if o != nil && o.LastExpired.IsSet() { return true } return false } -// SetDefaultView gets a reference to the given string and assigns it to the DefaultView field. -func (o *DAGDetail) SetDefaultView(v string) { - o.DefaultView = &v +// SetLastExpired gets a reference to the given NullableTime and assigns it to the LastExpired field. +func (o *DAGDetail) SetLastExpired(v time.Time) { + o.LastExpired.Set(&v) +} +// SetLastExpiredNil sets the value for LastExpired to be an explicit nil +func (o *DAGDetail) SetLastExpiredNil() { + o.LastExpired.Set(nil) } -// GetFileloc returns the Fileloc field value if set, zero value otherwise. -func (o *DAGDetail) GetFileloc() string { - if o == nil || o.Fileloc == nil { - var ret string +// UnsetLastExpired ensures that no value is present for LastExpired, not even an explicit nil +func (o *DAGDetail) UnsetLastExpired() { + o.LastExpired.Unset() +} + +// GetLastParsedTime returns the LastParsedTime field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetLastParsedTime() time.Time { + if o == nil || IsNil(o.LastParsedTime.Get()) { + var ret time.Time return ret } - return *o.Fileloc + return *o.LastParsedTime.Get() } -// GetFilelocOk returns a tuple with the Fileloc field value if set, nil otherwise +// GetLastParsedTimeOk returns a tuple with the LastParsedTime field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DAGDetail) GetFilelocOk() (*string, bool) { - if o == nil || o.Fileloc == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DAGDetail) GetLastParsedTimeOk() (*time.Time, bool) { + if o == nil { return nil, false } - return o.Fileloc, true + return o.LastParsedTime.Get(), o.LastParsedTime.IsSet() } -// HasFileloc returns a boolean if a field has been set. -func (o *DAGDetail) HasFileloc() bool { - if o != nil && o.Fileloc != nil { +// HasLastParsedTime returns a boolean if a field has been set. +func (o *DAGDetail) HasLastParsedTime() bool { + if o != nil && o.LastParsedTime.IsSet() { return true } return false } -// SetFileloc gets a reference to the given string and assigns it to the Fileloc field. -func (o *DAGDetail) SetFileloc(v string) { - o.Fileloc = &v +// SetLastParsedTime gets a reference to the given NullableTime and assigns it to the LastParsedTime field. +func (o *DAGDetail) SetLastParsedTime(v time.Time) { + o.LastParsedTime.Set(&v) +} +// SetLastParsedTimeNil sets the value for LastParsedTime to be an explicit nil +func (o *DAGDetail) SetLastParsedTimeNil() { + o.LastParsedTime.Set(nil) } -// GetFileToken returns the FileToken field value if set, zero value otherwise. -func (o *DAGDetail) GetFileToken() string { - if o == nil || o.FileToken == nil { - var ret string +// UnsetLastParsedTime ensures that no value is present for LastParsedTime, not even an explicit nil +func (o *DAGDetail) UnsetLastParsedTime() { + o.LastParsedTime.Unset() +} + +// GetLastPickled returns the LastPickled field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetLastPickled() time.Time { + if o == nil || IsNil(o.LastPickled.Get()) { + var ret time.Time return ret } - return *o.FileToken + return *o.LastPickled.Get() } -// GetFileTokenOk returns a tuple with the FileToken field value if set, nil otherwise +// GetLastPickledOk returns a tuple with the LastPickled field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DAGDetail) GetFileTokenOk() (*string, bool) { - if o == nil || o.FileToken == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DAGDetail) GetLastPickledOk() (*time.Time, bool) { + if o == nil { return nil, false } - return o.FileToken, true + return o.LastPickled.Get(), o.LastPickled.IsSet() } -// HasFileToken returns a boolean if a field has been set. -func (o *DAGDetail) HasFileToken() bool { - if o != nil && o.FileToken != nil { +// HasLastPickled returns a boolean if a field has been set. +func (o *DAGDetail) HasLastPickled() bool { + if o != nil && o.LastPickled.IsSet() { return true } return false } -// SetFileToken gets a reference to the given string and assigns it to the FileToken field. -func (o *DAGDetail) SetFileToken(v string) { - o.FileToken = &v +// SetLastPickled gets a reference to the given NullableTime and assigns it to the LastPickled field. +func (o *DAGDetail) SetLastPickled(v time.Time) { + o.LastPickled.Set(&v) +} +// SetLastPickledNil sets the value for LastPickled to be an explicit nil +func (o *DAGDetail) SetLastPickledNil() { + o.LastPickled.Set(nil) } -// GetOwners returns the Owners field value if set, zero value otherwise. -func (o *DAGDetail) GetOwners() []string { - if o == nil || o.Owners == nil { - var ret []string +// UnsetLastPickled ensures that no value is present for LastPickled, not even an explicit nil +func (o *DAGDetail) UnsetLastPickled() { + o.LastPickled.Unset() +} + +// GetMaxActiveRuns returns the MaxActiveRuns field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetMaxActiveRuns() int32 { + if o == nil || IsNil(o.MaxActiveRuns.Get()) { + var ret int32 return ret } - return *o.Owners + return *o.MaxActiveRuns.Get() } -// GetOwnersOk returns a tuple with the Owners field value if set, nil otherwise +// GetMaxActiveRunsOk returns a tuple with the MaxActiveRuns field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DAGDetail) GetOwnersOk() (*[]string, bool) { - if o == nil || o.Owners == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DAGDetail) GetMaxActiveRunsOk() (*int32, bool) { + if o == nil { return nil, false } - return o.Owners, true + return o.MaxActiveRuns.Get(), o.MaxActiveRuns.IsSet() } -// HasOwners returns a boolean if a field has been set. -func (o *DAGDetail) HasOwners() bool { - if o != nil && o.Owners != nil { +// HasMaxActiveRuns returns a boolean if a field has been set. +func (o *DAGDetail) HasMaxActiveRuns() bool { + if o != nil && o.MaxActiveRuns.IsSet() { return true } return false } -// SetOwners gets a reference to the given []string and assigns it to the Owners field. -func (o *DAGDetail) SetOwners(v []string) { - o.Owners = &v +// SetMaxActiveRuns gets a reference to the given NullableInt32 and assigns it to the MaxActiveRuns field. +func (o *DAGDetail) SetMaxActiveRuns(v int32) { + o.MaxActiveRuns.Set(&v) +} +// SetMaxActiveRunsNil sets the value for MaxActiveRuns to be an explicit nil +func (o *DAGDetail) SetMaxActiveRunsNil() { + o.MaxActiveRuns.Set(nil) } -// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGDetail) GetDescription() string { - if o == nil || o.Description.Get() == nil { - var ret string +// UnsetMaxActiveRuns ensures that no value is present for MaxActiveRuns, not even an explicit nil +func (o *DAGDetail) UnsetMaxActiveRuns() { + o.MaxActiveRuns.Unset() +} + +// GetMaxActiveTasks returns the MaxActiveTasks field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetMaxActiveTasks() int32 { + if o == nil || IsNil(o.MaxActiveTasks.Get()) { + var ret int32 return ret } - return *o.Description.Get() + return *o.MaxActiveTasks.Get() } -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// GetMaxActiveTasksOk returns a tuple with the MaxActiveTasks field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGDetail) GetDescriptionOk() (*string, bool) { - if o == nil { +func (o *DAGDetail) GetMaxActiveTasksOk() (*int32, bool) { + if o == nil { return nil, false } - return o.Description.Get(), o.Description.IsSet() + return o.MaxActiveTasks.Get(), o.MaxActiveTasks.IsSet() } -// HasDescription returns a boolean if a field has been set. -func (o *DAGDetail) HasDescription() bool { - if o != nil && o.Description.IsSet() { +// HasMaxActiveTasks returns a boolean if a field has been set. +func (o *DAGDetail) HasMaxActiveTasks() bool { + if o != nil && o.MaxActiveTasks.IsSet() { return true } return false } -// SetDescription gets a reference to the given NullableString and assigns it to the Description field. -func (o *DAGDetail) SetDescription(v string) { - o.Description.Set(&v) +// SetMaxActiveTasks gets a reference to the given NullableInt32 and assigns it to the MaxActiveTasks field. +func (o *DAGDetail) SetMaxActiveTasks(v int32) { + o.MaxActiveTasks.Set(&v) } -// SetDescriptionNil sets the value for Description to be an explicit nil -func (o *DAGDetail) SetDescriptionNil() { - o.Description.Set(nil) +// SetMaxActiveTasksNil sets the value for MaxActiveTasks to be an explicit nil +func (o *DAGDetail) SetMaxActiveTasksNil() { + o.MaxActiveTasks.Set(nil) } -// UnsetDescription ensures that no value is present for Description, not even an explicit nil -func (o *DAGDetail) UnsetDescription() { - o.Description.Unset() +// UnsetMaxActiveTasks ensures that no value is present for MaxActiveTasks, not even an explicit nil +func (o *DAGDetail) UnsetMaxActiveTasks() { + o.MaxActiveTasks.Unset() } -// GetScheduleInterval returns the ScheduleInterval field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGDetail) GetScheduleInterval() ScheduleInterval { - if o == nil || o.ScheduleInterval.Get() == nil { - var ret ScheduleInterval +// GetMaxConsecutiveFailedDagRuns returns the MaxConsecutiveFailedDagRuns field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetMaxConsecutiveFailedDagRuns() int32 { + if o == nil || IsNil(o.MaxConsecutiveFailedDagRuns.Get()) { + var ret int32 return ret } - return *o.ScheduleInterval.Get() + return *o.MaxConsecutiveFailedDagRuns.Get() } -// GetScheduleIntervalOk returns a tuple with the ScheduleInterval field value if set, nil otherwise +// GetMaxConsecutiveFailedDagRunsOk returns a tuple with the MaxConsecutiveFailedDagRuns field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGDetail) GetScheduleIntervalOk() (*ScheduleInterval, bool) { - if o == nil { +func (o *DAGDetail) GetMaxConsecutiveFailedDagRunsOk() (*int32, bool) { + if o == nil { return nil, false } - return o.ScheduleInterval.Get(), o.ScheduleInterval.IsSet() + return o.MaxConsecutiveFailedDagRuns.Get(), o.MaxConsecutiveFailedDagRuns.IsSet() } -// HasScheduleInterval returns a boolean if a field has been set. -func (o *DAGDetail) HasScheduleInterval() bool { - if o != nil && o.ScheduleInterval.IsSet() { +// HasMaxConsecutiveFailedDagRuns returns a boolean if a field has been set. +func (o *DAGDetail) HasMaxConsecutiveFailedDagRuns() bool { + if o != nil && o.MaxConsecutiveFailedDagRuns.IsSet() { return true } return false } -// SetScheduleInterval gets a reference to the given NullableScheduleInterval and assigns it to the ScheduleInterval field. -func (o *DAGDetail) SetScheduleInterval(v ScheduleInterval) { - o.ScheduleInterval.Set(&v) +// SetMaxConsecutiveFailedDagRuns gets a reference to the given NullableInt32 and assigns it to the MaxConsecutiveFailedDagRuns field. +func (o *DAGDetail) SetMaxConsecutiveFailedDagRuns(v int32) { + o.MaxConsecutiveFailedDagRuns.Set(&v) } -// SetScheduleIntervalNil sets the value for ScheduleInterval to be an explicit nil -func (o *DAGDetail) SetScheduleIntervalNil() { - o.ScheduleInterval.Set(nil) +// SetMaxConsecutiveFailedDagRunsNil sets the value for MaxConsecutiveFailedDagRuns to be an explicit nil +func (o *DAGDetail) SetMaxConsecutiveFailedDagRunsNil() { + o.MaxConsecutiveFailedDagRuns.Set(nil) } -// UnsetScheduleInterval ensures that no value is present for ScheduleInterval, not even an explicit nil -func (o *DAGDetail) UnsetScheduleInterval() { - o.ScheduleInterval.Unset() +// UnsetMaxConsecutiveFailedDagRuns ensures that no value is present for MaxConsecutiveFailedDagRuns, not even an explicit nil +func (o *DAGDetail) UnsetMaxConsecutiveFailedDagRuns() { + o.MaxConsecutiveFailedDagRuns.Unset() } -// GetTimetableDescription returns the TimetableDescription field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGDetail) GetTimetableDescription() string { - if o == nil || o.TimetableDescription.Get() == nil { - var ret string +// GetNextDagrun returns the NextDagrun field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetNextDagrun() time.Time { + if o == nil || IsNil(o.NextDagrun.Get()) { + var ret time.Time return ret } - return *o.TimetableDescription.Get() + return *o.NextDagrun.Get() } -// GetTimetableDescriptionOk returns a tuple with the TimetableDescription field value if set, nil otherwise +// GetNextDagrunOk returns a tuple with the NextDagrun field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGDetail) GetTimetableDescriptionOk() (*string, bool) { - if o == nil { +func (o *DAGDetail) GetNextDagrunOk() (*time.Time, bool) { + if o == nil { return nil, false } - return o.TimetableDescription.Get(), o.TimetableDescription.IsSet() + return o.NextDagrun.Get(), o.NextDagrun.IsSet() } -// HasTimetableDescription returns a boolean if a field has been set. -func (o *DAGDetail) HasTimetableDescription() bool { - if o != nil && o.TimetableDescription.IsSet() { +// HasNextDagrun returns a boolean if a field has been set. +func (o *DAGDetail) HasNextDagrun() bool { + if o != nil && o.NextDagrun.IsSet() { return true } return false } -// SetTimetableDescription gets a reference to the given NullableString and assigns it to the TimetableDescription field. -func (o *DAGDetail) SetTimetableDescription(v string) { - o.TimetableDescription.Set(&v) +// SetNextDagrun gets a reference to the given NullableTime and assigns it to the NextDagrun field. +func (o *DAGDetail) SetNextDagrun(v time.Time) { + o.NextDagrun.Set(&v) } -// SetTimetableDescriptionNil sets the value for TimetableDescription to be an explicit nil -func (o *DAGDetail) SetTimetableDescriptionNil() { - o.TimetableDescription.Set(nil) +// SetNextDagrunNil sets the value for NextDagrun to be an explicit nil +func (o *DAGDetail) SetNextDagrunNil() { + o.NextDagrun.Set(nil) } -// UnsetTimetableDescription ensures that no value is present for TimetableDescription, not even an explicit nil -func (o *DAGDetail) UnsetTimetableDescription() { - o.TimetableDescription.Unset() +// UnsetNextDagrun ensures that no value is present for NextDagrun, not even an explicit nil +func (o *DAGDetail) UnsetNextDagrun() { + o.NextDagrun.Unset() } -// GetTags returns the Tags field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGDetail) GetTags() []Tag { - if o == nil { - var ret []Tag +// GetNextDagrunCreateAfter returns the NextDagrunCreateAfter field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetNextDagrunCreateAfter() time.Time { + if o == nil || IsNil(o.NextDagrunCreateAfter.Get()) { + var ret time.Time return ret } - return o.Tags + return *o.NextDagrunCreateAfter.Get() } -// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// GetNextDagrunCreateAfterOk returns a tuple with the NextDagrunCreateAfter field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGDetail) GetTagsOk() (*[]Tag, bool) { - if o == nil || o.Tags == nil { +func (o *DAGDetail) GetNextDagrunCreateAfterOk() (*time.Time, bool) { + if o == nil { return nil, false } - return &o.Tags, true + return o.NextDagrunCreateAfter.Get(), o.NextDagrunCreateAfter.IsSet() } -// HasTags returns a boolean if a field has been set. -func (o *DAGDetail) HasTags() bool { - if o != nil && o.Tags != nil { +// HasNextDagrunCreateAfter returns a boolean if a field has been set. +func (o *DAGDetail) HasNextDagrunCreateAfter() bool { + if o != nil && o.NextDagrunCreateAfter.IsSet() { return true } return false } -// SetTags gets a reference to the given []Tag and assigns it to the Tags field. -func (o *DAGDetail) SetTags(v []Tag) { - o.Tags = v +// SetNextDagrunCreateAfter gets a reference to the given NullableTime and assigns it to the NextDagrunCreateAfter field. +func (o *DAGDetail) SetNextDagrunCreateAfter(v time.Time) { + o.NextDagrunCreateAfter.Set(&v) +} +// SetNextDagrunCreateAfterNil sets the value for NextDagrunCreateAfter to be an explicit nil +func (o *DAGDetail) SetNextDagrunCreateAfterNil() { + o.NextDagrunCreateAfter.Set(nil) } -// GetMaxActiveTasks returns the MaxActiveTasks field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGDetail) GetMaxActiveTasks() int32 { - if o == nil || o.MaxActiveTasks.Get() == nil { - var ret int32 +// UnsetNextDagrunCreateAfter ensures that no value is present for NextDagrunCreateAfter, not even an explicit nil +func (o *DAGDetail) UnsetNextDagrunCreateAfter() { + o.NextDagrunCreateAfter.Unset() +} + +// GetNextDagrunDataIntervalEnd returns the NextDagrunDataIntervalEnd field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetNextDagrunDataIntervalEnd() time.Time { + if o == nil || IsNil(o.NextDagrunDataIntervalEnd.Get()) { + var ret time.Time return ret } - return *o.MaxActiveTasks.Get() + return *o.NextDagrunDataIntervalEnd.Get() } -// GetMaxActiveTasksOk returns a tuple with the MaxActiveTasks field value if set, nil otherwise +// GetNextDagrunDataIntervalEndOk returns a tuple with the NextDagrunDataIntervalEnd field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGDetail) GetMaxActiveTasksOk() (*int32, bool) { - if o == nil { +func (o *DAGDetail) GetNextDagrunDataIntervalEndOk() (*time.Time, bool) { + if o == nil { return nil, false } - return o.MaxActiveTasks.Get(), o.MaxActiveTasks.IsSet() + return o.NextDagrunDataIntervalEnd.Get(), o.NextDagrunDataIntervalEnd.IsSet() } -// HasMaxActiveTasks returns a boolean if a field has been set. -func (o *DAGDetail) HasMaxActiveTasks() bool { - if o != nil && o.MaxActiveTasks.IsSet() { +// HasNextDagrunDataIntervalEnd returns a boolean if a field has been set. +func (o *DAGDetail) HasNextDagrunDataIntervalEnd() bool { + if o != nil && o.NextDagrunDataIntervalEnd.IsSet() { return true } return false } -// SetMaxActiveTasks gets a reference to the given NullableInt32 and assigns it to the MaxActiveTasks field. -func (o *DAGDetail) SetMaxActiveTasks(v int32) { - o.MaxActiveTasks.Set(&v) +// SetNextDagrunDataIntervalEnd gets a reference to the given NullableTime and assigns it to the NextDagrunDataIntervalEnd field. +func (o *DAGDetail) SetNextDagrunDataIntervalEnd(v time.Time) { + o.NextDagrunDataIntervalEnd.Set(&v) } -// SetMaxActiveTasksNil sets the value for MaxActiveTasks to be an explicit nil -func (o *DAGDetail) SetMaxActiveTasksNil() { - o.MaxActiveTasks.Set(nil) +// SetNextDagrunDataIntervalEndNil sets the value for NextDagrunDataIntervalEnd to be an explicit nil +func (o *DAGDetail) SetNextDagrunDataIntervalEndNil() { + o.NextDagrunDataIntervalEnd.Set(nil) } -// UnsetMaxActiveTasks ensures that no value is present for MaxActiveTasks, not even an explicit nil -func (o *DAGDetail) UnsetMaxActiveTasks() { - o.MaxActiveTasks.Unset() +// UnsetNextDagrunDataIntervalEnd ensures that no value is present for NextDagrunDataIntervalEnd, not even an explicit nil +func (o *DAGDetail) UnsetNextDagrunDataIntervalEnd() { + o.NextDagrunDataIntervalEnd.Unset() } -// GetMaxActiveRuns returns the MaxActiveRuns field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGDetail) GetMaxActiveRuns() int32 { - if o == nil || o.MaxActiveRuns.Get() == nil { - var ret int32 +// GetNextDagrunDataIntervalStart returns the NextDagrunDataIntervalStart field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetNextDagrunDataIntervalStart() time.Time { + if o == nil || IsNil(o.NextDagrunDataIntervalStart.Get()) { + var ret time.Time return ret } - return *o.MaxActiveRuns.Get() + return *o.NextDagrunDataIntervalStart.Get() } -// GetMaxActiveRunsOk returns a tuple with the MaxActiveRuns field value if set, nil otherwise +// GetNextDagrunDataIntervalStartOk returns a tuple with the NextDagrunDataIntervalStart field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGDetail) GetMaxActiveRunsOk() (*int32, bool) { - if o == nil { +func (o *DAGDetail) GetNextDagrunDataIntervalStartOk() (*time.Time, bool) { + if o == nil { return nil, false } - return o.MaxActiveRuns.Get(), o.MaxActiveRuns.IsSet() + return o.NextDagrunDataIntervalStart.Get(), o.NextDagrunDataIntervalStart.IsSet() } -// HasMaxActiveRuns returns a boolean if a field has been set. -func (o *DAGDetail) HasMaxActiveRuns() bool { - if o != nil && o.MaxActiveRuns.IsSet() { +// HasNextDagrunDataIntervalStart returns a boolean if a field has been set. +func (o *DAGDetail) HasNextDagrunDataIntervalStart() bool { + if o != nil && o.NextDagrunDataIntervalStart.IsSet() { return true } return false } -// SetMaxActiveRuns gets a reference to the given NullableInt32 and assigns it to the MaxActiveRuns field. -func (o *DAGDetail) SetMaxActiveRuns(v int32) { - o.MaxActiveRuns.Set(&v) +// SetNextDagrunDataIntervalStart gets a reference to the given NullableTime and assigns it to the NextDagrunDataIntervalStart field. +func (o *DAGDetail) SetNextDagrunDataIntervalStart(v time.Time) { + o.NextDagrunDataIntervalStart.Set(&v) } -// SetMaxActiveRunsNil sets the value for MaxActiveRuns to be an explicit nil -func (o *DAGDetail) SetMaxActiveRunsNil() { - o.MaxActiveRuns.Set(nil) +// SetNextDagrunDataIntervalStartNil sets the value for NextDagrunDataIntervalStart to be an explicit nil +func (o *DAGDetail) SetNextDagrunDataIntervalStartNil() { + o.NextDagrunDataIntervalStart.Set(nil) } -// UnsetMaxActiveRuns ensures that no value is present for MaxActiveRuns, not even an explicit nil -func (o *DAGDetail) UnsetMaxActiveRuns() { - o.MaxActiveRuns.Unset() +// UnsetNextDagrunDataIntervalStart ensures that no value is present for NextDagrunDataIntervalStart, not even an explicit nil +func (o *DAGDetail) UnsetNextDagrunDataIntervalStart() { + o.NextDagrunDataIntervalStart.Unset() } -// GetHasTaskConcurrencyLimits returns the HasTaskConcurrencyLimits field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGDetail) GetHasTaskConcurrencyLimits() bool { - if o == nil || o.HasTaskConcurrencyLimits.Get() == nil { - var ret bool +// GetOwners returns the Owners field value if set, zero value otherwise. +func (o *DAGDetail) GetOwners() []string { + if o == nil || IsNil(o.Owners) { + var ret []string return ret } - return *o.HasTaskConcurrencyLimits.Get() + return o.Owners } -// GetHasTaskConcurrencyLimitsOk returns a tuple with the HasTaskConcurrencyLimits field value if set, nil otherwise +// GetOwnersOk returns a tuple with the Owners field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGDetail) GetHasTaskConcurrencyLimitsOk() (*bool, bool) { - if o == nil { +func (o *DAGDetail) GetOwnersOk() ([]string, bool) { + if o == nil || IsNil(o.Owners) { return nil, false } - return o.HasTaskConcurrencyLimits.Get(), o.HasTaskConcurrencyLimits.IsSet() + return o.Owners, true } -// HasHasTaskConcurrencyLimits returns a boolean if a field has been set. -func (o *DAGDetail) HasHasTaskConcurrencyLimits() bool { - if o != nil && o.HasTaskConcurrencyLimits.IsSet() { +// HasOwners returns a boolean if a field has been set. +func (o *DAGDetail) HasOwners() bool { + if o != nil && !IsNil(o.Owners) { return true } return false } -// SetHasTaskConcurrencyLimits gets a reference to the given NullableBool and assigns it to the HasTaskConcurrencyLimits field. -func (o *DAGDetail) SetHasTaskConcurrencyLimits(v bool) { - o.HasTaskConcurrencyLimits.Set(&v) -} -// SetHasTaskConcurrencyLimitsNil sets the value for HasTaskConcurrencyLimits to be an explicit nil -func (o *DAGDetail) SetHasTaskConcurrencyLimitsNil() { - o.HasTaskConcurrencyLimits.Set(nil) -} - -// UnsetHasTaskConcurrencyLimits ensures that no value is present for HasTaskConcurrencyLimits, not even an explicit nil -func (o *DAGDetail) UnsetHasTaskConcurrencyLimits() { - o.HasTaskConcurrencyLimits.Unset() +// SetOwners gets a reference to the given []string and assigns it to the Owners field. +func (o *DAGDetail) SetOwners(v []string) { + o.Owners = v } -// GetHasImportErrors returns the HasImportErrors field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGDetail) GetHasImportErrors() bool { - if o == nil || o.HasImportErrors.Get() == nil { - var ret bool +// GetPickleId returns the PickleId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetPickleId() string { + if o == nil || IsNil(o.PickleId.Get()) { + var ret string return ret } - return *o.HasImportErrors.Get() + return *o.PickleId.Get() } -// GetHasImportErrorsOk returns a tuple with the HasImportErrors field value if set, nil otherwise +// GetPickleIdOk returns a tuple with the PickleId field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGDetail) GetHasImportErrorsOk() (*bool, bool) { - if o == nil { +func (o *DAGDetail) GetPickleIdOk() (*string, bool) { + if o == nil { return nil, false } - return o.HasImportErrors.Get(), o.HasImportErrors.IsSet() + return o.PickleId.Get(), o.PickleId.IsSet() } -// HasHasImportErrors returns a boolean if a field has been set. -func (o *DAGDetail) HasHasImportErrors() bool { - if o != nil && o.HasImportErrors.IsSet() { +// HasPickleId returns a boolean if a field has been set. +func (o *DAGDetail) HasPickleId() bool { + if o != nil && o.PickleId.IsSet() { return true } return false } -// SetHasImportErrors gets a reference to the given NullableBool and assigns it to the HasImportErrors field. -func (o *DAGDetail) SetHasImportErrors(v bool) { - o.HasImportErrors.Set(&v) +// SetPickleId gets a reference to the given NullableString and assigns it to the PickleId field. +func (o *DAGDetail) SetPickleId(v string) { + o.PickleId.Set(&v) } -// SetHasImportErrorsNil sets the value for HasImportErrors to be an explicit nil -func (o *DAGDetail) SetHasImportErrorsNil() { - o.HasImportErrors.Set(nil) +// SetPickleIdNil sets the value for PickleId to be an explicit nil +func (o *DAGDetail) SetPickleIdNil() { + o.PickleId.Set(nil) } -// UnsetHasImportErrors ensures that no value is present for HasImportErrors, not even an explicit nil -func (o *DAGDetail) UnsetHasImportErrors() { - o.HasImportErrors.Unset() +// UnsetPickleId ensures that no value is present for PickleId, not even an explicit nil +func (o *DAGDetail) UnsetPickleId() { + o.PickleId.Unset() } -// GetNextDagrun returns the NextDagrun field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGDetail) GetNextDagrun() time.Time { - if o == nil || o.NextDagrun.Get() == nil { - var ret time.Time +// GetRootDagId returns the RootDagId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetRootDagId() string { + if o == nil || IsNil(o.RootDagId.Get()) { + var ret string return ret } - return *o.NextDagrun.Get() + return *o.RootDagId.Get() } -// GetNextDagrunOk returns a tuple with the NextDagrun field value if set, nil otherwise +// GetRootDagIdOk returns a tuple with the RootDagId field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGDetail) GetNextDagrunOk() (*time.Time, bool) { - if o == nil { +func (o *DAGDetail) GetRootDagIdOk() (*string, bool) { + if o == nil { return nil, false } - return o.NextDagrun.Get(), o.NextDagrun.IsSet() + return o.RootDagId.Get(), o.RootDagId.IsSet() } -// HasNextDagrun returns a boolean if a field has been set. -func (o *DAGDetail) HasNextDagrun() bool { - if o != nil && o.NextDagrun.IsSet() { +// HasRootDagId returns a boolean if a field has been set. +func (o *DAGDetail) HasRootDagId() bool { + if o != nil && o.RootDagId.IsSet() { return true } return false } -// SetNextDagrun gets a reference to the given NullableTime and assigns it to the NextDagrun field. -func (o *DAGDetail) SetNextDagrun(v time.Time) { - o.NextDagrun.Set(&v) +// SetRootDagId gets a reference to the given NullableString and assigns it to the RootDagId field. +func (o *DAGDetail) SetRootDagId(v string) { + o.RootDagId.Set(&v) } -// SetNextDagrunNil sets the value for NextDagrun to be an explicit nil -func (o *DAGDetail) SetNextDagrunNil() { - o.NextDagrun.Set(nil) +// SetRootDagIdNil sets the value for RootDagId to be an explicit nil +func (o *DAGDetail) SetRootDagIdNil() { + o.RootDagId.Set(nil) } -// UnsetNextDagrun ensures that no value is present for NextDagrun, not even an explicit nil -func (o *DAGDetail) UnsetNextDagrun() { - o.NextDagrun.Unset() +// UnsetRootDagId ensures that no value is present for RootDagId, not even an explicit nil +func (o *DAGDetail) UnsetRootDagId() { + o.RootDagId.Unset() } -// GetNextDagrunDataIntervalStart returns the NextDagrunDataIntervalStart field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGDetail) GetNextDagrunDataIntervalStart() time.Time { - if o == nil || o.NextDagrunDataIntervalStart.Get() == nil { - var ret time.Time +// GetScheduleInterval returns the ScheduleInterval field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetScheduleInterval() ScheduleInterval { + if o == nil || IsNil(o.ScheduleInterval.Get()) { + var ret ScheduleInterval return ret } - return *o.NextDagrunDataIntervalStart.Get() + return *o.ScheduleInterval.Get() } -// GetNextDagrunDataIntervalStartOk returns a tuple with the NextDagrunDataIntervalStart field value if set, nil otherwise +// GetScheduleIntervalOk returns a tuple with the ScheduleInterval field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGDetail) GetNextDagrunDataIntervalStartOk() (*time.Time, bool) { - if o == nil { +func (o *DAGDetail) GetScheduleIntervalOk() (*ScheduleInterval, bool) { + if o == nil { return nil, false } - return o.NextDagrunDataIntervalStart.Get(), o.NextDagrunDataIntervalStart.IsSet() + return o.ScheduleInterval.Get(), o.ScheduleInterval.IsSet() } -// HasNextDagrunDataIntervalStart returns a boolean if a field has been set. -func (o *DAGDetail) HasNextDagrunDataIntervalStart() bool { - if o != nil && o.NextDagrunDataIntervalStart.IsSet() { +// HasScheduleInterval returns a boolean if a field has been set. +func (o *DAGDetail) HasScheduleInterval() bool { + if o != nil && o.ScheduleInterval.IsSet() { return true } return false } -// SetNextDagrunDataIntervalStart gets a reference to the given NullableTime and assigns it to the NextDagrunDataIntervalStart field. -func (o *DAGDetail) SetNextDagrunDataIntervalStart(v time.Time) { - o.NextDagrunDataIntervalStart.Set(&v) +// SetScheduleInterval gets a reference to the given NullableScheduleInterval and assigns it to the ScheduleInterval field. +func (o *DAGDetail) SetScheduleInterval(v ScheduleInterval) { + o.ScheduleInterval.Set(&v) } -// SetNextDagrunDataIntervalStartNil sets the value for NextDagrunDataIntervalStart to be an explicit nil -func (o *DAGDetail) SetNextDagrunDataIntervalStartNil() { - o.NextDagrunDataIntervalStart.Set(nil) +// SetScheduleIntervalNil sets the value for ScheduleInterval to be an explicit nil +func (o *DAGDetail) SetScheduleIntervalNil() { + o.ScheduleInterval.Set(nil) } -// UnsetNextDagrunDataIntervalStart ensures that no value is present for NextDagrunDataIntervalStart, not even an explicit nil -func (o *DAGDetail) UnsetNextDagrunDataIntervalStart() { - o.NextDagrunDataIntervalStart.Unset() +// UnsetScheduleInterval ensures that no value is present for ScheduleInterval, not even an explicit nil +func (o *DAGDetail) UnsetScheduleInterval() { + o.ScheduleInterval.Unset() } -// GetNextDagrunDataIntervalEnd returns the NextDagrunDataIntervalEnd field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGDetail) GetNextDagrunDataIntervalEnd() time.Time { - if o == nil || o.NextDagrunDataIntervalEnd.Get() == nil { - var ret time.Time +// GetSchedulerLock returns the SchedulerLock field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetSchedulerLock() bool { + if o == nil || IsNil(o.SchedulerLock.Get()) { + var ret bool return ret } - return *o.NextDagrunDataIntervalEnd.Get() + return *o.SchedulerLock.Get() } -// GetNextDagrunDataIntervalEndOk returns a tuple with the NextDagrunDataIntervalEnd field value if set, nil otherwise +// GetSchedulerLockOk returns a tuple with the SchedulerLock field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGDetail) GetNextDagrunDataIntervalEndOk() (*time.Time, bool) { - if o == nil { +func (o *DAGDetail) GetSchedulerLockOk() (*bool, bool) { + if o == nil { return nil, false } - return o.NextDagrunDataIntervalEnd.Get(), o.NextDagrunDataIntervalEnd.IsSet() + return o.SchedulerLock.Get(), o.SchedulerLock.IsSet() } -// HasNextDagrunDataIntervalEnd returns a boolean if a field has been set. -func (o *DAGDetail) HasNextDagrunDataIntervalEnd() bool { - if o != nil && o.NextDagrunDataIntervalEnd.IsSet() { +// HasSchedulerLock returns a boolean if a field has been set. +func (o *DAGDetail) HasSchedulerLock() bool { + if o != nil && o.SchedulerLock.IsSet() { return true } return false } -// SetNextDagrunDataIntervalEnd gets a reference to the given NullableTime and assigns it to the NextDagrunDataIntervalEnd field. -func (o *DAGDetail) SetNextDagrunDataIntervalEnd(v time.Time) { - o.NextDagrunDataIntervalEnd.Set(&v) +// SetSchedulerLock gets a reference to the given NullableBool and assigns it to the SchedulerLock field. +func (o *DAGDetail) SetSchedulerLock(v bool) { + o.SchedulerLock.Set(&v) } -// SetNextDagrunDataIntervalEndNil sets the value for NextDagrunDataIntervalEnd to be an explicit nil -func (o *DAGDetail) SetNextDagrunDataIntervalEndNil() { - o.NextDagrunDataIntervalEnd.Set(nil) +// SetSchedulerLockNil sets the value for SchedulerLock to be an explicit nil +func (o *DAGDetail) SetSchedulerLockNil() { + o.SchedulerLock.Set(nil) } -// UnsetNextDagrunDataIntervalEnd ensures that no value is present for NextDagrunDataIntervalEnd, not even an explicit nil -func (o *DAGDetail) UnsetNextDagrunDataIntervalEnd() { - o.NextDagrunDataIntervalEnd.Unset() +// UnsetSchedulerLock ensures that no value is present for SchedulerLock, not even an explicit nil +func (o *DAGDetail) UnsetSchedulerLock() { + o.SchedulerLock.Unset() } -// GetNextDagrunCreateAfter returns the NextDagrunCreateAfter field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGDetail) GetNextDagrunCreateAfter() time.Time { - if o == nil || o.NextDagrunCreateAfter.Get() == nil { - var ret time.Time +// GetTags returns the Tags field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetTags() []Tag { + if o == nil { + var ret []Tag return ret } - return *o.NextDagrunCreateAfter.Get() + return o.Tags } -// GetNextDagrunCreateAfterOk returns a tuple with the NextDagrunCreateAfter field value if set, nil otherwise +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGDetail) GetNextDagrunCreateAfterOk() (*time.Time, bool) { - if o == nil { +func (o *DAGDetail) GetTagsOk() ([]Tag, bool) { + if o == nil || IsNil(o.Tags) { return nil, false } - return o.NextDagrunCreateAfter.Get(), o.NextDagrunCreateAfter.IsSet() + return o.Tags, true } -// HasNextDagrunCreateAfter returns a boolean if a field has been set. -func (o *DAGDetail) HasNextDagrunCreateAfter() bool { - if o != nil && o.NextDagrunCreateAfter.IsSet() { +// HasTags returns a boolean if a field has been set. +func (o *DAGDetail) HasTags() bool { + if o != nil && !IsNil(o.Tags) { return true } return false } -// SetNextDagrunCreateAfter gets a reference to the given NullableTime and assigns it to the NextDagrunCreateAfter field. -func (o *DAGDetail) SetNextDagrunCreateAfter(v time.Time) { - o.NextDagrunCreateAfter.Set(&v) -} -// SetNextDagrunCreateAfterNil sets the value for NextDagrunCreateAfter to be an explicit nil -func (o *DAGDetail) SetNextDagrunCreateAfterNil() { - o.NextDagrunCreateAfter.Set(nil) -} - -// UnsetNextDagrunCreateAfter ensures that no value is present for NextDagrunCreateAfter, not even an explicit nil -func (o *DAGDetail) UnsetNextDagrunCreateAfter() { - o.NextDagrunCreateAfter.Unset() +// SetTags gets a reference to the given []Tag and assigns it to the Tags field. +func (o *DAGDetail) SetTags(v []Tag) { + o.Tags = v } -// GetTimezone returns the Timezone field value if set, zero value otherwise. -func (o *DAGDetail) GetTimezone() string { - if o == nil || o.Timezone == nil { +// GetTimetableDescription returns the TimetableDescription field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetTimetableDescription() string { + if o == nil || IsNil(o.TimetableDescription.Get()) { var ret string return ret } - return *o.Timezone + return *o.TimetableDescription.Get() } -// GetTimezoneOk returns a tuple with the Timezone field value if set, nil otherwise +// GetTimetableDescriptionOk returns a tuple with the TimetableDescription field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DAGDetail) GetTimezoneOk() (*string, bool) { - if o == nil || o.Timezone == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DAGDetail) GetTimetableDescriptionOk() (*string, bool) { + if o == nil { return nil, false } - return o.Timezone, true + return o.TimetableDescription.Get(), o.TimetableDescription.IsSet() } -// HasTimezone returns a boolean if a field has been set. -func (o *DAGDetail) HasTimezone() bool { - if o != nil && o.Timezone != nil { +// HasTimetableDescription returns a boolean if a field has been set. +func (o *DAGDetail) HasTimetableDescription() bool { + if o != nil && o.TimetableDescription.IsSet() { return true } return false } -// SetTimezone gets a reference to the given string and assigns it to the Timezone field. -func (o *DAGDetail) SetTimezone(v string) { - o.Timezone = &v +// SetTimetableDescription gets a reference to the given NullableString and assigns it to the TimetableDescription field. +func (o *DAGDetail) SetTimetableDescription(v string) { + o.TimetableDescription.Set(&v) +} +// SetTimetableDescriptionNil sets the value for TimetableDescription to be an explicit nil +func (o *DAGDetail) SetTimetableDescriptionNil() { + o.TimetableDescription.Set(nil) +} + +// UnsetTimetableDescription ensures that no value is present for TimetableDescription, not even an explicit nil +func (o *DAGDetail) UnsetTimetableDescription() { + o.TimetableDescription.Unset() } -// GetCatchup returns the Catchup field value if set, zero value otherwise. +// GetCatchup returns the Catchup field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DAGDetail) GetCatchup() bool { - if o == nil || o.Catchup == nil { + if o == nil || IsNil(o.Catchup.Get()) { var ret bool return ret } - return *o.Catchup + return *o.Catchup.Get() } // GetCatchupOk returns a tuple with the Catchup field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DAGDetail) GetCatchupOk() (*bool, bool) { - if o == nil || o.Catchup == nil { + if o == nil { return nil, false } - return o.Catchup, true + return o.Catchup.Get(), o.Catchup.IsSet() } // HasCatchup returns a boolean if a field has been set. func (o *DAGDetail) HasCatchup() bool { - if o != nil && o.Catchup != nil { + if o != nil && o.Catchup.IsSet() { return true } return false } -// SetCatchup gets a reference to the given bool and assigns it to the Catchup field. +// SetCatchup gets a reference to the given NullableBool and assigns it to the Catchup field. func (o *DAGDetail) SetCatchup(v bool) { - o.Catchup = &v -} - -// GetOrientation returns the Orientation field value if set, zero value otherwise. -func (o *DAGDetail) GetOrientation() string { - if o == nil || o.Orientation == nil { - var ret string - return ret - } - return *o.Orientation -} - -// GetOrientationOk returns a tuple with the Orientation field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DAGDetail) GetOrientationOk() (*string, bool) { - if o == nil || o.Orientation == nil { - return nil, false - } - return o.Orientation, true + o.Catchup.Set(&v) } - -// HasOrientation returns a boolean if a field has been set. -func (o *DAGDetail) HasOrientation() bool { - if o != nil && o.Orientation != nil { - return true - } - - return false +// SetCatchupNil sets the value for Catchup to be an explicit nil +func (o *DAGDetail) SetCatchupNil() { + o.Catchup.Set(nil) } -// SetOrientation gets a reference to the given string and assigns it to the Orientation field. -func (o *DAGDetail) SetOrientation(v string) { - o.Orientation = &v +// UnsetCatchup ensures that no value is present for Catchup, not even an explicit nil +func (o *DAGDetail) UnsetCatchup() { + o.Catchup.Unset() } -// GetConcurrency returns the Concurrency field value if set, zero value otherwise. +// GetConcurrency returns the Concurrency field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DAGDetail) GetConcurrency() float32 { - if o == nil || o.Concurrency == nil { + if o == nil || IsNil(o.Concurrency.Get()) { var ret float32 return ret } - return *o.Concurrency + return *o.Concurrency.Get() } // GetConcurrencyOk returns a tuple with the Concurrency field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DAGDetail) GetConcurrencyOk() (*float32, bool) { - if o == nil || o.Concurrency == nil { + if o == nil { return nil, false } - return o.Concurrency, true + return o.Concurrency.Get(), o.Concurrency.IsSet() } // HasConcurrency returns a boolean if a field has been set. func (o *DAGDetail) HasConcurrency() bool { - if o != nil && o.Concurrency != nil { + if o != nil && o.Concurrency.IsSet() { return true } return false } -// SetConcurrency gets a reference to the given float32 and assigns it to the Concurrency field. +// SetConcurrency gets a reference to the given NullableFloat32 and assigns it to the Concurrency field. func (o *DAGDetail) SetConcurrency(v float32) { - o.Concurrency = &v + o.Concurrency.Set(&v) +} +// SetConcurrencyNil sets the value for Concurrency to be an explicit nil +func (o *DAGDetail) SetConcurrencyNil() { + o.Concurrency.Set(nil) } -// GetStartDate returns the StartDate field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGDetail) GetStartDate() time.Time { - if o == nil || o.StartDate.Get() == nil { - var ret time.Time +// UnsetConcurrency ensures that no value is present for Concurrency, not even an explicit nil +func (o *DAGDetail) UnsetConcurrency() { + o.Concurrency.Unset() +} + +// GetDagRunTimeout returns the DagRunTimeout field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetDagRunTimeout() TimeDelta { + if o == nil || IsNil(o.DagRunTimeout.Get()) { + var ret TimeDelta return ret } - return *o.StartDate.Get() + return *o.DagRunTimeout.Get() } -// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise +// GetDagRunTimeoutOk returns a tuple with the DagRunTimeout field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGDetail) GetStartDateOk() (*time.Time, bool) { - if o == nil { +func (o *DAGDetail) GetDagRunTimeoutOk() (*TimeDelta, bool) { + if o == nil { return nil, false } - return o.StartDate.Get(), o.StartDate.IsSet() + return o.DagRunTimeout.Get(), o.DagRunTimeout.IsSet() } -// HasStartDate returns a boolean if a field has been set. -func (o *DAGDetail) HasStartDate() bool { - if o != nil && o.StartDate.IsSet() { +// HasDagRunTimeout returns a boolean if a field has been set. +func (o *DAGDetail) HasDagRunTimeout() bool { + if o != nil && o.DagRunTimeout.IsSet() { return true } return false } -// SetStartDate gets a reference to the given NullableTime and assigns it to the StartDate field. -func (o *DAGDetail) SetStartDate(v time.Time) { - o.StartDate.Set(&v) +// SetDagRunTimeout gets a reference to the given NullableTimeDelta and assigns it to the DagRunTimeout field. +func (o *DAGDetail) SetDagRunTimeout(v TimeDelta) { + o.DagRunTimeout.Set(&v) } -// SetStartDateNil sets the value for StartDate to be an explicit nil -func (o *DAGDetail) SetStartDateNil() { - o.StartDate.Set(nil) +// SetDagRunTimeoutNil sets the value for DagRunTimeout to be an explicit nil +func (o *DAGDetail) SetDagRunTimeoutNil() { + o.DagRunTimeout.Set(nil) } -// UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil -func (o *DAGDetail) UnsetStartDate() { - o.StartDate.Unset() +// UnsetDagRunTimeout ensures that no value is present for DagRunTimeout, not even an explicit nil +func (o *DAGDetail) UnsetDagRunTimeout() { + o.DagRunTimeout.Unset() } -// GetDagRunTimeout returns the DagRunTimeout field value if set, zero value otherwise. -func (o *DAGDetail) GetDagRunTimeout() TimeDelta { - if o == nil || o.DagRunTimeout == nil { - var ret TimeDelta +// GetDatasetExpression returns the DatasetExpression field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetDatasetExpression() map[string]interface{} { + if o == nil { + var ret map[string]interface{} return ret } - return *o.DagRunTimeout + return o.DatasetExpression } -// GetDagRunTimeoutOk returns a tuple with the DagRunTimeout field value if set, nil otherwise +// GetDatasetExpressionOk returns a tuple with the DatasetExpression field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DAGDetail) GetDagRunTimeoutOk() (*TimeDelta, bool) { - if o == nil || o.DagRunTimeout == nil { - return nil, false +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DAGDetail) GetDatasetExpressionOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.DatasetExpression) { + return map[string]interface{}{}, false } - return o.DagRunTimeout, true + return o.DatasetExpression, true } -// HasDagRunTimeout returns a boolean if a field has been set. -func (o *DAGDetail) HasDagRunTimeout() bool { - if o != nil && o.DagRunTimeout != nil { +// HasDatasetExpression returns a boolean if a field has been set. +func (o *DAGDetail) HasDatasetExpression() bool { + if o != nil && !IsNil(o.DatasetExpression) { return true } return false } -// SetDagRunTimeout gets a reference to the given TimeDelta and assigns it to the DagRunTimeout field. -func (o *DAGDetail) SetDagRunTimeout(v TimeDelta) { - o.DagRunTimeout = &v +// SetDatasetExpression gets a reference to the given map[string]interface{} and assigns it to the DatasetExpression field. +func (o *DAGDetail) SetDatasetExpression(v map[string]interface{}) { + o.DatasetExpression = v } // GetDocMd returns the DocMd field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DAGDetail) GetDocMd() string { - if o == nil || o.DocMd.Get() == nil { + if o == nil || IsNil(o.DocMd.Get()) { var ret string return ret } @@ -1361,7 +1394,7 @@ func (o *DAGDetail) GetDocMd() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DAGDetail) GetDocMdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.DocMd.Get(), o.DocMd.IsSet() @@ -1376,55 +1409,23 @@ func (o *DAGDetail) HasDocMd() bool { return false } -// SetDocMd gets a reference to the given NullableString and assigns it to the DocMd field. -func (o *DAGDetail) SetDocMd(v string) { - o.DocMd.Set(&v) -} -// SetDocMdNil sets the value for DocMd to be an explicit nil -func (o *DAGDetail) SetDocMdNil() { - o.DocMd.Set(nil) -} - -// UnsetDocMd ensures that no value is present for DocMd, not even an explicit nil -func (o *DAGDetail) UnsetDocMd() { - o.DocMd.Unset() -} - -// GetParams returns the Params field value if set, zero value otherwise. -func (o *DAGDetail) GetParams() map[string]interface{} { - if o == nil || o.Params == nil { - var ret map[string]interface{} - return ret - } - return *o.Params -} - -// GetParamsOk returns a tuple with the Params field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DAGDetail) GetParamsOk() (*map[string]interface{}, bool) { - if o == nil || o.Params == nil { - return nil, false - } - return o.Params, true -} - -// HasParams returns a boolean if a field has been set. -func (o *DAGDetail) HasParams() bool { - if o != nil && o.Params != nil { - return true - } - - return false +// SetDocMd gets a reference to the given NullableString and assigns it to the DocMd field. +func (o *DAGDetail) SetDocMd(v string) { + o.DocMd.Set(&v) +} +// SetDocMdNil sets the value for DocMd to be an explicit nil +func (o *DAGDetail) SetDocMdNil() { + o.DocMd.Set(nil) } -// SetParams gets a reference to the given map[string]interface{} and assigns it to the Params field. -func (o *DAGDetail) SetParams(v map[string]interface{}) { - o.Params = &v +// UnsetDocMd ensures that no value is present for DocMd, not even an explicit nil +func (o *DAGDetail) UnsetDocMd() { + o.DocMd.Unset() } // GetEndDate returns the EndDate field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DAGDetail) GetEndDate() time.Time { - if o == nil || o.EndDate.Get() == nil { + if o == nil || IsNil(o.EndDate.Get()) { var ret time.Time return ret } @@ -1435,7 +1436,7 @@ func (o *DAGDetail) GetEndDate() time.Time { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DAGDetail) GetEndDateOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return o.EndDate.Get(), o.EndDate.IsSet() @@ -1466,7 +1467,7 @@ func (o *DAGDetail) UnsetEndDate() { // GetIsPausedUponCreation returns the IsPausedUponCreation field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DAGDetail) GetIsPausedUponCreation() bool { - if o == nil || o.IsPausedUponCreation.Get() == nil { + if o == nil || IsNil(o.IsPausedUponCreation.Get()) { var ret bool return ret } @@ -1477,7 +1478,7 @@ func (o *DAGDetail) GetIsPausedUponCreation() bool { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DAGDetail) GetIsPausedUponCreationOk() (*bool, bool) { - if o == nil { + if o == nil { return nil, false } return o.IsPausedUponCreation.Get(), o.IsPausedUponCreation.IsSet() @@ -1508,7 +1509,7 @@ func (o *DAGDetail) UnsetIsPausedUponCreation() { // GetLastParsed returns the LastParsed field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DAGDetail) GetLastParsed() time.Time { - if o == nil || o.LastParsed.Get() == nil { + if o == nil || IsNil(o.LastParsed.Get()) { var ret time.Time return ret } @@ -1519,7 +1520,7 @@ func (o *DAGDetail) GetLastParsed() time.Time { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DAGDetail) GetLastParsedOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return o.LastParsed.Get(), o.LastParsed.IsSet() @@ -1548,42 +1549,83 @@ func (o *DAGDetail) UnsetLastParsed() { o.LastParsed.Unset() } -// GetTemplateSearchPath returns the TemplateSearchPath field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGDetail) GetTemplateSearchPath() []string { - if o == nil { - var ret []string +// GetOrientation returns the Orientation field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetOrientation() string { + if o == nil || IsNil(o.Orientation.Get()) { + var ret string return ret } - return o.TemplateSearchPath + return *o.Orientation.Get() } -// GetTemplateSearchPathOk returns a tuple with the TemplateSearchPath field value if set, nil otherwise +// GetOrientationOk returns a tuple with the Orientation field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGDetail) GetTemplateSearchPathOk() (*[]string, bool) { - if o == nil || o.TemplateSearchPath == nil { +func (o *DAGDetail) GetOrientationOk() (*string, bool) { + if o == nil { return nil, false } - return &o.TemplateSearchPath, true + return o.Orientation.Get(), o.Orientation.IsSet() } -// HasTemplateSearchPath returns a boolean if a field has been set. -func (o *DAGDetail) HasTemplateSearchPath() bool { - if o != nil && o.TemplateSearchPath != nil { +// HasOrientation returns a boolean if a field has been set. +func (o *DAGDetail) HasOrientation() bool { + if o != nil && o.Orientation.IsSet() { return true } return false } -// SetTemplateSearchPath gets a reference to the given []string and assigns it to the TemplateSearchPath field. -func (o *DAGDetail) SetTemplateSearchPath(v []string) { - o.TemplateSearchPath = v +// SetOrientation gets a reference to the given NullableString and assigns it to the Orientation field. +func (o *DAGDetail) SetOrientation(v string) { + o.Orientation.Set(&v) +} +// SetOrientationNil sets the value for Orientation to be an explicit nil +func (o *DAGDetail) SetOrientationNil() { + o.Orientation.Set(nil) +} + +// UnsetOrientation ensures that no value is present for Orientation, not even an explicit nil +func (o *DAGDetail) UnsetOrientation() { + o.Orientation.Unset() +} + +// GetParams returns the Params field value if set, zero value otherwise. +func (o *DAGDetail) GetParams() map[string]interface{} { + if o == nil || IsNil(o.Params) { + var ret map[string]interface{} + return ret + } + return o.Params +} + +// GetParamsOk returns a tuple with the Params field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DAGDetail) GetParamsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Params) { + return map[string]interface{}{}, false + } + return o.Params, true +} + +// HasParams returns a boolean if a field has been set. +func (o *DAGDetail) HasParams() bool { + if o != nil && !IsNil(o.Params) { + return true + } + + return false +} + +// SetParams gets a reference to the given map[string]interface{} and assigns it to the Params field. +func (o *DAGDetail) SetParams(v map[string]interface{}) { + o.Params = v } // GetRenderTemplateAsNativeObj returns the RenderTemplateAsNativeObj field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DAGDetail) GetRenderTemplateAsNativeObj() bool { - if o == nil || o.RenderTemplateAsNativeObj.Get() == nil { + if o == nil || IsNil(o.RenderTemplateAsNativeObj.Get()) { var ret bool return ret } @@ -1594,7 +1636,7 @@ func (o *DAGDetail) GetRenderTemplateAsNativeObj() bool { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DAGDetail) GetRenderTemplateAsNativeObjOk() (*bool, bool) { - if o == nil { + if o == nil { return nil, false } return o.RenderTemplateAsNativeObj.Get(), o.RenderTemplateAsNativeObj.IsSet() @@ -1623,110 +1665,222 @@ func (o *DAGDetail) UnsetRenderTemplateAsNativeObj() { o.RenderTemplateAsNativeObj.Unset() } -func (o DAGDetail) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.DagId != nil { - toSerialize["dag_id"] = o.DagId - } - if o.RootDagId.IsSet() { - toSerialize["root_dag_id"] = o.RootDagId.Get() +// GetStartDate returns the StartDate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetStartDate() time.Time { + if o == nil || IsNil(o.StartDate.Get()) { + var ret time.Time + return ret } - if o.IsPaused.IsSet() { - toSerialize["is_paused"] = o.IsPaused.Get() + return *o.StartDate.Get() +} + +// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DAGDetail) GetStartDateOk() (*time.Time, bool) { + if o == nil { + return nil, false } - if o.IsActive.IsSet() { - toSerialize["is_active"] = o.IsActive.Get() + return o.StartDate.Get(), o.StartDate.IsSet() +} + +// HasStartDate returns a boolean if a field has been set. +func (o *DAGDetail) HasStartDate() bool { + if o != nil && o.StartDate.IsSet() { + return true } - if o.IsSubdag != nil { - toSerialize["is_subdag"] = o.IsSubdag + + return false +} + +// SetStartDate gets a reference to the given NullableTime and assigns it to the StartDate field. +func (o *DAGDetail) SetStartDate(v time.Time) { + o.StartDate.Set(&v) +} +// SetStartDateNil sets the value for StartDate to be an explicit nil +func (o *DAGDetail) SetStartDateNil() { + o.StartDate.Set(nil) +} + +// UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil +func (o *DAGDetail) UnsetStartDate() { + o.StartDate.Unset() +} + +// GetTemplateSearchPath returns the TemplateSearchPath field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGDetail) GetTemplateSearchPath() []string { + if o == nil { + var ret []string + return ret } - if o.LastParsedTime.IsSet() { - toSerialize["last_parsed_time"] = o.LastParsedTime.Get() + return o.TemplateSearchPath +} + +// GetTemplateSearchPathOk returns a tuple with the TemplateSearchPath field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DAGDetail) GetTemplateSearchPathOk() ([]string, bool) { + if o == nil || IsNil(o.TemplateSearchPath) { + return nil, false } - if o.LastPickled.IsSet() { - toSerialize["last_pickled"] = o.LastPickled.Get() + return o.TemplateSearchPath, true +} + +// HasTemplateSearchPath returns a boolean if a field has been set. +func (o *DAGDetail) HasTemplateSearchPath() bool { + if o != nil && !IsNil(o.TemplateSearchPath) { + return true } - if o.LastExpired.IsSet() { - toSerialize["last_expired"] = o.LastExpired.Get() + + return false +} + +// SetTemplateSearchPath gets a reference to the given []string and assigns it to the TemplateSearchPath field. +func (o *DAGDetail) SetTemplateSearchPath(v []string) { + o.TemplateSearchPath = v +} + +// GetTimezone returns the Timezone field value if set, zero value otherwise. +func (o *DAGDetail) GetTimezone() string { + if o == nil || IsNil(o.Timezone) { + var ret string + return ret } - if o.SchedulerLock.IsSet() { - toSerialize["scheduler_lock"] = o.SchedulerLock.Get() + return *o.Timezone +} + +// GetTimezoneOk returns a tuple with the Timezone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DAGDetail) GetTimezoneOk() (*string, bool) { + if o == nil || IsNil(o.Timezone) { + return nil, false } - if o.PickleId.IsSet() { - toSerialize["pickle_id"] = o.PickleId.Get() + return o.Timezone, true +} + +// HasTimezone returns a boolean if a field has been set. +func (o *DAGDetail) HasTimezone() bool { + if o != nil && !IsNil(o.Timezone) { + return true } - if o.DefaultView != nil { - toSerialize["default_view"] = o.DefaultView + + return false +} + +// SetTimezone gets a reference to the given string and assigns it to the Timezone field. +func (o *DAGDetail) SetTimezone(v string) { + o.Timezone = &v +} + +func (o DAGDetail) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.Fileloc != nil { - toSerialize["fileloc"] = o.Fileloc + return json.Marshal(toSerialize) +} + +func (o DAGDetail) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DagDisplayName) { + toSerialize["dag_display_name"] = o.DagDisplayName } - if o.FileToken != nil { - toSerialize["file_token"] = o.FileToken + if !IsNil(o.DagId) { + toSerialize["dag_id"] = o.DagId } - if o.Owners != nil { - toSerialize["owners"] = o.Owners + if o.DefaultView.IsSet() { + toSerialize["default_view"] = o.DefaultView.Get() } if o.Description.IsSet() { toSerialize["description"] = o.Description.Get() } - if o.ScheduleInterval.IsSet() { - toSerialize["schedule_interval"] = o.ScheduleInterval.Get() + if !IsNil(o.FileToken) { + toSerialize["file_token"] = o.FileToken } - if o.TimetableDescription.IsSet() { - toSerialize["timetable_description"] = o.TimetableDescription.Get() + if !IsNil(o.Fileloc) { + toSerialize["fileloc"] = o.Fileloc } - if o.Tags != nil { - toSerialize["tags"] = o.Tags + if o.HasImportErrors.IsSet() { + toSerialize["has_import_errors"] = o.HasImportErrors.Get() } - if o.MaxActiveTasks.IsSet() { - toSerialize["max_active_tasks"] = o.MaxActiveTasks.Get() + if o.HasTaskConcurrencyLimits.IsSet() { + toSerialize["has_task_concurrency_limits"] = o.HasTaskConcurrencyLimits.Get() + } + if o.IsActive.IsSet() { + toSerialize["is_active"] = o.IsActive.Get() + } + if o.IsPaused.IsSet() { + toSerialize["is_paused"] = o.IsPaused.Get() + } + if !IsNil(o.IsSubdag) { + toSerialize["is_subdag"] = o.IsSubdag + } + if o.LastExpired.IsSet() { + toSerialize["last_expired"] = o.LastExpired.Get() + } + if o.LastParsedTime.IsSet() { + toSerialize["last_parsed_time"] = o.LastParsedTime.Get() + } + if o.LastPickled.IsSet() { + toSerialize["last_pickled"] = o.LastPickled.Get() } if o.MaxActiveRuns.IsSet() { toSerialize["max_active_runs"] = o.MaxActiveRuns.Get() } - if o.HasTaskConcurrencyLimits.IsSet() { - toSerialize["has_task_concurrency_limits"] = o.HasTaskConcurrencyLimits.Get() + if o.MaxActiveTasks.IsSet() { + toSerialize["max_active_tasks"] = o.MaxActiveTasks.Get() } - if o.HasImportErrors.IsSet() { - toSerialize["has_import_errors"] = o.HasImportErrors.Get() + if o.MaxConsecutiveFailedDagRuns.IsSet() { + toSerialize["max_consecutive_failed_dag_runs"] = o.MaxConsecutiveFailedDagRuns.Get() } if o.NextDagrun.IsSet() { toSerialize["next_dagrun"] = o.NextDagrun.Get() } - if o.NextDagrunDataIntervalStart.IsSet() { - toSerialize["next_dagrun_data_interval_start"] = o.NextDagrunDataIntervalStart.Get() + if o.NextDagrunCreateAfter.IsSet() { + toSerialize["next_dagrun_create_after"] = o.NextDagrunCreateAfter.Get() } if o.NextDagrunDataIntervalEnd.IsSet() { toSerialize["next_dagrun_data_interval_end"] = o.NextDagrunDataIntervalEnd.Get() } - if o.NextDagrunCreateAfter.IsSet() { - toSerialize["next_dagrun_create_after"] = o.NextDagrunCreateAfter.Get() + if o.NextDagrunDataIntervalStart.IsSet() { + toSerialize["next_dagrun_data_interval_start"] = o.NextDagrunDataIntervalStart.Get() } - if o.Timezone != nil { - toSerialize["timezone"] = o.Timezone + if !IsNil(o.Owners) { + toSerialize["owners"] = o.Owners + } + if o.PickleId.IsSet() { + toSerialize["pickle_id"] = o.PickleId.Get() } - if o.Catchup != nil { - toSerialize["catchup"] = o.Catchup + if o.RootDagId.IsSet() { + toSerialize["root_dag_id"] = o.RootDagId.Get() } - if o.Orientation != nil { - toSerialize["orientation"] = o.Orientation + if o.ScheduleInterval.IsSet() { + toSerialize["schedule_interval"] = o.ScheduleInterval.Get() } - if o.Concurrency != nil { - toSerialize["concurrency"] = o.Concurrency + if o.SchedulerLock.IsSet() { + toSerialize["scheduler_lock"] = o.SchedulerLock.Get() } - if o.StartDate.IsSet() { - toSerialize["start_date"] = o.StartDate.Get() + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + if o.TimetableDescription.IsSet() { + toSerialize["timetable_description"] = o.TimetableDescription.Get() + } + if o.Catchup.IsSet() { + toSerialize["catchup"] = o.Catchup.Get() + } + if o.Concurrency.IsSet() { + toSerialize["concurrency"] = o.Concurrency.Get() } - if o.DagRunTimeout != nil { - toSerialize["dag_run_timeout"] = o.DagRunTimeout + if o.DagRunTimeout.IsSet() { + toSerialize["dag_run_timeout"] = o.DagRunTimeout.Get() + } + if o.DatasetExpression != nil { + toSerialize["dataset_expression"] = o.DatasetExpression } if o.DocMd.IsSet() { toSerialize["doc_md"] = o.DocMd.Get() } - if o.Params != nil { - toSerialize["params"] = o.Params - } if o.EndDate.IsSet() { toSerialize["end_date"] = o.EndDate.Get() } @@ -1736,13 +1890,25 @@ func (o DAGDetail) MarshalJSON() ([]byte, error) { if o.LastParsed.IsSet() { toSerialize["last_parsed"] = o.LastParsed.Get() } - if o.TemplateSearchPath != nil { - toSerialize["template_search_path"] = o.TemplateSearchPath + if o.Orientation.IsSet() { + toSerialize["orientation"] = o.Orientation.Get() + } + if !IsNil(o.Params) { + toSerialize["params"] = o.Params } if o.RenderTemplateAsNativeObj.IsSet() { toSerialize["render_template_as_native_obj"] = o.RenderTemplateAsNativeObj.Get() } - return json.Marshal(toSerialize) + if o.StartDate.IsSet() { + toSerialize["start_date"] = o.StartDate.Get() + } + if o.TemplateSearchPath != nil { + toSerialize["template_search_path"] = o.TemplateSearchPath + } + if !IsNil(o.Timezone) { + toSerialize["timezone"] = o.Timezone + } + return toSerialize, nil } type NullableDAGDetail struct { diff --git a/airflow/model_dag_processor_status.go b/airflow/model_dag_processor_status.go new file mode 100644 index 0000000..acf8d29 --- /dev/null +++ b/airflow/model_dag_processor_status.go @@ -0,0 +1,184 @@ +/* +Airflow API (Stable) + +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. + +API version: 2.10.5 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package airflow + +import ( + "encoding/json" +) + +// checks if the DagProcessorStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DagProcessorStatus{} + +// DagProcessorStatus The status and the latest dag processor heartbeat. *New in version 2.6.3* +type DagProcessorStatus struct { + // The time the dag processor last did a heartbeat. + LatestDagProcessorHeartbeat NullableString `json:"latest_dag_processor_heartbeat,omitempty"` + Status NullableHealthStatus `json:"status,omitempty"` +} + +// NewDagProcessorStatus instantiates a new DagProcessorStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDagProcessorStatus() *DagProcessorStatus { + this := DagProcessorStatus{} + return &this +} + +// NewDagProcessorStatusWithDefaults instantiates a new DagProcessorStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDagProcessorStatusWithDefaults() *DagProcessorStatus { + this := DagProcessorStatus{} + return &this +} + +// GetLatestDagProcessorHeartbeat returns the LatestDagProcessorHeartbeat field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DagProcessorStatus) GetLatestDagProcessorHeartbeat() string { + if o == nil || IsNil(o.LatestDagProcessorHeartbeat.Get()) { + var ret string + return ret + } + return *o.LatestDagProcessorHeartbeat.Get() +} + +// GetLatestDagProcessorHeartbeatOk returns a tuple with the LatestDagProcessorHeartbeat field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DagProcessorStatus) GetLatestDagProcessorHeartbeatOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.LatestDagProcessorHeartbeat.Get(), o.LatestDagProcessorHeartbeat.IsSet() +} + +// HasLatestDagProcessorHeartbeat returns a boolean if a field has been set. +func (o *DagProcessorStatus) HasLatestDagProcessorHeartbeat() bool { + if o != nil && o.LatestDagProcessorHeartbeat.IsSet() { + return true + } + + return false +} + +// SetLatestDagProcessorHeartbeat gets a reference to the given NullableString and assigns it to the LatestDagProcessorHeartbeat field. +func (o *DagProcessorStatus) SetLatestDagProcessorHeartbeat(v string) { + o.LatestDagProcessorHeartbeat.Set(&v) +} +// SetLatestDagProcessorHeartbeatNil sets the value for LatestDagProcessorHeartbeat to be an explicit nil +func (o *DagProcessorStatus) SetLatestDagProcessorHeartbeatNil() { + o.LatestDagProcessorHeartbeat.Set(nil) +} + +// UnsetLatestDagProcessorHeartbeat ensures that no value is present for LatestDagProcessorHeartbeat, not even an explicit nil +func (o *DagProcessorStatus) UnsetLatestDagProcessorHeartbeat() { + o.LatestDagProcessorHeartbeat.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DagProcessorStatus) GetStatus() HealthStatus { + if o == nil || IsNil(o.Status.Get()) { + var ret HealthStatus + return ret + } + return *o.Status.Get() +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DagProcessorStatus) GetStatusOk() (*HealthStatus, bool) { + if o == nil { + return nil, false + } + return o.Status.Get(), o.Status.IsSet() +} + +// HasStatus returns a boolean if a field has been set. +func (o *DagProcessorStatus) HasStatus() bool { + if o != nil && o.Status.IsSet() { + return true + } + + return false +} + +// SetStatus gets a reference to the given NullableHealthStatus and assigns it to the Status field. +func (o *DagProcessorStatus) SetStatus(v HealthStatus) { + o.Status.Set(&v) +} +// SetStatusNil sets the value for Status to be an explicit nil +func (o *DagProcessorStatus) SetStatusNil() { + o.Status.Set(nil) +} + +// UnsetStatus ensures that no value is present for Status, not even an explicit nil +func (o *DagProcessorStatus) UnsetStatus() { + o.Status.Unset() +} + +func (o DagProcessorStatus) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DagProcessorStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.LatestDagProcessorHeartbeat.IsSet() { + toSerialize["latest_dag_processor_heartbeat"] = o.LatestDagProcessorHeartbeat.Get() + } + if o.Status.IsSet() { + toSerialize["status"] = o.Status.Get() + } + return toSerialize, nil +} + +type NullableDagProcessorStatus struct { + value *DagProcessorStatus + isSet bool +} + +func (v NullableDagProcessorStatus) Get() *DagProcessorStatus { + return v.value +} + +func (v *NullableDagProcessorStatus) Set(val *DagProcessorStatus) { + v.value = val + v.isSet = true +} + +func (v NullableDagProcessorStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableDagProcessorStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDagProcessorStatus(val *DagProcessorStatus) *NullableDagProcessorStatus { + return &NullableDagProcessorStatus{value: val, isSet: true} +} + +func (v NullableDagProcessorStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDagProcessorStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/model_dag_run.go b/airflow/model_dag_run.go index 03af207..4cc54aa 100644 --- a/airflow/model_dag_run.go +++ b/airflow/model_dag_run.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -33,29 +16,34 @@ import ( "time" ) +// checks if the DAGRun type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DAGRun{} + // DAGRun struct for DAGRun type DAGRun struct { + // JSON object describing additional configuration parameters. The value of this field can be set only when creating the object. If you try to modify the field of an existing object, the request fails with an BAD_REQUEST error. + Conf map[string]interface{} `json:"conf,omitempty"` + DagId *string `json:"dag_id,omitempty"` // Run ID. The value of this field can be set only when creating the object. If you try to modify the field of an existing object, the request fails with an BAD_REQUEST error. If not provided, a value will be generated based on execution_date. If the specified dag_run_id is in use, the creation request fails with an ALREADY_EXISTS error. This together with DAG_ID are a unique key. DagRunId NullableString `json:"dag_run_id,omitempty"` - DagId *string `json:"dag_id,omitempty"` - // The logical date (previously called execution date). This is the time or interval covered by this DAG run, according to the DAG definition. The value of this field can be set only when creating the object. If you try to modify the field of an existing object, the request fails with an BAD_REQUEST error. This together with DAG_ID are a unique key. *New in version 2.2.0* - LogicalDate NullableTime `json:"logical_date,omitempty"` + // The end of the interval the DAG run covers. + DataIntervalEnd NullableTime `json:"data_interval_end,omitempty"` + // The beginning of the interval the DAG run covers. + DataIntervalStart NullableTime `json:"data_interval_start,omitempty"` + EndDate NullableTime `json:"end_date,omitempty"` // The execution date. This is the same as logical_date, kept for backwards compatibility. If both this field and logical_date are provided but with different values, the request will fail with an BAD_REQUEST error. *Changed in version 2.2.0*: Field becomes nullable. *Deprecated since version 2.2.0*: Use 'logical_date' instead. // Deprecated ExecutionDate NullableTime `json:"execution_date,omitempty"` - // The start time. The time when DAG run was actually created. *Changed in version 2.1.3*: Field becomes nullable. - StartDate NullableTime `json:"start_date,omitempty"` - EndDate NullableTime `json:"end_date,omitempty"` - DataIntervalStart NullableTime `json:"data_interval_start,omitempty"` - DataIntervalEnd NullableTime `json:"data_interval_end,omitempty"` - LastSchedulingDecision NullableTime `json:"last_scheduling_decision,omitempty"` - RunType *string `json:"run_type,omitempty"` - State *DagState `json:"state,omitempty"` ExternalTrigger *bool `json:"external_trigger,omitempty"` - // JSON object describing additional configuration parameters. The value of this field can be set only when creating the object. If you try to modify the field of an existing object, the request fails with an BAD_REQUEST error. - Conf *map[string]interface{} `json:"conf,omitempty"` + LastSchedulingDecision NullableTime `json:"last_scheduling_decision,omitempty"` + // The logical date (previously called execution date). This is the time or interval covered by this DAG run, according to the DAG definition. The value of this field can be set only when creating the object. If you try to modify the field of an existing object, the request fails with an BAD_REQUEST error. This together with DAG_ID are a unique key. *New in version 2.2.0* + LogicalDate NullableTime `json:"logical_date,omitempty"` // Contains manually entered notes by the user about the DagRun. *New in version 2.5.0* Note NullableString `json:"note,omitempty"` + RunType *string `json:"run_type,omitempty"` + // The start time. The time when DAG run was actually created. *Changed in version 2.1.3*: Field becomes nullable. + StartDate NullableTime `json:"start_date,omitempty"` + State *DagState `json:"state,omitempty"` } // NewDAGRun instantiates a new DAGRun object @@ -75,51 +63,41 @@ func NewDAGRunWithDefaults() *DAGRun { return &this } -// GetDagRunId returns the DagRunId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGRun) GetDagRunId() string { - if o == nil || o.DagRunId.Get() == nil { - var ret string +// GetConf returns the Conf field value if set, zero value otherwise. +func (o *DAGRun) GetConf() map[string]interface{} { + if o == nil || IsNil(o.Conf) { + var ret map[string]interface{} return ret } - return *o.DagRunId.Get() + return o.Conf } -// GetDagRunIdOk returns a tuple with the DagRunId field value if set, nil otherwise +// GetConfOk returns a tuple with the Conf field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGRun) GetDagRunIdOk() (*string, bool) { - if o == nil { - return nil, false +func (o *DAGRun) GetConfOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Conf) { + return map[string]interface{}{}, false } - return o.DagRunId.Get(), o.DagRunId.IsSet() + return o.Conf, true } -// HasDagRunId returns a boolean if a field has been set. -func (o *DAGRun) HasDagRunId() bool { - if o != nil && o.DagRunId.IsSet() { +// HasConf returns a boolean if a field has been set. +func (o *DAGRun) HasConf() bool { + if o != nil && !IsNil(o.Conf) { return true } return false } -// SetDagRunId gets a reference to the given NullableString and assigns it to the DagRunId field. -func (o *DAGRun) SetDagRunId(v string) { - o.DagRunId.Set(&v) -} -// SetDagRunIdNil sets the value for DagRunId to be an explicit nil -func (o *DAGRun) SetDagRunIdNil() { - o.DagRunId.Set(nil) -} - -// UnsetDagRunId ensures that no value is present for DagRunId, not even an explicit nil -func (o *DAGRun) UnsetDagRunId() { - o.DagRunId.Unset() +// SetConf gets a reference to the given map[string]interface{} and assigns it to the Conf field. +func (o *DAGRun) SetConf(v map[string]interface{}) { + o.Conf = v } // GetDagId returns the DagId field value if set, zero value otherwise. func (o *DAGRun) GetDagId() string { - if o == nil || o.DagId == nil { + if o == nil || IsNil(o.DagId) { var ret string return ret } @@ -129,7 +107,7 @@ func (o *DAGRun) GetDagId() string { // GetDagIdOk returns a tuple with the DagId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *DAGRun) GetDagIdOk() (*string, bool) { - if o == nil || o.DagId == nil { + if o == nil || IsNil(o.DagId) { return nil, false } return o.DagId, true @@ -137,7 +115,7 @@ func (o *DAGRun) GetDagIdOk() (*string, bool) { // HasDagId returns a boolean if a field has been set. func (o *DAGRun) HasDagId() bool { - if o != nil && o.DagId != nil { + if o != nil && !IsNil(o.DagId) { return true } @@ -149,138 +127,135 @@ func (o *DAGRun) SetDagId(v string) { o.DagId = &v } -// GetLogicalDate returns the LogicalDate field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGRun) GetLogicalDate() time.Time { - if o == nil || o.LogicalDate.Get() == nil { - var ret time.Time +// GetDagRunId returns the DagRunId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGRun) GetDagRunId() string { + if o == nil || IsNil(o.DagRunId.Get()) { + var ret string return ret } - return *o.LogicalDate.Get() + return *o.DagRunId.Get() } -// GetLogicalDateOk returns a tuple with the LogicalDate field value if set, nil otherwise +// GetDagRunIdOk returns a tuple with the DagRunId field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGRun) GetLogicalDateOk() (*time.Time, bool) { - if o == nil { +func (o *DAGRun) GetDagRunIdOk() (*string, bool) { + if o == nil { return nil, false } - return o.LogicalDate.Get(), o.LogicalDate.IsSet() + return o.DagRunId.Get(), o.DagRunId.IsSet() } -// HasLogicalDate returns a boolean if a field has been set. -func (o *DAGRun) HasLogicalDate() bool { - if o != nil && o.LogicalDate.IsSet() { +// HasDagRunId returns a boolean if a field has been set. +func (o *DAGRun) HasDagRunId() bool { + if o != nil && o.DagRunId.IsSet() { return true } return false } -// SetLogicalDate gets a reference to the given NullableTime and assigns it to the LogicalDate field. -func (o *DAGRun) SetLogicalDate(v time.Time) { - o.LogicalDate.Set(&v) +// SetDagRunId gets a reference to the given NullableString and assigns it to the DagRunId field. +func (o *DAGRun) SetDagRunId(v string) { + o.DagRunId.Set(&v) } -// SetLogicalDateNil sets the value for LogicalDate to be an explicit nil -func (o *DAGRun) SetLogicalDateNil() { - o.LogicalDate.Set(nil) +// SetDagRunIdNil sets the value for DagRunId to be an explicit nil +func (o *DAGRun) SetDagRunIdNil() { + o.DagRunId.Set(nil) } -// UnsetLogicalDate ensures that no value is present for LogicalDate, not even an explicit nil -func (o *DAGRun) UnsetLogicalDate() { - o.LogicalDate.Unset() +// UnsetDagRunId ensures that no value is present for DagRunId, not even an explicit nil +func (o *DAGRun) UnsetDagRunId() { + o.DagRunId.Unset() } -// GetExecutionDate returns the ExecutionDate field value if set, zero value otherwise (both if not set or set to explicit null). -// Deprecated -func (o *DAGRun) GetExecutionDate() time.Time { - if o == nil || o.ExecutionDate.Get() == nil { +// GetDataIntervalEnd returns the DataIntervalEnd field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGRun) GetDataIntervalEnd() time.Time { + if o == nil || IsNil(o.DataIntervalEnd.Get()) { var ret time.Time return ret } - return *o.ExecutionDate.Get() + return *o.DataIntervalEnd.Get() } -// GetExecutionDateOk returns a tuple with the ExecutionDate field value if set, nil otherwise +// GetDataIntervalEndOk returns a tuple with the DataIntervalEnd field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -// Deprecated -func (o *DAGRun) GetExecutionDateOk() (*time.Time, bool) { - if o == nil { +func (o *DAGRun) GetDataIntervalEndOk() (*time.Time, bool) { + if o == nil { return nil, false } - return o.ExecutionDate.Get(), o.ExecutionDate.IsSet() + return o.DataIntervalEnd.Get(), o.DataIntervalEnd.IsSet() } -// HasExecutionDate returns a boolean if a field has been set. -func (o *DAGRun) HasExecutionDate() bool { - if o != nil && o.ExecutionDate.IsSet() { +// HasDataIntervalEnd returns a boolean if a field has been set. +func (o *DAGRun) HasDataIntervalEnd() bool { + if o != nil && o.DataIntervalEnd.IsSet() { return true } return false } -// SetExecutionDate gets a reference to the given NullableTime and assigns it to the ExecutionDate field. -// Deprecated -func (o *DAGRun) SetExecutionDate(v time.Time) { - o.ExecutionDate.Set(&v) +// SetDataIntervalEnd gets a reference to the given NullableTime and assigns it to the DataIntervalEnd field. +func (o *DAGRun) SetDataIntervalEnd(v time.Time) { + o.DataIntervalEnd.Set(&v) } -// SetExecutionDateNil sets the value for ExecutionDate to be an explicit nil -func (o *DAGRun) SetExecutionDateNil() { - o.ExecutionDate.Set(nil) +// SetDataIntervalEndNil sets the value for DataIntervalEnd to be an explicit nil +func (o *DAGRun) SetDataIntervalEndNil() { + o.DataIntervalEnd.Set(nil) } -// UnsetExecutionDate ensures that no value is present for ExecutionDate, not even an explicit nil -func (o *DAGRun) UnsetExecutionDate() { - o.ExecutionDate.Unset() +// UnsetDataIntervalEnd ensures that no value is present for DataIntervalEnd, not even an explicit nil +func (o *DAGRun) UnsetDataIntervalEnd() { + o.DataIntervalEnd.Unset() } -// GetStartDate returns the StartDate field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGRun) GetStartDate() time.Time { - if o == nil || o.StartDate.Get() == nil { +// GetDataIntervalStart returns the DataIntervalStart field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGRun) GetDataIntervalStart() time.Time { + if o == nil || IsNil(o.DataIntervalStart.Get()) { var ret time.Time return ret } - return *o.StartDate.Get() + return *o.DataIntervalStart.Get() } -// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise +// GetDataIntervalStartOk returns a tuple with the DataIntervalStart field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGRun) GetStartDateOk() (*time.Time, bool) { - if o == nil { +func (o *DAGRun) GetDataIntervalStartOk() (*time.Time, bool) { + if o == nil { return nil, false } - return o.StartDate.Get(), o.StartDate.IsSet() + return o.DataIntervalStart.Get(), o.DataIntervalStart.IsSet() } -// HasStartDate returns a boolean if a field has been set. -func (o *DAGRun) HasStartDate() bool { - if o != nil && o.StartDate.IsSet() { +// HasDataIntervalStart returns a boolean if a field has been set. +func (o *DAGRun) HasDataIntervalStart() bool { + if o != nil && o.DataIntervalStart.IsSet() { return true } return false } -// SetStartDate gets a reference to the given NullableTime and assigns it to the StartDate field. -func (o *DAGRun) SetStartDate(v time.Time) { - o.StartDate.Set(&v) +// SetDataIntervalStart gets a reference to the given NullableTime and assigns it to the DataIntervalStart field. +func (o *DAGRun) SetDataIntervalStart(v time.Time) { + o.DataIntervalStart.Set(&v) } -// SetStartDateNil sets the value for StartDate to be an explicit nil -func (o *DAGRun) SetStartDateNil() { - o.StartDate.Set(nil) +// SetDataIntervalStartNil sets the value for DataIntervalStart to be an explicit nil +func (o *DAGRun) SetDataIntervalStartNil() { + o.DataIntervalStart.Set(nil) } -// UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil -func (o *DAGRun) UnsetStartDate() { - o.StartDate.Unset() +// UnsetDataIntervalStart ensures that no value is present for DataIntervalStart, not even an explicit nil +func (o *DAGRun) UnsetDataIntervalStart() { + o.DataIntervalStart.Unset() } // GetEndDate returns the EndDate field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DAGRun) GetEndDate() time.Time { - if o == nil || o.EndDate.Get() == nil { + if o == nil || IsNil(o.EndDate.Get()) { var ret time.Time return ret } @@ -291,7 +266,7 @@ func (o *DAGRun) GetEndDate() time.Time { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DAGRun) GetEndDateOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return o.EndDate.Get(), o.EndDate.IsSet() @@ -320,93 +295,86 @@ func (o *DAGRun) UnsetEndDate() { o.EndDate.Unset() } -// GetDataIntervalStart returns the DataIntervalStart field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGRun) GetDataIntervalStart() time.Time { - if o == nil || o.DataIntervalStart.Get() == nil { +// GetExecutionDate returns the ExecutionDate field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated +func (o *DAGRun) GetExecutionDate() time.Time { + if o == nil || IsNil(o.ExecutionDate.Get()) { var ret time.Time return ret } - return *o.DataIntervalStart.Get() + return *o.ExecutionDate.Get() } -// GetDataIntervalStartOk returns a tuple with the DataIntervalStart field value if set, nil otherwise +// GetExecutionDateOk returns a tuple with the ExecutionDate field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGRun) GetDataIntervalStartOk() (*time.Time, bool) { - if o == nil { +// Deprecated +func (o *DAGRun) GetExecutionDateOk() (*time.Time, bool) { + if o == nil { return nil, false } - return o.DataIntervalStart.Get(), o.DataIntervalStart.IsSet() + return o.ExecutionDate.Get(), o.ExecutionDate.IsSet() } -// HasDataIntervalStart returns a boolean if a field has been set. -func (o *DAGRun) HasDataIntervalStart() bool { - if o != nil && o.DataIntervalStart.IsSet() { +// HasExecutionDate returns a boolean if a field has been set. +func (o *DAGRun) HasExecutionDate() bool { + if o != nil && o.ExecutionDate.IsSet() { return true } return false } -// SetDataIntervalStart gets a reference to the given NullableTime and assigns it to the DataIntervalStart field. -func (o *DAGRun) SetDataIntervalStart(v time.Time) { - o.DataIntervalStart.Set(&v) +// SetExecutionDate gets a reference to the given NullableTime and assigns it to the ExecutionDate field. +// Deprecated +func (o *DAGRun) SetExecutionDate(v time.Time) { + o.ExecutionDate.Set(&v) } -// SetDataIntervalStartNil sets the value for DataIntervalStart to be an explicit nil -func (o *DAGRun) SetDataIntervalStartNil() { - o.DataIntervalStart.Set(nil) +// SetExecutionDateNil sets the value for ExecutionDate to be an explicit nil +func (o *DAGRun) SetExecutionDateNil() { + o.ExecutionDate.Set(nil) } -// UnsetDataIntervalStart ensures that no value is present for DataIntervalStart, not even an explicit nil -func (o *DAGRun) UnsetDataIntervalStart() { - o.DataIntervalStart.Unset() +// UnsetExecutionDate ensures that no value is present for ExecutionDate, not even an explicit nil +func (o *DAGRun) UnsetExecutionDate() { + o.ExecutionDate.Unset() } -// GetDataIntervalEnd returns the DataIntervalEnd field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGRun) GetDataIntervalEnd() time.Time { - if o == nil || o.DataIntervalEnd.Get() == nil { - var ret time.Time +// GetExternalTrigger returns the ExternalTrigger field value if set, zero value otherwise. +func (o *DAGRun) GetExternalTrigger() bool { + if o == nil || IsNil(o.ExternalTrigger) { + var ret bool return ret } - return *o.DataIntervalEnd.Get() + return *o.ExternalTrigger } -// GetDataIntervalEndOk returns a tuple with the DataIntervalEnd field value if set, nil otherwise +// GetExternalTriggerOk returns a tuple with the ExternalTrigger field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGRun) GetDataIntervalEndOk() (*time.Time, bool) { - if o == nil { +func (o *DAGRun) GetExternalTriggerOk() (*bool, bool) { + if o == nil || IsNil(o.ExternalTrigger) { return nil, false } - return o.DataIntervalEnd.Get(), o.DataIntervalEnd.IsSet() + return o.ExternalTrigger, true } -// HasDataIntervalEnd returns a boolean if a field has been set. -func (o *DAGRun) HasDataIntervalEnd() bool { - if o != nil && o.DataIntervalEnd.IsSet() { +// HasExternalTrigger returns a boolean if a field has been set. +func (o *DAGRun) HasExternalTrigger() bool { + if o != nil && !IsNil(o.ExternalTrigger) { return true } return false } -// SetDataIntervalEnd gets a reference to the given NullableTime and assigns it to the DataIntervalEnd field. -func (o *DAGRun) SetDataIntervalEnd(v time.Time) { - o.DataIntervalEnd.Set(&v) -} -// SetDataIntervalEndNil sets the value for DataIntervalEnd to be an explicit nil -func (o *DAGRun) SetDataIntervalEndNil() { - o.DataIntervalEnd.Set(nil) -} - -// UnsetDataIntervalEnd ensures that no value is present for DataIntervalEnd, not even an explicit nil -func (o *DAGRun) UnsetDataIntervalEnd() { - o.DataIntervalEnd.Unset() +// SetExternalTrigger gets a reference to the given bool and assigns it to the ExternalTrigger field. +func (o *DAGRun) SetExternalTrigger(v bool) { + o.ExternalTrigger = &v } // GetLastSchedulingDecision returns the LastSchedulingDecision field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DAGRun) GetLastSchedulingDecision() time.Time { - if o == nil || o.LastSchedulingDecision.Get() == nil { + if o == nil || IsNil(o.LastSchedulingDecision.Get()) { var ret time.Time return ret } @@ -417,7 +385,7 @@ func (o *DAGRun) GetLastSchedulingDecision() time.Time { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DAGRun) GetLastSchedulingDecisionOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return o.LastSchedulingDecision.Get(), o.LastSchedulingDecision.IsSet() @@ -446,221 +414,249 @@ func (o *DAGRun) UnsetLastSchedulingDecision() { o.LastSchedulingDecision.Unset() } -// GetRunType returns the RunType field value if set, zero value otherwise. -func (o *DAGRun) GetRunType() string { - if o == nil || o.RunType == nil { - var ret string +// GetLogicalDate returns the LogicalDate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGRun) GetLogicalDate() time.Time { + if o == nil || IsNil(o.LogicalDate.Get()) { + var ret time.Time return ret } - return *o.RunType + return *o.LogicalDate.Get() } -// GetRunTypeOk returns a tuple with the RunType field value if set, nil otherwise +// GetLogicalDateOk returns a tuple with the LogicalDate field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DAGRun) GetRunTypeOk() (*string, bool) { - if o == nil || o.RunType == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DAGRun) GetLogicalDateOk() (*time.Time, bool) { + if o == nil { return nil, false } - return o.RunType, true + return o.LogicalDate.Get(), o.LogicalDate.IsSet() } -// HasRunType returns a boolean if a field has been set. -func (o *DAGRun) HasRunType() bool { - if o != nil && o.RunType != nil { +// HasLogicalDate returns a boolean if a field has been set. +func (o *DAGRun) HasLogicalDate() bool { + if o != nil && o.LogicalDate.IsSet() { return true } return false } -// SetRunType gets a reference to the given string and assigns it to the RunType field. -func (o *DAGRun) SetRunType(v string) { - o.RunType = &v +// SetLogicalDate gets a reference to the given NullableTime and assigns it to the LogicalDate field. +func (o *DAGRun) SetLogicalDate(v time.Time) { + o.LogicalDate.Set(&v) +} +// SetLogicalDateNil sets the value for LogicalDate to be an explicit nil +func (o *DAGRun) SetLogicalDateNil() { + o.LogicalDate.Set(nil) } -// GetState returns the State field value if set, zero value otherwise. -func (o *DAGRun) GetState() DagState { - if o == nil || o.State == nil { - var ret DagState +// UnsetLogicalDate ensures that no value is present for LogicalDate, not even an explicit nil +func (o *DAGRun) UnsetLogicalDate() { + o.LogicalDate.Unset() +} + +// GetNote returns the Note field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGRun) GetNote() string { + if o == nil || IsNil(o.Note.Get()) { + var ret string return ret } - return *o.State + return *o.Note.Get() } -// GetStateOk returns a tuple with the State field value if set, nil otherwise +// GetNoteOk returns a tuple with the Note field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DAGRun) GetStateOk() (*DagState, bool) { - if o == nil || o.State == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DAGRun) GetNoteOk() (*string, bool) { + if o == nil { return nil, false } - return o.State, true + return o.Note.Get(), o.Note.IsSet() } -// HasState returns a boolean if a field has been set. -func (o *DAGRun) HasState() bool { - if o != nil && o.State != nil { +// HasNote returns a boolean if a field has been set. +func (o *DAGRun) HasNote() bool { + if o != nil && o.Note.IsSet() { return true } return false } -// SetState gets a reference to the given DagState and assigns it to the State field. -func (o *DAGRun) SetState(v DagState) { - o.State = &v +// SetNote gets a reference to the given NullableString and assigns it to the Note field. +func (o *DAGRun) SetNote(v string) { + o.Note.Set(&v) +} +// SetNoteNil sets the value for Note to be an explicit nil +func (o *DAGRun) SetNoteNil() { + o.Note.Set(nil) } -// GetExternalTrigger returns the ExternalTrigger field value if set, zero value otherwise. -func (o *DAGRun) GetExternalTrigger() bool { - if o == nil || o.ExternalTrigger == nil { - var ret bool +// UnsetNote ensures that no value is present for Note, not even an explicit nil +func (o *DAGRun) UnsetNote() { + o.Note.Unset() +} + +// GetRunType returns the RunType field value if set, zero value otherwise. +func (o *DAGRun) GetRunType() string { + if o == nil || IsNil(o.RunType) { + var ret string return ret } - return *o.ExternalTrigger + return *o.RunType } -// GetExternalTriggerOk returns a tuple with the ExternalTrigger field value if set, nil otherwise +// GetRunTypeOk returns a tuple with the RunType field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DAGRun) GetExternalTriggerOk() (*bool, bool) { - if o == nil || o.ExternalTrigger == nil { +func (o *DAGRun) GetRunTypeOk() (*string, bool) { + if o == nil || IsNil(o.RunType) { return nil, false } - return o.ExternalTrigger, true + return o.RunType, true } -// HasExternalTrigger returns a boolean if a field has been set. -func (o *DAGRun) HasExternalTrigger() bool { - if o != nil && o.ExternalTrigger != nil { +// HasRunType returns a boolean if a field has been set. +func (o *DAGRun) HasRunType() bool { + if o != nil && !IsNil(o.RunType) { return true } return false } -// SetExternalTrigger gets a reference to the given bool and assigns it to the ExternalTrigger field. -func (o *DAGRun) SetExternalTrigger(v bool) { - o.ExternalTrigger = &v +// SetRunType gets a reference to the given string and assigns it to the RunType field. +func (o *DAGRun) SetRunType(v string) { + o.RunType = &v } -// GetConf returns the Conf field value if set, zero value otherwise. -func (o *DAGRun) GetConf() map[string]interface{} { - if o == nil || o.Conf == nil { - var ret map[string]interface{} +// GetStartDate returns the StartDate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DAGRun) GetStartDate() time.Time { + if o == nil || IsNil(o.StartDate.Get()) { + var ret time.Time return ret } - return *o.Conf + return *o.StartDate.Get() } -// GetConfOk returns a tuple with the Conf field value if set, nil otherwise +// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DAGRun) GetConfOk() (*map[string]interface{}, bool) { - if o == nil || o.Conf == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DAGRun) GetStartDateOk() (*time.Time, bool) { + if o == nil { return nil, false } - return o.Conf, true + return o.StartDate.Get(), o.StartDate.IsSet() } -// HasConf returns a boolean if a field has been set. -func (o *DAGRun) HasConf() bool { - if o != nil && o.Conf != nil { +// HasStartDate returns a boolean if a field has been set. +func (o *DAGRun) HasStartDate() bool { + if o != nil && o.StartDate.IsSet() { return true } return false } -// SetConf gets a reference to the given map[string]interface{} and assigns it to the Conf field. -func (o *DAGRun) SetConf(v map[string]interface{}) { - o.Conf = &v +// SetStartDate gets a reference to the given NullableTime and assigns it to the StartDate field. +func (o *DAGRun) SetStartDate(v time.Time) { + o.StartDate.Set(&v) +} +// SetStartDateNil sets the value for StartDate to be an explicit nil +func (o *DAGRun) SetStartDateNil() { + o.StartDate.Set(nil) } -// GetNote returns the Note field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DAGRun) GetNote() string { - if o == nil || o.Note.Get() == nil { - var ret string +// UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil +func (o *DAGRun) UnsetStartDate() { + o.StartDate.Unset() +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *DAGRun) GetState() DagState { + if o == nil || IsNil(o.State) { + var ret DagState return ret } - return *o.Note.Get() + return *o.State } -// GetNoteOk returns a tuple with the Note field value if set, nil otherwise +// GetStateOk returns a tuple with the State field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DAGRun) GetNoteOk() (*string, bool) { - if o == nil { +func (o *DAGRun) GetStateOk() (*DagState, bool) { + if o == nil || IsNil(o.State) { return nil, false } - return o.Note.Get(), o.Note.IsSet() + return o.State, true } -// HasNote returns a boolean if a field has been set. -func (o *DAGRun) HasNote() bool { - if o != nil && o.Note.IsSet() { +// HasState returns a boolean if a field has been set. +func (o *DAGRun) HasState() bool { + if o != nil && !IsNil(o.State) { return true } return false } -// SetNote gets a reference to the given NullableString and assigns it to the Note field. -func (o *DAGRun) SetNote(v string) { - o.Note.Set(&v) -} -// SetNoteNil sets the value for Note to be an explicit nil -func (o *DAGRun) SetNoteNil() { - o.Note.Set(nil) +// SetState gets a reference to the given DagState and assigns it to the State field. +func (o *DAGRun) SetState(v DagState) { + o.State = &v } -// UnsetNote ensures that no value is present for Note, not even an explicit nil -func (o *DAGRun) UnsetNote() { - o.Note.Unset() +func (o DAGRun) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) } -func (o DAGRun) MarshalJSON() ([]byte, error) { +func (o DAGRun) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.DagRunId.IsSet() { - toSerialize["dag_run_id"] = o.DagRunId.Get() + if !IsNil(o.Conf) { + toSerialize["conf"] = o.Conf } - if o.DagId != nil { + if !IsNil(o.DagId) { toSerialize["dag_id"] = o.DagId } - if o.LogicalDate.IsSet() { - toSerialize["logical_date"] = o.LogicalDate.Get() + if o.DagRunId.IsSet() { + toSerialize["dag_run_id"] = o.DagRunId.Get() } - if o.ExecutionDate.IsSet() { - toSerialize["execution_date"] = o.ExecutionDate.Get() + if o.DataIntervalEnd.IsSet() { + toSerialize["data_interval_end"] = o.DataIntervalEnd.Get() } - if o.StartDate.IsSet() { - toSerialize["start_date"] = o.StartDate.Get() + if o.DataIntervalStart.IsSet() { + toSerialize["data_interval_start"] = o.DataIntervalStart.Get() } if o.EndDate.IsSet() { toSerialize["end_date"] = o.EndDate.Get() } - if o.DataIntervalStart.IsSet() { - toSerialize["data_interval_start"] = o.DataIntervalStart.Get() + if o.ExecutionDate.IsSet() { + toSerialize["execution_date"] = o.ExecutionDate.Get() } - if o.DataIntervalEnd.IsSet() { - toSerialize["data_interval_end"] = o.DataIntervalEnd.Get() + if !IsNil(o.ExternalTrigger) { + toSerialize["external_trigger"] = o.ExternalTrigger } if o.LastSchedulingDecision.IsSet() { toSerialize["last_scheduling_decision"] = o.LastSchedulingDecision.Get() } - if o.RunType != nil { - toSerialize["run_type"] = o.RunType + if o.LogicalDate.IsSet() { + toSerialize["logical_date"] = o.LogicalDate.Get() } - if o.State != nil { - toSerialize["state"] = o.State + if o.Note.IsSet() { + toSerialize["note"] = o.Note.Get() } - if o.ExternalTrigger != nil { - toSerialize["external_trigger"] = o.ExternalTrigger + if !IsNil(o.RunType) { + toSerialize["run_type"] = o.RunType } - if o.Conf != nil { - toSerialize["conf"] = o.Conf + if o.StartDate.IsSet() { + toSerialize["start_date"] = o.StartDate.Get() } - if o.Note.IsSet() { - toSerialize["note"] = o.Note.Get() + if !IsNil(o.State) { + toSerialize["state"] = o.State } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableDAGRun struct { diff --git a/airflow/model_dag_run_collection.go b/airflow/model_dag_run_collection.go index 2315755..60292f3 100644 --- a/airflow/model_dag_run_collection.go +++ b/airflow/model_dag_run_collection.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,11 +15,14 @@ import ( "encoding/json" ) +// checks if the DAGRunCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DAGRunCollection{} + // DAGRunCollection Collection of DAG runs. *Changed in version 2.1.0*: 'total_entries' field is added. type DAGRunCollection struct { - DagRuns *[]DAGRun `json:"dag_runs,omitempty"` - // Count of objects in the current result set. + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. TotalEntries *int32 `json:"total_entries,omitempty"` + DagRuns []DAGRun `json:"dag_runs,omitempty"` } // NewDAGRunCollection instantiates a new DAGRunCollection object @@ -56,79 +42,87 @@ func NewDAGRunCollectionWithDefaults() *DAGRunCollection { return &this } -// GetDagRuns returns the DagRuns field value if set, zero value otherwise. -func (o *DAGRunCollection) GetDagRuns() []DAGRun { - if o == nil || o.DagRuns == nil { - var ret []DAGRun +// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. +func (o *DAGRunCollection) GetTotalEntries() int32 { + if o == nil || IsNil(o.TotalEntries) { + var ret int32 return ret } - return *o.DagRuns + return *o.TotalEntries } -// GetDagRunsOk returns a tuple with the DagRuns field value if set, nil otherwise +// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DAGRunCollection) GetDagRunsOk() (*[]DAGRun, bool) { - if o == nil || o.DagRuns == nil { +func (o *DAGRunCollection) GetTotalEntriesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalEntries) { return nil, false } - return o.DagRuns, true + return o.TotalEntries, true } -// HasDagRuns returns a boolean if a field has been set. -func (o *DAGRunCollection) HasDagRuns() bool { - if o != nil && o.DagRuns != nil { +// HasTotalEntries returns a boolean if a field has been set. +func (o *DAGRunCollection) HasTotalEntries() bool { + if o != nil && !IsNil(o.TotalEntries) { return true } return false } -// SetDagRuns gets a reference to the given []DAGRun and assigns it to the DagRuns field. -func (o *DAGRunCollection) SetDagRuns(v []DAGRun) { - o.DagRuns = &v +// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. +func (o *DAGRunCollection) SetTotalEntries(v int32) { + o.TotalEntries = &v } -// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. -func (o *DAGRunCollection) GetTotalEntries() int32 { - if o == nil || o.TotalEntries == nil { - var ret int32 +// GetDagRuns returns the DagRuns field value if set, zero value otherwise. +func (o *DAGRunCollection) GetDagRuns() []DAGRun { + if o == nil || IsNil(o.DagRuns) { + var ret []DAGRun return ret } - return *o.TotalEntries + return o.DagRuns } -// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise +// GetDagRunsOk returns a tuple with the DagRuns field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DAGRunCollection) GetTotalEntriesOk() (*int32, bool) { - if o == nil || o.TotalEntries == nil { +func (o *DAGRunCollection) GetDagRunsOk() ([]DAGRun, bool) { + if o == nil || IsNil(o.DagRuns) { return nil, false } - return o.TotalEntries, true + return o.DagRuns, true } -// HasTotalEntries returns a boolean if a field has been set. -func (o *DAGRunCollection) HasTotalEntries() bool { - if o != nil && o.TotalEntries != nil { +// HasDagRuns returns a boolean if a field has been set. +func (o *DAGRunCollection) HasDagRuns() bool { + if o != nil && !IsNil(o.DagRuns) { return true } return false } -// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. -func (o *DAGRunCollection) SetTotalEntries(v int32) { - o.TotalEntries = &v +// SetDagRuns gets a reference to the given []DAGRun and assigns it to the DagRuns field. +func (o *DAGRunCollection) SetDagRuns(v []DAGRun) { + o.DagRuns = v } func (o DAGRunCollection) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.DagRuns != nil { - toSerialize["dag_runs"] = o.DagRuns + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.TotalEntries != nil { + return json.Marshal(toSerialize) +} + +func (o DAGRunCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalEntries) { toSerialize["total_entries"] = o.TotalEntries } - return json.Marshal(toSerialize) + if !IsNil(o.DagRuns) { + toSerialize["dag_runs"] = o.DagRuns + } + return toSerialize, nil } type NullableDAGRunCollection struct { diff --git a/airflow/model_dag_schedule_dataset_reference.go b/airflow/model_dag_schedule_dataset_reference.go index 55931eb..731473e 100644 --- a/airflow/model_dag_schedule_dataset_reference.go +++ b/airflow/model_dag_schedule_dataset_reference.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,12 +15,15 @@ import ( "encoding/json" ) +// checks if the DagScheduleDatasetReference type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DagScheduleDatasetReference{} + // DagScheduleDatasetReference A datasets reference to a downstream DAG. *New in version 2.4.0* type DagScheduleDatasetReference struct { - // The DAG ID that depends on the dataset. - DagId NullableString `json:"dag_id,omitempty"` // The dataset reference creation time CreatedAt *string `json:"created_at,omitempty"` + // The DAG ID that depends on the dataset. + DagId NullableString `json:"dag_id,omitempty"` // The dataset reference update time UpdatedAt *string `json:"updated_at,omitempty"` } @@ -59,9 +45,41 @@ func NewDagScheduleDatasetReferenceWithDefaults() *DagScheduleDatasetReference { return &this } +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *DagScheduleDatasetReference) GetCreatedAt() string { + if o == nil || IsNil(o.CreatedAt) { + var ret string + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DagScheduleDatasetReference) GetCreatedAtOk() (*string, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *DagScheduleDatasetReference) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field. +func (o *DagScheduleDatasetReference) SetCreatedAt(v string) { + o.CreatedAt = &v +} + // GetDagId returns the DagId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DagScheduleDatasetReference) GetDagId() string { - if o == nil || o.DagId.Get() == nil { + if o == nil || IsNil(o.DagId.Get()) { var ret string return ret } @@ -72,7 +90,7 @@ func (o *DagScheduleDatasetReference) GetDagId() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DagScheduleDatasetReference) GetDagIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.DagId.Get(), o.DagId.IsSet() @@ -101,41 +119,9 @@ func (o *DagScheduleDatasetReference) UnsetDagId() { o.DagId.Unset() } -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *DagScheduleDatasetReference) GetCreatedAt() string { - if o == nil || o.CreatedAt == nil { - var ret string - return ret - } - return *o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DagScheduleDatasetReference) GetCreatedAtOk() (*string, bool) { - if o == nil || o.CreatedAt == nil { - return nil, false - } - return o.CreatedAt, true -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *DagScheduleDatasetReference) HasCreatedAt() bool { - if o != nil && o.CreatedAt != nil { - return true - } - - return false -} - -// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field. -func (o *DagScheduleDatasetReference) SetCreatedAt(v string) { - o.CreatedAt = &v -} - // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *DagScheduleDatasetReference) GetUpdatedAt() string { - if o == nil || o.UpdatedAt == nil { + if o == nil || IsNil(o.UpdatedAt) { var ret string return ret } @@ -145,7 +131,7 @@ func (o *DagScheduleDatasetReference) GetUpdatedAt() string { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *DagScheduleDatasetReference) GetUpdatedAtOk() (*string, bool) { - if o == nil || o.UpdatedAt == nil { + if o == nil || IsNil(o.UpdatedAt) { return nil, false } return o.UpdatedAt, true @@ -153,7 +139,7 @@ func (o *DagScheduleDatasetReference) GetUpdatedAtOk() (*string, bool) { // HasUpdatedAt returns a boolean if a field has been set. func (o *DagScheduleDatasetReference) HasUpdatedAt() bool { - if o != nil && o.UpdatedAt != nil { + if o != nil && !IsNil(o.UpdatedAt) { return true } @@ -166,17 +152,25 @@ func (o *DagScheduleDatasetReference) SetUpdatedAt(v string) { } func (o DagScheduleDatasetReference) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DagScheduleDatasetReference) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } if o.DagId.IsSet() { toSerialize["dag_id"] = o.DagId.Get() } - if o.CreatedAt != nil { - toSerialize["created_at"] = o.CreatedAt - } - if o.UpdatedAt != nil { + if !IsNil(o.UpdatedAt) { toSerialize["updated_at"] = o.UpdatedAt } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableDagScheduleDatasetReference struct { diff --git a/airflow/model_dag_state.go b/airflow/model_dag_state.go index e9795d2..f2cdada 100644 --- a/airflow/model_dag_state.go +++ b/airflow/model_dag_state.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -38,10 +21,10 @@ type DagState string // List of DagState const ( - DAGSTATE_QUEUED DagState = "queued" - DAGSTATE_RUNNING DagState = "running" - DAGSTATE_SUCCESS DagState = "success" - DAGSTATE_FAILED DagState = "failed" + QUEUED DagState = "queued" + RUNNING DagState = "running" + SUCCESS DagState = "success" + FAILED DagState = "failed" ) // All allowed values of DagState enum diff --git a/airflow/model_dag_stats_collection_item.go b/airflow/model_dag_stats_collection_item.go new file mode 100644 index 0000000..b15d39d --- /dev/null +++ b/airflow/model_dag_stats_collection_item.go @@ -0,0 +1,165 @@ +/* +Airflow API (Stable) + +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. + +API version: 2.10.5 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package airflow + +import ( + "encoding/json" +) + +// checks if the DagStatsCollectionItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DagStatsCollectionItem{} + +// DagStatsCollectionItem DagStats entry collection item. +type DagStatsCollectionItem struct { + // The DAG ID. + DagId *string `json:"dag_id,omitempty"` + Stats []DagStatsStateCollectionItem `json:"stats,omitempty"` +} + +// NewDagStatsCollectionItem instantiates a new DagStatsCollectionItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDagStatsCollectionItem() *DagStatsCollectionItem { + this := DagStatsCollectionItem{} + return &this +} + +// NewDagStatsCollectionItemWithDefaults instantiates a new DagStatsCollectionItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDagStatsCollectionItemWithDefaults() *DagStatsCollectionItem { + this := DagStatsCollectionItem{} + return &this +} + +// GetDagId returns the DagId field value if set, zero value otherwise. +func (o *DagStatsCollectionItem) GetDagId() string { + if o == nil || IsNil(o.DagId) { + var ret string + return ret + } + return *o.DagId +} + +// GetDagIdOk returns a tuple with the DagId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DagStatsCollectionItem) GetDagIdOk() (*string, bool) { + if o == nil || IsNil(o.DagId) { + return nil, false + } + return o.DagId, true +} + +// HasDagId returns a boolean if a field has been set. +func (o *DagStatsCollectionItem) HasDagId() bool { + if o != nil && !IsNil(o.DagId) { + return true + } + + return false +} + +// SetDagId gets a reference to the given string and assigns it to the DagId field. +func (o *DagStatsCollectionItem) SetDagId(v string) { + o.DagId = &v +} + +// GetStats returns the Stats field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DagStatsCollectionItem) GetStats() []DagStatsStateCollectionItem { + if o == nil { + var ret []DagStatsStateCollectionItem + return ret + } + return o.Stats +} + +// GetStatsOk returns a tuple with the Stats field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DagStatsCollectionItem) GetStatsOk() ([]DagStatsStateCollectionItem, bool) { + if o == nil || IsNil(o.Stats) { + return nil, false + } + return o.Stats, true +} + +// HasStats returns a boolean if a field has been set. +func (o *DagStatsCollectionItem) HasStats() bool { + if o != nil && !IsNil(o.Stats) { + return true + } + + return false +} + +// SetStats gets a reference to the given []DagStatsStateCollectionItem and assigns it to the Stats field. +func (o *DagStatsCollectionItem) SetStats(v []DagStatsStateCollectionItem) { + o.Stats = v +} + +func (o DagStatsCollectionItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DagStatsCollectionItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DagId) { + toSerialize["dag_id"] = o.DagId + } + if o.Stats != nil { + toSerialize["stats"] = o.Stats + } + return toSerialize, nil +} + +type NullableDagStatsCollectionItem struct { + value *DagStatsCollectionItem + isSet bool +} + +func (v NullableDagStatsCollectionItem) Get() *DagStatsCollectionItem { + return v.value +} + +func (v *NullableDagStatsCollectionItem) Set(val *DagStatsCollectionItem) { + v.value = val + v.isSet = true +} + +func (v NullableDagStatsCollectionItem) IsSet() bool { + return v.isSet +} + +func (v *NullableDagStatsCollectionItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDagStatsCollectionItem(val *DagStatsCollectionItem) *NullableDagStatsCollectionItem { + return &NullableDagStatsCollectionItem{value: val, isSet: true} +} + +func (v NullableDagStatsCollectionItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDagStatsCollectionItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/model_dag_stats_collection_schema.go b/airflow/model_dag_stats_collection_schema.go new file mode 100644 index 0000000..18ad6e0 --- /dev/null +++ b/airflow/model_dag_stats_collection_schema.go @@ -0,0 +1,164 @@ +/* +Airflow API (Stable) + +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. + +API version: 2.10.5 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package airflow + +import ( + "encoding/json" +) + +// checks if the DagStatsCollectionSchema type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DagStatsCollectionSchema{} + +// DagStatsCollectionSchema Collection of Dag statistics. +type DagStatsCollectionSchema struct { + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. + TotalEntries *int32 `json:"total_entries,omitempty"` + Dags []DagStatsCollectionItem `json:"dags,omitempty"` +} + +// NewDagStatsCollectionSchema instantiates a new DagStatsCollectionSchema object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDagStatsCollectionSchema() *DagStatsCollectionSchema { + this := DagStatsCollectionSchema{} + return &this +} + +// NewDagStatsCollectionSchemaWithDefaults instantiates a new DagStatsCollectionSchema object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDagStatsCollectionSchemaWithDefaults() *DagStatsCollectionSchema { + this := DagStatsCollectionSchema{} + return &this +} + +// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. +func (o *DagStatsCollectionSchema) GetTotalEntries() int32 { + if o == nil || IsNil(o.TotalEntries) { + var ret int32 + return ret + } + return *o.TotalEntries +} + +// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DagStatsCollectionSchema) GetTotalEntriesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalEntries) { + return nil, false + } + return o.TotalEntries, true +} + +// HasTotalEntries returns a boolean if a field has been set. +func (o *DagStatsCollectionSchema) HasTotalEntries() bool { + if o != nil && !IsNil(o.TotalEntries) { + return true + } + + return false +} + +// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. +func (o *DagStatsCollectionSchema) SetTotalEntries(v int32) { + o.TotalEntries = &v +} + +// GetDags returns the Dags field value if set, zero value otherwise. +func (o *DagStatsCollectionSchema) GetDags() []DagStatsCollectionItem { + if o == nil || IsNil(o.Dags) { + var ret []DagStatsCollectionItem + return ret + } + return o.Dags +} + +// GetDagsOk returns a tuple with the Dags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DagStatsCollectionSchema) GetDagsOk() ([]DagStatsCollectionItem, bool) { + if o == nil || IsNil(o.Dags) { + return nil, false + } + return o.Dags, true +} + +// HasDags returns a boolean if a field has been set. +func (o *DagStatsCollectionSchema) HasDags() bool { + if o != nil && !IsNil(o.Dags) { + return true + } + + return false +} + +// SetDags gets a reference to the given []DagStatsCollectionItem and assigns it to the Dags field. +func (o *DagStatsCollectionSchema) SetDags(v []DagStatsCollectionItem) { + o.Dags = v +} + +func (o DagStatsCollectionSchema) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DagStatsCollectionSchema) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalEntries) { + toSerialize["total_entries"] = o.TotalEntries + } + if !IsNil(o.Dags) { + toSerialize["dags"] = o.Dags + } + return toSerialize, nil +} + +type NullableDagStatsCollectionSchema struct { + value *DagStatsCollectionSchema + isSet bool +} + +func (v NullableDagStatsCollectionSchema) Get() *DagStatsCollectionSchema { + return v.value +} + +func (v *NullableDagStatsCollectionSchema) Set(val *DagStatsCollectionSchema) { + v.value = val + v.isSet = true +} + +func (v NullableDagStatsCollectionSchema) IsSet() bool { + return v.isSet +} + +func (v *NullableDagStatsCollectionSchema) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDagStatsCollectionSchema(val *DagStatsCollectionSchema) *NullableDagStatsCollectionSchema { + return &NullableDagStatsCollectionSchema{value: val, isSet: true} +} + +func (v NullableDagStatsCollectionSchema) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDagStatsCollectionSchema) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/model_dag_stats_state_collection_item.go b/airflow/model_dag_stats_state_collection_item.go new file mode 100644 index 0000000..a9a8bad --- /dev/null +++ b/airflow/model_dag_stats_state_collection_item.go @@ -0,0 +1,165 @@ +/* +Airflow API (Stable) + +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. + +API version: 2.10.5 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package airflow + +import ( + "encoding/json" +) + +// checks if the DagStatsStateCollectionItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DagStatsStateCollectionItem{} + +// DagStatsStateCollectionItem DagStatsState entry collection item. +type DagStatsStateCollectionItem struct { + // The DAG state count. + Count *int32 `json:"count,omitempty"` + // The DAG state. + State *string `json:"state,omitempty"` +} + +// NewDagStatsStateCollectionItem instantiates a new DagStatsStateCollectionItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDagStatsStateCollectionItem() *DagStatsStateCollectionItem { + this := DagStatsStateCollectionItem{} + return &this +} + +// NewDagStatsStateCollectionItemWithDefaults instantiates a new DagStatsStateCollectionItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDagStatsStateCollectionItemWithDefaults() *DagStatsStateCollectionItem { + this := DagStatsStateCollectionItem{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *DagStatsStateCollectionItem) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DagStatsStateCollectionItem) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *DagStatsStateCollectionItem) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *DagStatsStateCollectionItem) SetCount(v int32) { + o.Count = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *DagStatsStateCollectionItem) GetState() string { + if o == nil || IsNil(o.State) { + var ret string + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DagStatsStateCollectionItem) GetStateOk() (*string, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *DagStatsStateCollectionItem) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *DagStatsStateCollectionItem) SetState(v string) { + o.State = &v +} + +func (o DagStatsStateCollectionItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DagStatsStateCollectionItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + return toSerialize, nil +} + +type NullableDagStatsStateCollectionItem struct { + value *DagStatsStateCollectionItem + isSet bool +} + +func (v NullableDagStatsStateCollectionItem) Get() *DagStatsStateCollectionItem { + return v.value +} + +func (v *NullableDagStatsStateCollectionItem) Set(val *DagStatsStateCollectionItem) { + v.value = val + v.isSet = true +} + +func (v NullableDagStatsStateCollectionItem) IsSet() bool { + return v.isSet +} + +func (v *NullableDagStatsStateCollectionItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDagStatsStateCollectionItem(val *DagStatsStateCollectionItem) *NullableDagStatsStateCollectionItem { + return &NullableDagStatsStateCollectionItem{value: val, isSet: true} +} + +func (v NullableDagStatsStateCollectionItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDagStatsStateCollectionItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/model_dag_warning.go b/airflow/model_dag_warning.go index a916267..5cffc43 100644 --- a/airflow/model_dag_warning.go +++ b/airflow/model_dag_warning.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,16 +15,19 @@ import ( "encoding/json" ) +// checks if the DagWarning type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DagWarning{} + // DagWarning struct for DagWarning type DagWarning struct { // The dag_id. DagId *string `json:"dag_id,omitempty"` - // The warning type for the dag warning. - WarningType *string `json:"warning_type,omitempty"` // The message for the dag warning. Message *string `json:"message,omitempty"` // The time when this warning was logged. Timestamp *string `json:"timestamp,omitempty"` + // The warning type for the dag warning. + WarningType *string `json:"warning_type,omitempty"` } // NewDagWarning instantiates a new DagWarning object @@ -63,7 +49,7 @@ func NewDagWarningWithDefaults() *DagWarning { // GetDagId returns the DagId field value if set, zero value otherwise. func (o *DagWarning) GetDagId() string { - if o == nil || o.DagId == nil { + if o == nil || IsNil(o.DagId) { var ret string return ret } @@ -73,7 +59,7 @@ func (o *DagWarning) GetDagId() string { // GetDagIdOk returns a tuple with the DagId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *DagWarning) GetDagIdOk() (*string, bool) { - if o == nil || o.DagId == nil { + if o == nil || IsNil(o.DagId) { return nil, false } return o.DagId, true @@ -81,7 +67,7 @@ func (o *DagWarning) GetDagIdOk() (*string, bool) { // HasDagId returns a boolean if a field has been set. func (o *DagWarning) HasDagId() bool { - if o != nil && o.DagId != nil { + if o != nil && !IsNil(o.DagId) { return true } @@ -93,41 +79,9 @@ func (o *DagWarning) SetDagId(v string) { o.DagId = &v } -// GetWarningType returns the WarningType field value if set, zero value otherwise. -func (o *DagWarning) GetWarningType() string { - if o == nil || o.WarningType == nil { - var ret string - return ret - } - return *o.WarningType -} - -// GetWarningTypeOk returns a tuple with the WarningType field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DagWarning) GetWarningTypeOk() (*string, bool) { - if o == nil || o.WarningType == nil { - return nil, false - } - return o.WarningType, true -} - -// HasWarningType returns a boolean if a field has been set. -func (o *DagWarning) HasWarningType() bool { - if o != nil && o.WarningType != nil { - return true - } - - return false -} - -// SetWarningType gets a reference to the given string and assigns it to the WarningType field. -func (o *DagWarning) SetWarningType(v string) { - o.WarningType = &v -} - // GetMessage returns the Message field value if set, zero value otherwise. func (o *DagWarning) GetMessage() string { - if o == nil || o.Message == nil { + if o == nil || IsNil(o.Message) { var ret string return ret } @@ -137,7 +91,7 @@ func (o *DagWarning) GetMessage() string { // GetMessageOk returns a tuple with the Message field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *DagWarning) GetMessageOk() (*string, bool) { - if o == nil || o.Message == nil { + if o == nil || IsNil(o.Message) { return nil, false } return o.Message, true @@ -145,7 +99,7 @@ func (o *DagWarning) GetMessageOk() (*string, bool) { // HasMessage returns a boolean if a field has been set. func (o *DagWarning) HasMessage() bool { - if o != nil && o.Message != nil { + if o != nil && !IsNil(o.Message) { return true } @@ -159,7 +113,7 @@ func (o *DagWarning) SetMessage(v string) { // GetTimestamp returns the Timestamp field value if set, zero value otherwise. func (o *DagWarning) GetTimestamp() string { - if o == nil || o.Timestamp == nil { + if o == nil || IsNil(o.Timestamp) { var ret string return ret } @@ -169,7 +123,7 @@ func (o *DagWarning) GetTimestamp() string { // GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *DagWarning) GetTimestampOk() (*string, bool) { - if o == nil || o.Timestamp == nil { + if o == nil || IsNil(o.Timestamp) { return nil, false } return o.Timestamp, true @@ -177,7 +131,7 @@ func (o *DagWarning) GetTimestampOk() (*string, bool) { // HasTimestamp returns a boolean if a field has been set. func (o *DagWarning) HasTimestamp() bool { - if o != nil && o.Timestamp != nil { + if o != nil && !IsNil(o.Timestamp) { return true } @@ -189,21 +143,61 @@ func (o *DagWarning) SetTimestamp(v string) { o.Timestamp = &v } +// GetWarningType returns the WarningType field value if set, zero value otherwise. +func (o *DagWarning) GetWarningType() string { + if o == nil || IsNil(o.WarningType) { + var ret string + return ret + } + return *o.WarningType +} + +// GetWarningTypeOk returns a tuple with the WarningType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DagWarning) GetWarningTypeOk() (*string, bool) { + if o == nil || IsNil(o.WarningType) { + return nil, false + } + return o.WarningType, true +} + +// HasWarningType returns a boolean if a field has been set. +func (o *DagWarning) HasWarningType() bool { + if o != nil && !IsNil(o.WarningType) { + return true + } + + return false +} + +// SetWarningType gets a reference to the given string and assigns it to the WarningType field. +func (o *DagWarning) SetWarningType(v string) { + o.WarningType = &v +} + func (o DagWarning) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DagWarning) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.DagId != nil { + if !IsNil(o.DagId) { toSerialize["dag_id"] = o.DagId } - if o.WarningType != nil { - toSerialize["warning_type"] = o.WarningType - } - if o.Message != nil { + if !IsNil(o.Message) { toSerialize["message"] = o.Message } - if o.Timestamp != nil { + if !IsNil(o.Timestamp) { toSerialize["timestamp"] = o.Timestamp } - return json.Marshal(toSerialize) + if !IsNil(o.WarningType) { + toSerialize["warning_type"] = o.WarningType + } + return toSerialize, nil } type NullableDagWarning struct { diff --git a/airflow/model_dag_warning_collection.go b/airflow/model_dag_warning_collection.go index 7e3bee6..12e4ff3 100644 --- a/airflow/model_dag_warning_collection.go +++ b/airflow/model_dag_warning_collection.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,11 +15,14 @@ import ( "encoding/json" ) +// checks if the DagWarningCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DagWarningCollection{} + // DagWarningCollection Collection of DAG warnings. type DagWarningCollection struct { - ImportErrors *[]DagWarning `json:"import_errors,omitempty"` - // Count of objects in the current result set. + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. TotalEntries *int32 `json:"total_entries,omitempty"` + DagWarnings []DagWarning `json:"dag_warnings,omitempty"` } // NewDagWarningCollection instantiates a new DagWarningCollection object @@ -56,79 +42,87 @@ func NewDagWarningCollectionWithDefaults() *DagWarningCollection { return &this } -// GetImportErrors returns the ImportErrors field value if set, zero value otherwise. -func (o *DagWarningCollection) GetImportErrors() []DagWarning { - if o == nil || o.ImportErrors == nil { - var ret []DagWarning +// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. +func (o *DagWarningCollection) GetTotalEntries() int32 { + if o == nil || IsNil(o.TotalEntries) { + var ret int32 return ret } - return *o.ImportErrors + return *o.TotalEntries } -// GetImportErrorsOk returns a tuple with the ImportErrors field value if set, nil otherwise +// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DagWarningCollection) GetImportErrorsOk() (*[]DagWarning, bool) { - if o == nil || o.ImportErrors == nil { +func (o *DagWarningCollection) GetTotalEntriesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalEntries) { return nil, false } - return o.ImportErrors, true + return o.TotalEntries, true } -// HasImportErrors returns a boolean if a field has been set. -func (o *DagWarningCollection) HasImportErrors() bool { - if o != nil && o.ImportErrors != nil { +// HasTotalEntries returns a boolean if a field has been set. +func (o *DagWarningCollection) HasTotalEntries() bool { + if o != nil && !IsNil(o.TotalEntries) { return true } return false } -// SetImportErrors gets a reference to the given []DagWarning and assigns it to the ImportErrors field. -func (o *DagWarningCollection) SetImportErrors(v []DagWarning) { - o.ImportErrors = &v +// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. +func (o *DagWarningCollection) SetTotalEntries(v int32) { + o.TotalEntries = &v } -// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. -func (o *DagWarningCollection) GetTotalEntries() int32 { - if o == nil || o.TotalEntries == nil { - var ret int32 +// GetDagWarnings returns the DagWarnings field value if set, zero value otherwise. +func (o *DagWarningCollection) GetDagWarnings() []DagWarning { + if o == nil || IsNil(o.DagWarnings) { + var ret []DagWarning return ret } - return *o.TotalEntries + return o.DagWarnings } -// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise +// GetDagWarningsOk returns a tuple with the DagWarnings field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DagWarningCollection) GetTotalEntriesOk() (*int32, bool) { - if o == nil || o.TotalEntries == nil { +func (o *DagWarningCollection) GetDagWarningsOk() ([]DagWarning, bool) { + if o == nil || IsNil(o.DagWarnings) { return nil, false } - return o.TotalEntries, true + return o.DagWarnings, true } -// HasTotalEntries returns a boolean if a field has been set. -func (o *DagWarningCollection) HasTotalEntries() bool { - if o != nil && o.TotalEntries != nil { +// HasDagWarnings returns a boolean if a field has been set. +func (o *DagWarningCollection) HasDagWarnings() bool { + if o != nil && !IsNil(o.DagWarnings) { return true } return false } -// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. -func (o *DagWarningCollection) SetTotalEntries(v int32) { - o.TotalEntries = &v +// SetDagWarnings gets a reference to the given []DagWarning and assigns it to the DagWarnings field. +func (o *DagWarningCollection) SetDagWarnings(v []DagWarning) { + o.DagWarnings = v } func (o DagWarningCollection) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.ImportErrors != nil { - toSerialize["import_errors"] = o.ImportErrors + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.TotalEntries != nil { + return json.Marshal(toSerialize) +} + +func (o DagWarningCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalEntries) { toSerialize["total_entries"] = o.TotalEntries } - return json.Marshal(toSerialize) + if !IsNil(o.DagWarnings) { + toSerialize["dag_warnings"] = o.DagWarnings + } + return toSerialize, nil } type NullableDagWarningCollection struct { diff --git a/airflow/model_dataset.go b/airflow/model_dataset.go index c0b4ae9..5a43ca3 100644 --- a/airflow/model_dataset.go +++ b/airflow/model_dataset.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,20 +15,23 @@ import ( "encoding/json" ) +// checks if the Dataset type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Dataset{} + // Dataset A dataset item. *New in version 2.4.0* type Dataset struct { - // The dataset id - Id *int32 `json:"id,omitempty"` - // The dataset uri - Uri *string `json:"uri,omitempty"` - // The dataset extra - Extra map[string]interface{} `json:"extra,omitempty"` + ConsumingDags []DagScheduleDatasetReference `json:"consuming_dags,omitempty"` // The dataset creation time CreatedAt *string `json:"created_at,omitempty"` + // The dataset extra + Extra map[string]interface{} `json:"extra,omitempty"` + // The dataset id + Id *int32 `json:"id,omitempty"` + ProducingTasks []TaskOutletDatasetReference `json:"producing_tasks,omitempty"` // The dataset update time UpdatedAt *string `json:"updated_at,omitempty"` - ConsumingDags *[]DagScheduleDatasetReference `json:"consuming_dags,omitempty"` - ProducingTasks *[]TaskOutletDatasetReference `json:"producing_tasks,omitempty"` + // The dataset uri + Uri *string `json:"uri,omitempty"` } // NewDataset instantiates a new Dataset object @@ -65,73 +51,73 @@ func NewDatasetWithDefaults() *Dataset { return &this } -// GetId returns the Id field value if set, zero value otherwise. -func (o *Dataset) GetId() int32 { - if o == nil || o.Id == nil { - var ret int32 +// GetConsumingDags returns the ConsumingDags field value if set, zero value otherwise. +func (o *Dataset) GetConsumingDags() []DagScheduleDatasetReference { + if o == nil || IsNil(o.ConsumingDags) { + var ret []DagScheduleDatasetReference return ret } - return *o.Id + return o.ConsumingDags } -// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// GetConsumingDagsOk returns a tuple with the ConsumingDags field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Dataset) GetIdOk() (*int32, bool) { - if o == nil || o.Id == nil { +func (o *Dataset) GetConsumingDagsOk() ([]DagScheduleDatasetReference, bool) { + if o == nil || IsNil(o.ConsumingDags) { return nil, false } - return o.Id, true + return o.ConsumingDags, true } -// HasId returns a boolean if a field has been set. -func (o *Dataset) HasId() bool { - if o != nil && o.Id != nil { +// HasConsumingDags returns a boolean if a field has been set. +func (o *Dataset) HasConsumingDags() bool { + if o != nil && !IsNil(o.ConsumingDags) { return true } return false } -// SetId gets a reference to the given int32 and assigns it to the Id field. -func (o *Dataset) SetId(v int32) { - o.Id = &v +// SetConsumingDags gets a reference to the given []DagScheduleDatasetReference and assigns it to the ConsumingDags field. +func (o *Dataset) SetConsumingDags(v []DagScheduleDatasetReference) { + o.ConsumingDags = v } -// GetUri returns the Uri field value if set, zero value otherwise. -func (o *Dataset) GetUri() string { - if o == nil || o.Uri == nil { +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Dataset) GetCreatedAt() string { + if o == nil || IsNil(o.CreatedAt) { var ret string return ret } - return *o.Uri + return *o.CreatedAt } -// GetUriOk returns a tuple with the Uri field value if set, nil otherwise +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Dataset) GetUriOk() (*string, bool) { - if o == nil || o.Uri == nil { +func (o *Dataset) GetCreatedAtOk() (*string, bool) { + if o == nil || IsNil(o.CreatedAt) { return nil, false } - return o.Uri, true + return o.CreatedAt, true } -// HasUri returns a boolean if a field has been set. -func (o *Dataset) HasUri() bool { - if o != nil && o.Uri != nil { +// HasCreatedAt returns a boolean if a field has been set. +func (o *Dataset) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { return true } return false } -// SetUri gets a reference to the given string and assigns it to the Uri field. -func (o *Dataset) SetUri(v string) { - o.Uri = &v +// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field. +func (o *Dataset) SetCreatedAt(v string) { + o.CreatedAt = &v } // GetExtra returns the Extra field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Dataset) GetExtra() map[string]interface{} { - if o == nil { + if o == nil { var ret map[string]interface{} return ret } @@ -141,16 +127,16 @@ func (o *Dataset) GetExtra() map[string]interface{} { // GetExtraOk returns a tuple with the Extra field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Dataset) GetExtraOk() (*map[string]interface{}, bool) { - if o == nil || o.Extra == nil { - return nil, false +func (o *Dataset) GetExtraOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Extra) { + return map[string]interface{}{}, false } - return &o.Extra, true + return o.Extra, true } // HasExtra returns a boolean if a field has been set. func (o *Dataset) HasExtra() bool { - if o != nil && o.Extra != nil { + if o != nil && !IsNil(o.Extra) { return true } @@ -162,158 +148,166 @@ func (o *Dataset) SetExtra(v map[string]interface{}) { o.Extra = v } -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *Dataset) GetCreatedAt() string { - if o == nil || o.CreatedAt == nil { - var ret string +// GetId returns the Id field value if set, zero value otherwise. +func (o *Dataset) GetId() int32 { + if o == nil || IsNil(o.Id) { + var ret int32 return ret } - return *o.CreatedAt + return *o.Id } -// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Dataset) GetCreatedAtOk() (*string, bool) { - if o == nil || o.CreatedAt == nil { +func (o *Dataset) GetIdOk() (*int32, bool) { + if o == nil || IsNil(o.Id) { return nil, false } - return o.CreatedAt, true + return o.Id, true } -// HasCreatedAt returns a boolean if a field has been set. -func (o *Dataset) HasCreatedAt() bool { - if o != nil && o.CreatedAt != nil { +// HasId returns a boolean if a field has been set. +func (o *Dataset) HasId() bool { + if o != nil && !IsNil(o.Id) { return true } return false } -// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field. -func (o *Dataset) SetCreatedAt(v string) { - o.CreatedAt = &v +// SetId gets a reference to the given int32 and assigns it to the Id field. +func (o *Dataset) SetId(v int32) { + o.Id = &v } -// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. -func (o *Dataset) GetUpdatedAt() string { - if o == nil || o.UpdatedAt == nil { - var ret string +// GetProducingTasks returns the ProducingTasks field value if set, zero value otherwise. +func (o *Dataset) GetProducingTasks() []TaskOutletDatasetReference { + if o == nil || IsNil(o.ProducingTasks) { + var ret []TaskOutletDatasetReference return ret } - return *o.UpdatedAt + return o.ProducingTasks } -// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// GetProducingTasksOk returns a tuple with the ProducingTasks field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Dataset) GetUpdatedAtOk() (*string, bool) { - if o == nil || o.UpdatedAt == nil { +func (o *Dataset) GetProducingTasksOk() ([]TaskOutletDatasetReference, bool) { + if o == nil || IsNil(o.ProducingTasks) { return nil, false } - return o.UpdatedAt, true + return o.ProducingTasks, true } -// HasUpdatedAt returns a boolean if a field has been set. -func (o *Dataset) HasUpdatedAt() bool { - if o != nil && o.UpdatedAt != nil { +// HasProducingTasks returns a boolean if a field has been set. +func (o *Dataset) HasProducingTasks() bool { + if o != nil && !IsNil(o.ProducingTasks) { return true } return false } -// SetUpdatedAt gets a reference to the given string and assigns it to the UpdatedAt field. -func (o *Dataset) SetUpdatedAt(v string) { - o.UpdatedAt = &v +// SetProducingTasks gets a reference to the given []TaskOutletDatasetReference and assigns it to the ProducingTasks field. +func (o *Dataset) SetProducingTasks(v []TaskOutletDatasetReference) { + o.ProducingTasks = v } -// GetConsumingDags returns the ConsumingDags field value if set, zero value otherwise. -func (o *Dataset) GetConsumingDags() []DagScheduleDatasetReference { - if o == nil || o.ConsumingDags == nil { - var ret []DagScheduleDatasetReference +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Dataset) GetUpdatedAt() string { + if o == nil || IsNil(o.UpdatedAt) { + var ret string return ret } - return *o.ConsumingDags + return *o.UpdatedAt } -// GetConsumingDagsOk returns a tuple with the ConsumingDags field value if set, nil otherwise +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Dataset) GetConsumingDagsOk() (*[]DagScheduleDatasetReference, bool) { - if o == nil || o.ConsumingDags == nil { +func (o *Dataset) GetUpdatedAtOk() (*string, bool) { + if o == nil || IsNil(o.UpdatedAt) { return nil, false } - return o.ConsumingDags, true + return o.UpdatedAt, true } -// HasConsumingDags returns a boolean if a field has been set. -func (o *Dataset) HasConsumingDags() bool { - if o != nil && o.ConsumingDags != nil { +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Dataset) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { return true } return false } -// SetConsumingDags gets a reference to the given []DagScheduleDatasetReference and assigns it to the ConsumingDags field. -func (o *Dataset) SetConsumingDags(v []DagScheduleDatasetReference) { - o.ConsumingDags = &v +// SetUpdatedAt gets a reference to the given string and assigns it to the UpdatedAt field. +func (o *Dataset) SetUpdatedAt(v string) { + o.UpdatedAt = &v } -// GetProducingTasks returns the ProducingTasks field value if set, zero value otherwise. -func (o *Dataset) GetProducingTasks() []TaskOutletDatasetReference { - if o == nil || o.ProducingTasks == nil { - var ret []TaskOutletDatasetReference +// GetUri returns the Uri field value if set, zero value otherwise. +func (o *Dataset) GetUri() string { + if o == nil || IsNil(o.Uri) { + var ret string return ret } - return *o.ProducingTasks + return *o.Uri } -// GetProducingTasksOk returns a tuple with the ProducingTasks field value if set, nil otherwise +// GetUriOk returns a tuple with the Uri field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Dataset) GetProducingTasksOk() (*[]TaskOutletDatasetReference, bool) { - if o == nil || o.ProducingTasks == nil { +func (o *Dataset) GetUriOk() (*string, bool) { + if o == nil || IsNil(o.Uri) { return nil, false } - return o.ProducingTasks, true + return o.Uri, true } -// HasProducingTasks returns a boolean if a field has been set. -func (o *Dataset) HasProducingTasks() bool { - if o != nil && o.ProducingTasks != nil { +// HasUri returns a boolean if a field has been set. +func (o *Dataset) HasUri() bool { + if o != nil && !IsNil(o.Uri) { return true } return false } -// SetProducingTasks gets a reference to the given []TaskOutletDatasetReference and assigns it to the ProducingTasks field. -func (o *Dataset) SetProducingTasks(v []TaskOutletDatasetReference) { - o.ProducingTasks = &v +// SetUri gets a reference to the given string and assigns it to the Uri field. +func (o *Dataset) SetUri(v string) { + o.Uri = &v } func (o Dataset) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Dataset) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Id != nil { - toSerialize["id"] = o.Id + if !IsNil(o.ConsumingDags) { + toSerialize["consuming_dags"] = o.ConsumingDags } - if o.Uri != nil { - toSerialize["uri"] = o.Uri + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt } if o.Extra != nil { toSerialize["extra"] = o.Extra } - if o.CreatedAt != nil { - toSerialize["created_at"] = o.CreatedAt + if !IsNil(o.Id) { + toSerialize["id"] = o.Id } - if o.UpdatedAt != nil { - toSerialize["updated_at"] = o.UpdatedAt + if !IsNil(o.ProducingTasks) { + toSerialize["producing_tasks"] = o.ProducingTasks } - if o.ConsumingDags != nil { - toSerialize["consuming_dags"] = o.ConsumingDags + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt } - if o.ProducingTasks != nil { - toSerialize["producing_tasks"] = o.ProducingTasks + if !IsNil(o.Uri) { + toSerialize["uri"] = o.Uri } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableDataset struct { diff --git a/airflow/model_dataset_collection.go b/airflow/model_dataset_collection.go index 400071f..8c0813d 100644 --- a/airflow/model_dataset_collection.go +++ b/airflow/model_dataset_collection.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,11 +15,14 @@ import ( "encoding/json" ) +// checks if the DatasetCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DatasetCollection{} + // DatasetCollection A collection of datasets. *New in version 2.4.0* type DatasetCollection struct { - Datasets *[]Dataset `json:"datasets,omitempty"` - // Count of objects in the current result set. + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. TotalEntries *int32 `json:"total_entries,omitempty"` + Datasets []Dataset `json:"datasets,omitempty"` } // NewDatasetCollection instantiates a new DatasetCollection object @@ -56,79 +42,87 @@ func NewDatasetCollectionWithDefaults() *DatasetCollection { return &this } -// GetDatasets returns the Datasets field value if set, zero value otherwise. -func (o *DatasetCollection) GetDatasets() []Dataset { - if o == nil || o.Datasets == nil { - var ret []Dataset +// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. +func (o *DatasetCollection) GetTotalEntries() int32 { + if o == nil || IsNil(o.TotalEntries) { + var ret int32 return ret } - return *o.Datasets + return *o.TotalEntries } -// GetDatasetsOk returns a tuple with the Datasets field value if set, nil otherwise +// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DatasetCollection) GetDatasetsOk() (*[]Dataset, bool) { - if o == nil || o.Datasets == nil { +func (o *DatasetCollection) GetTotalEntriesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalEntries) { return nil, false } - return o.Datasets, true + return o.TotalEntries, true } -// HasDatasets returns a boolean if a field has been set. -func (o *DatasetCollection) HasDatasets() bool { - if o != nil && o.Datasets != nil { +// HasTotalEntries returns a boolean if a field has been set. +func (o *DatasetCollection) HasTotalEntries() bool { + if o != nil && !IsNil(o.TotalEntries) { return true } return false } -// SetDatasets gets a reference to the given []Dataset and assigns it to the Datasets field. -func (o *DatasetCollection) SetDatasets(v []Dataset) { - o.Datasets = &v +// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. +func (o *DatasetCollection) SetTotalEntries(v int32) { + o.TotalEntries = &v } -// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. -func (o *DatasetCollection) GetTotalEntries() int32 { - if o == nil || o.TotalEntries == nil { - var ret int32 +// GetDatasets returns the Datasets field value if set, zero value otherwise. +func (o *DatasetCollection) GetDatasets() []Dataset { + if o == nil || IsNil(o.Datasets) { + var ret []Dataset return ret } - return *o.TotalEntries + return o.Datasets } -// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise +// GetDatasetsOk returns a tuple with the Datasets field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DatasetCollection) GetTotalEntriesOk() (*int32, bool) { - if o == nil || o.TotalEntries == nil { +func (o *DatasetCollection) GetDatasetsOk() ([]Dataset, bool) { + if o == nil || IsNil(o.Datasets) { return nil, false } - return o.TotalEntries, true + return o.Datasets, true } -// HasTotalEntries returns a boolean if a field has been set. -func (o *DatasetCollection) HasTotalEntries() bool { - if o != nil && o.TotalEntries != nil { +// HasDatasets returns a boolean if a field has been set. +func (o *DatasetCollection) HasDatasets() bool { + if o != nil && !IsNil(o.Datasets) { return true } return false } -// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. -func (o *DatasetCollection) SetTotalEntries(v int32) { - o.TotalEntries = &v +// SetDatasets gets a reference to the given []Dataset and assigns it to the Datasets field. +func (o *DatasetCollection) SetDatasets(v []Dataset) { + o.Datasets = v } func (o DatasetCollection) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Datasets != nil { - toSerialize["datasets"] = o.Datasets + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.TotalEntries != nil { + return json.Marshal(toSerialize) +} + +func (o DatasetCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalEntries) { toSerialize["total_entries"] = o.TotalEntries } - return json.Marshal(toSerialize) + if !IsNil(o.Datasets) { + toSerialize["datasets"] = o.Datasets + } + return toSerialize, nil } type NullableDatasetCollection struct { diff --git a/airflow/model_dataset_event.go b/airflow/model_dataset_event.go index ca0c05d..524294f 100644 --- a/airflow/model_dataset_event.go +++ b/airflow/model_dataset_event.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,8 +15,12 @@ import ( "encoding/json" ) +// checks if the DatasetEvent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DatasetEvent{} + // DatasetEvent A dataset event. *New in version 2.4.0* type DatasetEvent struct { + CreatedDagruns []BasicDAGRun `json:"created_dagruns,omitempty"` // The dataset id DatasetId *int32 `json:"dataset_id,omitempty"` // The URI of the dataset @@ -42,13 +29,12 @@ type DatasetEvent struct { Extra map[string]interface{} `json:"extra,omitempty"` // The DAG ID that updated the dataset. SourceDagId NullableString `json:"source_dag_id,omitempty"` - // The task ID that updated the dataset. - SourceTaskId NullableString `json:"source_task_id,omitempty"` - // The DAG run ID that updated the dataset. - SourceRunId NullableString `json:"source_run_id,omitempty"` // The task map index that updated the dataset. SourceMapIndex NullableInt32 `json:"source_map_index,omitempty"` - CreatedDagruns *[]BasicDAGRun `json:"created_dagruns,omitempty"` + // The DAG run ID that updated the dataset. + SourceRunId NullableString `json:"source_run_id,omitempty"` + // The task ID that updated the dataset. + SourceTaskId NullableString `json:"source_task_id,omitempty"` // The dataset event creation time Timestamp *string `json:"timestamp,omitempty"` } @@ -70,9 +56,41 @@ func NewDatasetEventWithDefaults() *DatasetEvent { return &this } +// GetCreatedDagruns returns the CreatedDagruns field value if set, zero value otherwise. +func (o *DatasetEvent) GetCreatedDagruns() []BasicDAGRun { + if o == nil || IsNil(o.CreatedDagruns) { + var ret []BasicDAGRun + return ret + } + return o.CreatedDagruns +} + +// GetCreatedDagrunsOk returns a tuple with the CreatedDagruns field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DatasetEvent) GetCreatedDagrunsOk() ([]BasicDAGRun, bool) { + if o == nil || IsNil(o.CreatedDagruns) { + return nil, false + } + return o.CreatedDagruns, true +} + +// HasCreatedDagruns returns a boolean if a field has been set. +func (o *DatasetEvent) HasCreatedDagruns() bool { + if o != nil && !IsNil(o.CreatedDagruns) { + return true + } + + return false +} + +// SetCreatedDagruns gets a reference to the given []BasicDAGRun and assigns it to the CreatedDagruns field. +func (o *DatasetEvent) SetCreatedDagruns(v []BasicDAGRun) { + o.CreatedDagruns = v +} + // GetDatasetId returns the DatasetId field value if set, zero value otherwise. func (o *DatasetEvent) GetDatasetId() int32 { - if o == nil || o.DatasetId == nil { + if o == nil || IsNil(o.DatasetId) { var ret int32 return ret } @@ -82,7 +100,7 @@ func (o *DatasetEvent) GetDatasetId() int32 { // GetDatasetIdOk returns a tuple with the DatasetId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *DatasetEvent) GetDatasetIdOk() (*int32, bool) { - if o == nil || o.DatasetId == nil { + if o == nil || IsNil(o.DatasetId) { return nil, false } return o.DatasetId, true @@ -90,7 +108,7 @@ func (o *DatasetEvent) GetDatasetIdOk() (*int32, bool) { // HasDatasetId returns a boolean if a field has been set. func (o *DatasetEvent) HasDatasetId() bool { - if o != nil && o.DatasetId != nil { + if o != nil && !IsNil(o.DatasetId) { return true } @@ -104,7 +122,7 @@ func (o *DatasetEvent) SetDatasetId(v int32) { // GetDatasetUri returns the DatasetUri field value if set, zero value otherwise. func (o *DatasetEvent) GetDatasetUri() string { - if o == nil || o.DatasetUri == nil { + if o == nil || IsNil(o.DatasetUri) { var ret string return ret } @@ -114,7 +132,7 @@ func (o *DatasetEvent) GetDatasetUri() string { // GetDatasetUriOk returns a tuple with the DatasetUri field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *DatasetEvent) GetDatasetUriOk() (*string, bool) { - if o == nil || o.DatasetUri == nil { + if o == nil || IsNil(o.DatasetUri) { return nil, false } return o.DatasetUri, true @@ -122,7 +140,7 @@ func (o *DatasetEvent) GetDatasetUriOk() (*string, bool) { // HasDatasetUri returns a boolean if a field has been set. func (o *DatasetEvent) HasDatasetUri() bool { - if o != nil && o.DatasetUri != nil { + if o != nil && !IsNil(o.DatasetUri) { return true } @@ -136,7 +154,7 @@ func (o *DatasetEvent) SetDatasetUri(v string) { // GetExtra returns the Extra field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DatasetEvent) GetExtra() map[string]interface{} { - if o == nil { + if o == nil { var ret map[string]interface{} return ret } @@ -146,16 +164,16 @@ func (o *DatasetEvent) GetExtra() map[string]interface{} { // GetExtraOk returns a tuple with the Extra field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DatasetEvent) GetExtraOk() (*map[string]interface{}, bool) { - if o == nil || o.Extra == nil { - return nil, false +func (o *DatasetEvent) GetExtraOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Extra) { + return map[string]interface{}{}, false } - return &o.Extra, true + return o.Extra, true } // HasExtra returns a boolean if a field has been set. func (o *DatasetEvent) HasExtra() bool { - if o != nil && o.Extra != nil { + if o != nil && !IsNil(o.Extra) { return true } @@ -169,7 +187,7 @@ func (o *DatasetEvent) SetExtra(v map[string]interface{}) { // GetSourceDagId returns the SourceDagId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DatasetEvent) GetSourceDagId() string { - if o == nil || o.SourceDagId.Get() == nil { + if o == nil || IsNil(o.SourceDagId.Get()) { var ret string return ret } @@ -180,7 +198,7 @@ func (o *DatasetEvent) GetSourceDagId() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DatasetEvent) GetSourceDagIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.SourceDagId.Get(), o.SourceDagId.IsSet() @@ -209,51 +227,51 @@ func (o *DatasetEvent) UnsetSourceDagId() { o.SourceDagId.Unset() } -// GetSourceTaskId returns the SourceTaskId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DatasetEvent) GetSourceTaskId() string { - if o == nil || o.SourceTaskId.Get() == nil { - var ret string +// GetSourceMapIndex returns the SourceMapIndex field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DatasetEvent) GetSourceMapIndex() int32 { + if o == nil || IsNil(o.SourceMapIndex.Get()) { + var ret int32 return ret } - return *o.SourceTaskId.Get() + return *o.SourceMapIndex.Get() } -// GetSourceTaskIdOk returns a tuple with the SourceTaskId field value if set, nil otherwise +// GetSourceMapIndexOk returns a tuple with the SourceMapIndex field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DatasetEvent) GetSourceTaskIdOk() (*string, bool) { - if o == nil { +func (o *DatasetEvent) GetSourceMapIndexOk() (*int32, bool) { + if o == nil { return nil, false } - return o.SourceTaskId.Get(), o.SourceTaskId.IsSet() + return o.SourceMapIndex.Get(), o.SourceMapIndex.IsSet() } -// HasSourceTaskId returns a boolean if a field has been set. -func (o *DatasetEvent) HasSourceTaskId() bool { - if o != nil && o.SourceTaskId.IsSet() { +// HasSourceMapIndex returns a boolean if a field has been set. +func (o *DatasetEvent) HasSourceMapIndex() bool { + if o != nil && o.SourceMapIndex.IsSet() { return true } return false } -// SetSourceTaskId gets a reference to the given NullableString and assigns it to the SourceTaskId field. -func (o *DatasetEvent) SetSourceTaskId(v string) { - o.SourceTaskId.Set(&v) +// SetSourceMapIndex gets a reference to the given NullableInt32 and assigns it to the SourceMapIndex field. +func (o *DatasetEvent) SetSourceMapIndex(v int32) { + o.SourceMapIndex.Set(&v) } -// SetSourceTaskIdNil sets the value for SourceTaskId to be an explicit nil -func (o *DatasetEvent) SetSourceTaskIdNil() { - o.SourceTaskId.Set(nil) +// SetSourceMapIndexNil sets the value for SourceMapIndex to be an explicit nil +func (o *DatasetEvent) SetSourceMapIndexNil() { + o.SourceMapIndex.Set(nil) } -// UnsetSourceTaskId ensures that no value is present for SourceTaskId, not even an explicit nil -func (o *DatasetEvent) UnsetSourceTaskId() { - o.SourceTaskId.Unset() +// UnsetSourceMapIndex ensures that no value is present for SourceMapIndex, not even an explicit nil +func (o *DatasetEvent) UnsetSourceMapIndex() { + o.SourceMapIndex.Unset() } // GetSourceRunId returns the SourceRunId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *DatasetEvent) GetSourceRunId() string { - if o == nil || o.SourceRunId.Get() == nil { + if o == nil || IsNil(o.SourceRunId.Get()) { var ret string return ret } @@ -264,7 +282,7 @@ func (o *DatasetEvent) GetSourceRunId() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *DatasetEvent) GetSourceRunIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.SourceRunId.Get(), o.SourceRunId.IsSet() @@ -293,83 +311,51 @@ func (o *DatasetEvent) UnsetSourceRunId() { o.SourceRunId.Unset() } -// GetSourceMapIndex returns the SourceMapIndex field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *DatasetEvent) GetSourceMapIndex() int32 { - if o == nil || o.SourceMapIndex.Get() == nil { - var ret int32 +// GetSourceTaskId returns the SourceTaskId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DatasetEvent) GetSourceTaskId() string { + if o == nil || IsNil(o.SourceTaskId.Get()) { + var ret string return ret } - return *o.SourceMapIndex.Get() + return *o.SourceTaskId.Get() } -// GetSourceMapIndexOk returns a tuple with the SourceMapIndex field value if set, nil otherwise +// GetSourceTaskIdOk returns a tuple with the SourceTaskId field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *DatasetEvent) GetSourceMapIndexOk() (*int32, bool) { - if o == nil { +func (o *DatasetEvent) GetSourceTaskIdOk() (*string, bool) { + if o == nil { return nil, false } - return o.SourceMapIndex.Get(), o.SourceMapIndex.IsSet() + return o.SourceTaskId.Get(), o.SourceTaskId.IsSet() } -// HasSourceMapIndex returns a boolean if a field has been set. -func (o *DatasetEvent) HasSourceMapIndex() bool { - if o != nil && o.SourceMapIndex.IsSet() { +// HasSourceTaskId returns a boolean if a field has been set. +func (o *DatasetEvent) HasSourceTaskId() bool { + if o != nil && o.SourceTaskId.IsSet() { return true } return false } -// SetSourceMapIndex gets a reference to the given NullableInt32 and assigns it to the SourceMapIndex field. -func (o *DatasetEvent) SetSourceMapIndex(v int32) { - o.SourceMapIndex.Set(&v) -} -// SetSourceMapIndexNil sets the value for SourceMapIndex to be an explicit nil -func (o *DatasetEvent) SetSourceMapIndexNil() { - o.SourceMapIndex.Set(nil) -} - -// UnsetSourceMapIndex ensures that no value is present for SourceMapIndex, not even an explicit nil -func (o *DatasetEvent) UnsetSourceMapIndex() { - o.SourceMapIndex.Unset() -} - -// GetCreatedDagruns returns the CreatedDagruns field value if set, zero value otherwise. -func (o *DatasetEvent) GetCreatedDagruns() []BasicDAGRun { - if o == nil || o.CreatedDagruns == nil { - var ret []BasicDAGRun - return ret - } - return *o.CreatedDagruns -} - -// GetCreatedDagrunsOk returns a tuple with the CreatedDagruns field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *DatasetEvent) GetCreatedDagrunsOk() (*[]BasicDAGRun, bool) { - if o == nil || o.CreatedDagruns == nil { - return nil, false - } - return o.CreatedDagruns, true +// SetSourceTaskId gets a reference to the given NullableString and assigns it to the SourceTaskId field. +func (o *DatasetEvent) SetSourceTaskId(v string) { + o.SourceTaskId.Set(&v) } - -// HasCreatedDagruns returns a boolean if a field has been set. -func (o *DatasetEvent) HasCreatedDagruns() bool { - if o != nil && o.CreatedDagruns != nil { - return true - } - - return false +// SetSourceTaskIdNil sets the value for SourceTaskId to be an explicit nil +func (o *DatasetEvent) SetSourceTaskIdNil() { + o.SourceTaskId.Set(nil) } -// SetCreatedDagruns gets a reference to the given []BasicDAGRun and assigns it to the CreatedDagruns field. -func (o *DatasetEvent) SetCreatedDagruns(v []BasicDAGRun) { - o.CreatedDagruns = &v +// UnsetSourceTaskId ensures that no value is present for SourceTaskId, not even an explicit nil +func (o *DatasetEvent) UnsetSourceTaskId() { + o.SourceTaskId.Unset() } // GetTimestamp returns the Timestamp field value if set, zero value otherwise. func (o *DatasetEvent) GetTimestamp() string { - if o == nil || o.Timestamp == nil { + if o == nil || IsNil(o.Timestamp) { var ret string return ret } @@ -379,7 +365,7 @@ func (o *DatasetEvent) GetTimestamp() string { // GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *DatasetEvent) GetTimestampOk() (*string, bool) { - if o == nil || o.Timestamp == nil { + if o == nil || IsNil(o.Timestamp) { return nil, false } return o.Timestamp, true @@ -387,7 +373,7 @@ func (o *DatasetEvent) GetTimestampOk() (*string, bool) { // HasTimestamp returns a boolean if a field has been set. func (o *DatasetEvent) HasTimestamp() bool { - if o != nil && o.Timestamp != nil { + if o != nil && !IsNil(o.Timestamp) { return true } @@ -400,11 +386,22 @@ func (o *DatasetEvent) SetTimestamp(v string) { } func (o DatasetEvent) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DatasetEvent) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.DatasetId != nil { + if !IsNil(o.CreatedDagruns) { + toSerialize["created_dagruns"] = o.CreatedDagruns + } + if !IsNil(o.DatasetId) { toSerialize["dataset_id"] = o.DatasetId } - if o.DatasetUri != nil { + if !IsNil(o.DatasetUri) { toSerialize["dataset_uri"] = o.DatasetUri } if o.Extra != nil { @@ -413,22 +410,19 @@ func (o DatasetEvent) MarshalJSON() ([]byte, error) { if o.SourceDagId.IsSet() { toSerialize["source_dag_id"] = o.SourceDagId.Get() } - if o.SourceTaskId.IsSet() { - toSerialize["source_task_id"] = o.SourceTaskId.Get() + if o.SourceMapIndex.IsSet() { + toSerialize["source_map_index"] = o.SourceMapIndex.Get() } if o.SourceRunId.IsSet() { toSerialize["source_run_id"] = o.SourceRunId.Get() } - if o.SourceMapIndex.IsSet() { - toSerialize["source_map_index"] = o.SourceMapIndex.Get() - } - if o.CreatedDagruns != nil { - toSerialize["created_dagruns"] = o.CreatedDagruns + if o.SourceTaskId.IsSet() { + toSerialize["source_task_id"] = o.SourceTaskId.Get() } - if o.Timestamp != nil { + if !IsNil(o.Timestamp) { toSerialize["timestamp"] = o.Timestamp } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableDatasetEvent struct { diff --git a/airflow/model_dataset_event_collection.go b/airflow/model_dataset_event_collection.go index 7e393af..591cf23 100644 --- a/airflow/model_dataset_event_collection.go +++ b/airflow/model_dataset_event_collection.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,11 +15,14 @@ import ( "encoding/json" ) +// checks if the DatasetEventCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DatasetEventCollection{} + // DatasetEventCollection A collection of dataset events. *New in version 2.4.0* type DatasetEventCollection struct { - DatasetEvents *[]DatasetEvent `json:"dataset_events,omitempty"` - // Count of objects in the current result set. + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. TotalEntries *int32 `json:"total_entries,omitempty"` + DatasetEvents []DatasetEvent `json:"dataset_events,omitempty"` } // NewDatasetEventCollection instantiates a new DatasetEventCollection object @@ -56,79 +42,87 @@ func NewDatasetEventCollectionWithDefaults() *DatasetEventCollection { return &this } -// GetDatasetEvents returns the DatasetEvents field value if set, zero value otherwise. -func (o *DatasetEventCollection) GetDatasetEvents() []DatasetEvent { - if o == nil || o.DatasetEvents == nil { - var ret []DatasetEvent +// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. +func (o *DatasetEventCollection) GetTotalEntries() int32 { + if o == nil || IsNil(o.TotalEntries) { + var ret int32 return ret } - return *o.DatasetEvents + return *o.TotalEntries } -// GetDatasetEventsOk returns a tuple with the DatasetEvents field value if set, nil otherwise +// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DatasetEventCollection) GetDatasetEventsOk() (*[]DatasetEvent, bool) { - if o == nil || o.DatasetEvents == nil { +func (o *DatasetEventCollection) GetTotalEntriesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalEntries) { return nil, false } - return o.DatasetEvents, true + return o.TotalEntries, true } -// HasDatasetEvents returns a boolean if a field has been set. -func (o *DatasetEventCollection) HasDatasetEvents() bool { - if o != nil && o.DatasetEvents != nil { +// HasTotalEntries returns a boolean if a field has been set. +func (o *DatasetEventCollection) HasTotalEntries() bool { + if o != nil && !IsNil(o.TotalEntries) { return true } return false } -// SetDatasetEvents gets a reference to the given []DatasetEvent and assigns it to the DatasetEvents field. -func (o *DatasetEventCollection) SetDatasetEvents(v []DatasetEvent) { - o.DatasetEvents = &v +// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. +func (o *DatasetEventCollection) SetTotalEntries(v int32) { + o.TotalEntries = &v } -// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. -func (o *DatasetEventCollection) GetTotalEntries() int32 { - if o == nil || o.TotalEntries == nil { - var ret int32 +// GetDatasetEvents returns the DatasetEvents field value if set, zero value otherwise. +func (o *DatasetEventCollection) GetDatasetEvents() []DatasetEvent { + if o == nil || IsNil(o.DatasetEvents) { + var ret []DatasetEvent return ret } - return *o.TotalEntries + return o.DatasetEvents } -// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise +// GetDatasetEventsOk returns a tuple with the DatasetEvents field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *DatasetEventCollection) GetTotalEntriesOk() (*int32, bool) { - if o == nil || o.TotalEntries == nil { +func (o *DatasetEventCollection) GetDatasetEventsOk() ([]DatasetEvent, bool) { + if o == nil || IsNil(o.DatasetEvents) { return nil, false } - return o.TotalEntries, true + return o.DatasetEvents, true } -// HasTotalEntries returns a boolean if a field has been set. -func (o *DatasetEventCollection) HasTotalEntries() bool { - if o != nil && o.TotalEntries != nil { +// HasDatasetEvents returns a boolean if a field has been set. +func (o *DatasetEventCollection) HasDatasetEvents() bool { + if o != nil && !IsNil(o.DatasetEvents) { return true } return false } -// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. -func (o *DatasetEventCollection) SetTotalEntries(v int32) { - o.TotalEntries = &v +// SetDatasetEvents gets a reference to the given []DatasetEvent and assigns it to the DatasetEvents field. +func (o *DatasetEventCollection) SetDatasetEvents(v []DatasetEvent) { + o.DatasetEvents = v } func (o DatasetEventCollection) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.DatasetEvents != nil { - toSerialize["dataset_events"] = o.DatasetEvents + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.TotalEntries != nil { + return json.Marshal(toSerialize) +} + +func (o DatasetEventCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalEntries) { toSerialize["total_entries"] = o.TotalEntries } - return json.Marshal(toSerialize) + if !IsNil(o.DatasetEvents) { + toSerialize["dataset_events"] = o.DatasetEvents + } + return toSerialize, nil } type NullableDatasetEventCollection struct { diff --git a/airflow/model_error.go b/airflow/model_error.go index 7e4b7b9..604afdd 100644 --- a/airflow/model_error.go +++ b/airflow/model_error.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -30,31 +13,38 @@ package airflow import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the Error type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Error{} + // Error [RFC7807](https://tools.ietf.org/html/rfc7807) compliant response. type Error struct { - // A URI reference [RFC3986] that identifies the problem type. This specification encourages that, when dereferenced, it provide human-readable documentation for the problem type. - Type string `json:"type"` - // A short, human-readable summary of the problem type. - Title string `json:"title"` - // The HTTP status code generated by the API server for this occurrence of the problem. - Status float32 `json:"status"` // A human-readable explanation specific to this occurrence of the problem. Detail *string `json:"detail,omitempty"` // A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. Instance *string `json:"instance,omitempty"` + // The HTTP status code generated by the API server for this occurrence of the problem. + Status float32 `json:"status"` + // A short, human-readable summary of the problem type. + Title string `json:"title"` + // A URI reference [RFC3986] that identifies the problem type. This specification encourages that, when dereferenced, it provide human-readable documentation for the problem type. + Type string `json:"type"` } +type _Error Error + // NewError instantiates a new Error object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewError(type_ string, title string, status float32) *Error { +func NewError(status float32, title string, type_ string) *Error { this := Error{} - this.Type = type_ - this.Title = title this.Status = status + this.Title = title + this.Type = type_ return &this } @@ -66,52 +56,68 @@ func NewErrorWithDefaults() *Error { return &this } -// GetType returns the Type field value -func (o *Error) GetType() string { - if o == nil { +// GetDetail returns the Detail field value if set, zero value otherwise. +func (o *Error) GetDetail() string { + if o == nil || IsNil(o.Detail) { var ret string return ret } - - return o.Type + return *o.Detail } -// GetTypeOk returns a tuple with the Type field value +// GetDetailOk returns a tuple with the Detail field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Error) GetTypeOk() (*string, bool) { - if o == nil { +func (o *Error) GetDetailOk() (*string, bool) { + if o == nil || IsNil(o.Detail) { return nil, false } - return &o.Type, true + return o.Detail, true } -// SetType sets field value -func (o *Error) SetType(v string) { - o.Type = v +// HasDetail returns a boolean if a field has been set. +func (o *Error) HasDetail() bool { + if o != nil && !IsNil(o.Detail) { + return true + } + + return false } -// GetTitle returns the Title field value -func (o *Error) GetTitle() string { - if o == nil { +// SetDetail gets a reference to the given string and assigns it to the Detail field. +func (o *Error) SetDetail(v string) { + o.Detail = &v +} + +// GetInstance returns the Instance field value if set, zero value otherwise. +func (o *Error) GetInstance() string { + if o == nil || IsNil(o.Instance) { var ret string return ret } - - return o.Title + return *o.Instance } -// GetTitleOk returns a tuple with the Title field value +// GetInstanceOk returns a tuple with the Instance field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Error) GetTitleOk() (*string, bool) { - if o == nil { +func (o *Error) GetInstanceOk() (*string, bool) { + if o == nil || IsNil(o.Instance) { return nil, false } - return &o.Title, true + return o.Instance, true } -// SetTitle sets field value -func (o *Error) SetTitle(v string) { - o.Title = v +// HasInstance returns a boolean if a field has been set. +func (o *Error) HasInstance() bool { + if o != nil && !IsNil(o.Instance) { + return true + } + + return false +} + +// SetInstance gets a reference to the given string and assigns it to the Instance field. +func (o *Error) SetInstance(v string) { + o.Instance = &v } // GetStatus returns the Status field value @@ -127,7 +133,7 @@ func (o *Error) GetStatus() float32 { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. func (o *Error) GetStatusOk() (*float32, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Status, true @@ -138,88 +144,113 @@ func (o *Error) SetStatus(v float32) { o.Status = v } -// GetDetail returns the Detail field value if set, zero value otherwise. -func (o *Error) GetDetail() string { - if o == nil || o.Detail == nil { +// GetTitle returns the Title field value +func (o *Error) GetTitle() string { + if o == nil { var ret string return ret } - return *o.Detail + + return o.Title } -// GetDetailOk returns a tuple with the Detail field value if set, nil otherwise +// GetTitleOk returns a tuple with the Title field value // and a boolean to check if the value has been set. -func (o *Error) GetDetailOk() (*string, bool) { - if o == nil || o.Detail == nil { +func (o *Error) GetTitleOk() (*string, bool) { + if o == nil { return nil, false } - return o.Detail, true -} - -// HasDetail returns a boolean if a field has been set. -func (o *Error) HasDetail() bool { - if o != nil && o.Detail != nil { - return true - } - - return false + return &o.Title, true } -// SetDetail gets a reference to the given string and assigns it to the Detail field. -func (o *Error) SetDetail(v string) { - o.Detail = &v +// SetTitle sets field value +func (o *Error) SetTitle(v string) { + o.Title = v } -// GetInstance returns the Instance field value if set, zero value otherwise. -func (o *Error) GetInstance() string { - if o == nil || o.Instance == nil { +// GetType returns the Type field value +func (o *Error) GetType() string { + if o == nil { var ret string return ret } - return *o.Instance + + return o.Type } -// GetInstanceOk returns a tuple with the Instance field value if set, nil otherwise +// GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. -func (o *Error) GetInstanceOk() (*string, bool) { - if o == nil || o.Instance == nil { +func (o *Error) GetTypeOk() (*string, bool) { + if o == nil { return nil, false } - return o.Instance, true + return &o.Type, true } -// HasInstance returns a boolean if a field has been set. -func (o *Error) HasInstance() bool { - if o != nil && o.Instance != nil { - return true - } - - return false +// SetType sets field value +func (o *Error) SetType(v string) { + o.Type = v } -// SetInstance gets a reference to the given string and assigns it to the Instance field. -func (o *Error) SetInstance(v string) { - o.Instance = &v +func (o Error) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) } -func (o Error) MarshalJSON() ([]byte, error) { +func (o Error) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["type"] = o.Type + if !IsNil(o.Detail) { + toSerialize["detail"] = o.Detail } - if true { - toSerialize["title"] = o.Title + if !IsNil(o.Instance) { + toSerialize["instance"] = o.Instance } - if true { - toSerialize["status"] = o.Status + toSerialize["status"] = o.Status + toSerialize["title"] = o.Title + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *Error) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "status", + "title", + "type", } - if o.Detail != nil { - toSerialize["detail"] = o.Detail + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if o.Instance != nil { - toSerialize["instance"] = o.Instance + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - return json.Marshal(toSerialize) + + varError := _Error{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varError) + + if err != nil { + return err + } + + *o = Error(varError) + + return err } type NullableError struct { diff --git a/airflow/model_event_log.go b/airflow/model_event_log.go index 9205043..11b4e43 100644 --- a/airflow/model_event_log.go +++ b/airflow/model_event_log.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -33,24 +16,33 @@ import ( "time" ) +// checks if the EventLog type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EventLog{} + // EventLog Log of user operations via CLI or Web UI. type EventLog struct { - // The event log ID - EventLogId *int32 `json:"event_log_id,omitempty"` - // The time when these events happened. - When *time.Time `json:"when,omitempty"` // The DAG ID DagId NullableString `json:"dag_id,omitempty"` - // The DAG ID - TaskId NullableString `json:"task_id,omitempty"` // A key describing the type of event. Event *string `json:"event,omitempty"` + // The event log ID + EventLogId *int32 `json:"event_log_id,omitempty"` // When the event was dispatched for an object having execution_date, the value of this field. ExecutionDate NullableTime `json:"execution_date,omitempty"` - // Name of the user who triggered these events a. - Owner *string `json:"owner,omitempty"` // Other information that was not included in the other fields, e.g. the complete CLI command. Extra NullableString `json:"extra,omitempty"` + // The Map Index + MapIndex NullableInt32 `json:"map_index,omitempty"` + // Name of the user who triggered these events a. + Owner NullableString `json:"owner,omitempty"` + // The DAG Run ID + RunId NullableString `json:"run_id,omitempty"` + // The Task ID + TaskId NullableString `json:"task_id,omitempty"` + // The Try Number + TryNumber NullableInt32 `json:"try_number,omitempty"` + // The time when these events happened. + When *time.Time `json:"when,omitempty"` } // NewEventLog instantiates a new EventLog object @@ -70,9 +62,83 @@ func NewEventLogWithDefaults() *EventLog { return &this } +// GetDagId returns the DagId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventLog) GetDagId() string { + if o == nil || IsNil(o.DagId.Get()) { + var ret string + return ret + } + return *o.DagId.Get() +} + +// GetDagIdOk returns a tuple with the DagId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EventLog) GetDagIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DagId.Get(), o.DagId.IsSet() +} + +// HasDagId returns a boolean if a field has been set. +func (o *EventLog) HasDagId() bool { + if o != nil && o.DagId.IsSet() { + return true + } + + return false +} + +// SetDagId gets a reference to the given NullableString and assigns it to the DagId field. +func (o *EventLog) SetDagId(v string) { + o.DagId.Set(&v) +} +// SetDagIdNil sets the value for DagId to be an explicit nil +func (o *EventLog) SetDagIdNil() { + o.DagId.Set(nil) +} + +// UnsetDagId ensures that no value is present for DagId, not even an explicit nil +func (o *EventLog) UnsetDagId() { + o.DagId.Unset() +} + +// GetEvent returns the Event field value if set, zero value otherwise. +func (o *EventLog) GetEvent() string { + if o == nil || IsNil(o.Event) { + var ret string + return ret + } + return *o.Event +} + +// GetEventOk returns a tuple with the Event field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventLog) GetEventOk() (*string, bool) { + if o == nil || IsNil(o.Event) { + return nil, false + } + return o.Event, true +} + +// HasEvent returns a boolean if a field has been set. +func (o *EventLog) HasEvent() bool { + if o != nil && !IsNil(o.Event) { + return true + } + + return false +} + +// SetEvent gets a reference to the given string and assigns it to the Event field. +func (o *EventLog) SetEvent(v string) { + o.Event = &v +} + // GetEventLogId returns the EventLogId field value if set, zero value otherwise. func (o *EventLog) GetEventLogId() int32 { - if o == nil || o.EventLogId == nil { + if o == nil || IsNil(o.EventLogId) { var ret int32 return ret } @@ -82,7 +148,7 @@ func (o *EventLog) GetEventLogId() int32 { // GetEventLogIdOk returns a tuple with the EventLogId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *EventLog) GetEventLogIdOk() (*int32, bool) { - if o == nil || o.EventLogId == nil { + if o == nil || IsNil(o.EventLogId) { return nil, false } return o.EventLogId, true @@ -90,7 +156,7 @@ func (o *EventLog) GetEventLogIdOk() (*int32, bool) { // HasEventLogId returns a boolean if a field has been set. func (o *EventLog) HasEventLogId() bool { - if o != nil && o.EventLogId != nil { + if o != nil && !IsNil(o.EventLogId) { return true } @@ -102,297 +168,376 @@ func (o *EventLog) SetEventLogId(v int32) { o.EventLogId = &v } -// GetWhen returns the When field value if set, zero value otherwise. -func (o *EventLog) GetWhen() time.Time { - if o == nil || o.When == nil { +// GetExecutionDate returns the ExecutionDate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventLog) GetExecutionDate() time.Time { + if o == nil || IsNil(o.ExecutionDate.Get()) { var ret time.Time return ret } - return *o.When + return *o.ExecutionDate.Get() } -// GetWhenOk returns a tuple with the When field value if set, nil otherwise +// GetExecutionDateOk returns a tuple with the ExecutionDate field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *EventLog) GetWhenOk() (*time.Time, bool) { - if o == nil || o.When == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EventLog) GetExecutionDateOk() (*time.Time, bool) { + if o == nil { return nil, false } - return o.When, true + return o.ExecutionDate.Get(), o.ExecutionDate.IsSet() } -// HasWhen returns a boolean if a field has been set. -func (o *EventLog) HasWhen() bool { - if o != nil && o.When != nil { +// HasExecutionDate returns a boolean if a field has been set. +func (o *EventLog) HasExecutionDate() bool { + if o != nil && o.ExecutionDate.IsSet() { return true } return false } -// SetWhen gets a reference to the given time.Time and assigns it to the When field. -func (o *EventLog) SetWhen(v time.Time) { - o.When = &v +// SetExecutionDate gets a reference to the given NullableTime and assigns it to the ExecutionDate field. +func (o *EventLog) SetExecutionDate(v time.Time) { + o.ExecutionDate.Set(&v) +} +// SetExecutionDateNil sets the value for ExecutionDate to be an explicit nil +func (o *EventLog) SetExecutionDateNil() { + o.ExecutionDate.Set(nil) } -// GetDagId returns the DagId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *EventLog) GetDagId() string { - if o == nil || o.DagId.Get() == nil { +// UnsetExecutionDate ensures that no value is present for ExecutionDate, not even an explicit nil +func (o *EventLog) UnsetExecutionDate() { + o.ExecutionDate.Unset() +} + +// GetExtra returns the Extra field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventLog) GetExtra() string { + if o == nil || IsNil(o.Extra.Get()) { var ret string return ret } - return *o.DagId.Get() + return *o.Extra.Get() } -// GetDagIdOk returns a tuple with the DagId field value if set, nil otherwise +// GetExtraOk returns a tuple with the Extra field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *EventLog) GetDagIdOk() (*string, bool) { - if o == nil { +func (o *EventLog) GetExtraOk() (*string, bool) { + if o == nil { return nil, false } - return o.DagId.Get(), o.DagId.IsSet() + return o.Extra.Get(), o.Extra.IsSet() } -// HasDagId returns a boolean if a field has been set. -func (o *EventLog) HasDagId() bool { - if o != nil && o.DagId.IsSet() { +// HasExtra returns a boolean if a field has been set. +func (o *EventLog) HasExtra() bool { + if o != nil && o.Extra.IsSet() { return true } return false } -// SetDagId gets a reference to the given NullableString and assigns it to the DagId field. -func (o *EventLog) SetDagId(v string) { - o.DagId.Set(&v) +// SetExtra gets a reference to the given NullableString and assigns it to the Extra field. +func (o *EventLog) SetExtra(v string) { + o.Extra.Set(&v) } -// SetDagIdNil sets the value for DagId to be an explicit nil -func (o *EventLog) SetDagIdNil() { - o.DagId.Set(nil) +// SetExtraNil sets the value for Extra to be an explicit nil +func (o *EventLog) SetExtraNil() { + o.Extra.Set(nil) } -// UnsetDagId ensures that no value is present for DagId, not even an explicit nil -func (o *EventLog) UnsetDagId() { - o.DagId.Unset() +// UnsetExtra ensures that no value is present for Extra, not even an explicit nil +func (o *EventLog) UnsetExtra() { + o.Extra.Unset() } -// GetTaskId returns the TaskId field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *EventLog) GetTaskId() string { - if o == nil || o.TaskId.Get() == nil { - var ret string +// GetMapIndex returns the MapIndex field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventLog) GetMapIndex() int32 { + if o == nil || IsNil(o.MapIndex.Get()) { + var ret int32 return ret } - return *o.TaskId.Get() + return *o.MapIndex.Get() } -// GetTaskIdOk returns a tuple with the TaskId field value if set, nil otherwise +// GetMapIndexOk returns a tuple with the MapIndex field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *EventLog) GetTaskIdOk() (*string, bool) { - if o == nil { +func (o *EventLog) GetMapIndexOk() (*int32, bool) { + if o == nil { return nil, false } - return o.TaskId.Get(), o.TaskId.IsSet() + return o.MapIndex.Get(), o.MapIndex.IsSet() } -// HasTaskId returns a boolean if a field has been set. -func (o *EventLog) HasTaskId() bool { - if o != nil && o.TaskId.IsSet() { +// HasMapIndex returns a boolean if a field has been set. +func (o *EventLog) HasMapIndex() bool { + if o != nil && o.MapIndex.IsSet() { return true } return false } -// SetTaskId gets a reference to the given NullableString and assigns it to the TaskId field. -func (o *EventLog) SetTaskId(v string) { - o.TaskId.Set(&v) +// SetMapIndex gets a reference to the given NullableInt32 and assigns it to the MapIndex field. +func (o *EventLog) SetMapIndex(v int32) { + o.MapIndex.Set(&v) } -// SetTaskIdNil sets the value for TaskId to be an explicit nil -func (o *EventLog) SetTaskIdNil() { - o.TaskId.Set(nil) +// SetMapIndexNil sets the value for MapIndex to be an explicit nil +func (o *EventLog) SetMapIndexNil() { + o.MapIndex.Set(nil) } -// UnsetTaskId ensures that no value is present for TaskId, not even an explicit nil -func (o *EventLog) UnsetTaskId() { - o.TaskId.Unset() +// UnsetMapIndex ensures that no value is present for MapIndex, not even an explicit nil +func (o *EventLog) UnsetMapIndex() { + o.MapIndex.Unset() } -// GetEvent returns the Event field value if set, zero value otherwise. -func (o *EventLog) GetEvent() string { - if o == nil || o.Event == nil { +// GetOwner returns the Owner field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventLog) GetOwner() string { + if o == nil || IsNil(o.Owner.Get()) { var ret string return ret } - return *o.Event + return *o.Owner.Get() } -// GetEventOk returns a tuple with the Event field value if set, nil otherwise +// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *EventLog) GetEventOk() (*string, bool) { - if o == nil || o.Event == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EventLog) GetOwnerOk() (*string, bool) { + if o == nil { return nil, false } - return o.Event, true + return o.Owner.Get(), o.Owner.IsSet() } -// HasEvent returns a boolean if a field has been set. -func (o *EventLog) HasEvent() bool { - if o != nil && o.Event != nil { +// HasOwner returns a boolean if a field has been set. +func (o *EventLog) HasOwner() bool { + if o != nil && o.Owner.IsSet() { return true } return false } -// SetEvent gets a reference to the given string and assigns it to the Event field. -func (o *EventLog) SetEvent(v string) { - o.Event = &v +// SetOwner gets a reference to the given NullableString and assigns it to the Owner field. +func (o *EventLog) SetOwner(v string) { + o.Owner.Set(&v) +} +// SetOwnerNil sets the value for Owner to be an explicit nil +func (o *EventLog) SetOwnerNil() { + o.Owner.Set(nil) } -// GetExecutionDate returns the ExecutionDate field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *EventLog) GetExecutionDate() time.Time { - if o == nil || o.ExecutionDate.Get() == nil { - var ret time.Time +// UnsetOwner ensures that no value is present for Owner, not even an explicit nil +func (o *EventLog) UnsetOwner() { + o.Owner.Unset() +} + +// GetRunId returns the RunId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventLog) GetRunId() string { + if o == nil || IsNil(o.RunId.Get()) { + var ret string return ret } - return *o.ExecutionDate.Get() + return *o.RunId.Get() } -// GetExecutionDateOk returns a tuple with the ExecutionDate field value if set, nil otherwise +// GetRunIdOk returns a tuple with the RunId field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *EventLog) GetExecutionDateOk() (*time.Time, bool) { - if o == nil { +func (o *EventLog) GetRunIdOk() (*string, bool) { + if o == nil { return nil, false } - return o.ExecutionDate.Get(), o.ExecutionDate.IsSet() + return o.RunId.Get(), o.RunId.IsSet() } -// HasExecutionDate returns a boolean if a field has been set. -func (o *EventLog) HasExecutionDate() bool { - if o != nil && o.ExecutionDate.IsSet() { +// HasRunId returns a boolean if a field has been set. +func (o *EventLog) HasRunId() bool { + if o != nil && o.RunId.IsSet() { return true } return false } -// SetExecutionDate gets a reference to the given NullableTime and assigns it to the ExecutionDate field. -func (o *EventLog) SetExecutionDate(v time.Time) { - o.ExecutionDate.Set(&v) +// SetRunId gets a reference to the given NullableString and assigns it to the RunId field. +func (o *EventLog) SetRunId(v string) { + o.RunId.Set(&v) } -// SetExecutionDateNil sets the value for ExecutionDate to be an explicit nil -func (o *EventLog) SetExecutionDateNil() { - o.ExecutionDate.Set(nil) +// SetRunIdNil sets the value for RunId to be an explicit nil +func (o *EventLog) SetRunIdNil() { + o.RunId.Set(nil) } -// UnsetExecutionDate ensures that no value is present for ExecutionDate, not even an explicit nil -func (o *EventLog) UnsetExecutionDate() { - o.ExecutionDate.Unset() +// UnsetRunId ensures that no value is present for RunId, not even an explicit nil +func (o *EventLog) UnsetRunId() { + o.RunId.Unset() } -// GetOwner returns the Owner field value if set, zero value otherwise. -func (o *EventLog) GetOwner() string { - if o == nil || o.Owner == nil { +// GetTaskId returns the TaskId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventLog) GetTaskId() string { + if o == nil || IsNil(o.TaskId.Get()) { var ret string return ret } - return *o.Owner + return *o.TaskId.Get() } -// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise +// GetTaskIdOk returns a tuple with the TaskId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *EventLog) GetOwnerOk() (*string, bool) { - if o == nil || o.Owner == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EventLog) GetTaskIdOk() (*string, bool) { + if o == nil { return nil, false } - return o.Owner, true + return o.TaskId.Get(), o.TaskId.IsSet() } -// HasOwner returns a boolean if a field has been set. -func (o *EventLog) HasOwner() bool { - if o != nil && o.Owner != nil { +// HasTaskId returns a boolean if a field has been set. +func (o *EventLog) HasTaskId() bool { + if o != nil && o.TaskId.IsSet() { return true } return false } -// SetOwner gets a reference to the given string and assigns it to the Owner field. -func (o *EventLog) SetOwner(v string) { - o.Owner = &v +// SetTaskId gets a reference to the given NullableString and assigns it to the TaskId field. +func (o *EventLog) SetTaskId(v string) { + o.TaskId.Set(&v) +} +// SetTaskIdNil sets the value for TaskId to be an explicit nil +func (o *EventLog) SetTaskIdNil() { + o.TaskId.Set(nil) } -// GetExtra returns the Extra field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *EventLog) GetExtra() string { - if o == nil || o.Extra.Get() == nil { - var ret string +// UnsetTaskId ensures that no value is present for TaskId, not even an explicit nil +func (o *EventLog) UnsetTaskId() { + o.TaskId.Unset() +} + +// GetTryNumber returns the TryNumber field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventLog) GetTryNumber() int32 { + if o == nil || IsNil(o.TryNumber.Get()) { + var ret int32 return ret } - return *o.Extra.Get() + return *o.TryNumber.Get() } -// GetExtraOk returns a tuple with the Extra field value if set, nil otherwise +// GetTryNumberOk returns a tuple with the TryNumber field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *EventLog) GetExtraOk() (*string, bool) { - if o == nil { +func (o *EventLog) GetTryNumberOk() (*int32, bool) { + if o == nil { return nil, false } - return o.Extra.Get(), o.Extra.IsSet() + return o.TryNumber.Get(), o.TryNumber.IsSet() } -// HasExtra returns a boolean if a field has been set. -func (o *EventLog) HasExtra() bool { - if o != nil && o.Extra.IsSet() { +// HasTryNumber returns a boolean if a field has been set. +func (o *EventLog) HasTryNumber() bool { + if o != nil && o.TryNumber.IsSet() { return true } return false } -// SetExtra gets a reference to the given NullableString and assigns it to the Extra field. -func (o *EventLog) SetExtra(v string) { - o.Extra.Set(&v) +// SetTryNumber gets a reference to the given NullableInt32 and assigns it to the TryNumber field. +func (o *EventLog) SetTryNumber(v int32) { + o.TryNumber.Set(&v) } -// SetExtraNil sets the value for Extra to be an explicit nil -func (o *EventLog) SetExtraNil() { - o.Extra.Set(nil) +// SetTryNumberNil sets the value for TryNumber to be an explicit nil +func (o *EventLog) SetTryNumberNil() { + o.TryNumber.Set(nil) } -// UnsetExtra ensures that no value is present for Extra, not even an explicit nil -func (o *EventLog) UnsetExtra() { - o.Extra.Unset() +// UnsetTryNumber ensures that no value is present for TryNumber, not even an explicit nil +func (o *EventLog) UnsetTryNumber() { + o.TryNumber.Unset() } -func (o EventLog) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.EventLogId != nil { - toSerialize["event_log_id"] = o.EventLogId +// GetWhen returns the When field value if set, zero value otherwise. +func (o *EventLog) GetWhen() time.Time { + if o == nil || IsNil(o.When) { + var ret time.Time + return ret } - if o.When != nil { - toSerialize["when"] = o.When + return *o.When +} + +// GetWhenOk returns a tuple with the When field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventLog) GetWhenOk() (*time.Time, bool) { + if o == nil || IsNil(o.When) { + return nil, false + } + return o.When, true +} + +// HasWhen returns a boolean if a field has been set. +func (o *EventLog) HasWhen() bool { + if o != nil && !IsNil(o.When) { + return true + } + + return false +} + +// SetWhen gets a reference to the given time.Time and assigns it to the When field. +func (o *EventLog) SetWhen(v time.Time) { + o.When = &v +} + +func (o EventLog) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o EventLog) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} if o.DagId.IsSet() { toSerialize["dag_id"] = o.DagId.Get() } - if o.TaskId.IsSet() { - toSerialize["task_id"] = o.TaskId.Get() - } - if o.Event != nil { + if !IsNil(o.Event) { toSerialize["event"] = o.Event } + if !IsNil(o.EventLogId) { + toSerialize["event_log_id"] = o.EventLogId + } if o.ExecutionDate.IsSet() { toSerialize["execution_date"] = o.ExecutionDate.Get() } - if o.Owner != nil { - toSerialize["owner"] = o.Owner - } if o.Extra.IsSet() { toSerialize["extra"] = o.Extra.Get() } - return json.Marshal(toSerialize) + if o.MapIndex.IsSet() { + toSerialize["map_index"] = o.MapIndex.Get() + } + if o.Owner.IsSet() { + toSerialize["owner"] = o.Owner.Get() + } + if o.RunId.IsSet() { + toSerialize["run_id"] = o.RunId.Get() + } + if o.TaskId.IsSet() { + toSerialize["task_id"] = o.TaskId.Get() + } + if o.TryNumber.IsSet() { + toSerialize["try_number"] = o.TryNumber.Get() + } + if !IsNil(o.When) { + toSerialize["when"] = o.When + } + return toSerialize, nil } type NullableEventLog struct { diff --git a/airflow/model_event_log_collection.go b/airflow/model_event_log_collection.go index 6235a44..0b91ed4 100644 --- a/airflow/model_event_log_collection.go +++ b/airflow/model_event_log_collection.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,11 +15,14 @@ import ( "encoding/json" ) -// EventLogCollection Collection of event logs. *Changed in version 2.1.0*: 'total_entries' field is added. +// checks if the EventLogCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EventLogCollection{} + +// EventLogCollection Collection of event logs. *Changed in version 2.1.0*: 'total_entries' field is added. *Changed in version 2.10.0*: 'try_number' and 'map_index' fields are added. type EventLogCollection struct { - EventLogs *[]EventLog `json:"event_logs,omitempty"` - // Count of objects in the current result set. + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. TotalEntries *int32 `json:"total_entries,omitempty"` + EventLogs []EventLog `json:"event_logs,omitempty"` } // NewEventLogCollection instantiates a new EventLogCollection object @@ -56,79 +42,87 @@ func NewEventLogCollectionWithDefaults() *EventLogCollection { return &this } -// GetEventLogs returns the EventLogs field value if set, zero value otherwise. -func (o *EventLogCollection) GetEventLogs() []EventLog { - if o == nil || o.EventLogs == nil { - var ret []EventLog +// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. +func (o *EventLogCollection) GetTotalEntries() int32 { + if o == nil || IsNil(o.TotalEntries) { + var ret int32 return ret } - return *o.EventLogs + return *o.TotalEntries } -// GetEventLogsOk returns a tuple with the EventLogs field value if set, nil otherwise +// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *EventLogCollection) GetEventLogsOk() (*[]EventLog, bool) { - if o == nil || o.EventLogs == nil { +func (o *EventLogCollection) GetTotalEntriesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalEntries) { return nil, false } - return o.EventLogs, true + return o.TotalEntries, true } -// HasEventLogs returns a boolean if a field has been set. -func (o *EventLogCollection) HasEventLogs() bool { - if o != nil && o.EventLogs != nil { +// HasTotalEntries returns a boolean if a field has been set. +func (o *EventLogCollection) HasTotalEntries() bool { + if o != nil && !IsNil(o.TotalEntries) { return true } return false } -// SetEventLogs gets a reference to the given []EventLog and assigns it to the EventLogs field. -func (o *EventLogCollection) SetEventLogs(v []EventLog) { - o.EventLogs = &v +// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. +func (o *EventLogCollection) SetTotalEntries(v int32) { + o.TotalEntries = &v } -// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. -func (o *EventLogCollection) GetTotalEntries() int32 { - if o == nil || o.TotalEntries == nil { - var ret int32 +// GetEventLogs returns the EventLogs field value if set, zero value otherwise. +func (o *EventLogCollection) GetEventLogs() []EventLog { + if o == nil || IsNil(o.EventLogs) { + var ret []EventLog return ret } - return *o.TotalEntries + return o.EventLogs } -// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise +// GetEventLogsOk returns a tuple with the EventLogs field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *EventLogCollection) GetTotalEntriesOk() (*int32, bool) { - if o == nil || o.TotalEntries == nil { +func (o *EventLogCollection) GetEventLogsOk() ([]EventLog, bool) { + if o == nil || IsNil(o.EventLogs) { return nil, false } - return o.TotalEntries, true + return o.EventLogs, true } -// HasTotalEntries returns a boolean if a field has been set. -func (o *EventLogCollection) HasTotalEntries() bool { - if o != nil && o.TotalEntries != nil { +// HasEventLogs returns a boolean if a field has been set. +func (o *EventLogCollection) HasEventLogs() bool { + if o != nil && !IsNil(o.EventLogs) { return true } return false } -// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. -func (o *EventLogCollection) SetTotalEntries(v int32) { - o.TotalEntries = &v +// SetEventLogs gets a reference to the given []EventLog and assigns it to the EventLogs field. +func (o *EventLogCollection) SetEventLogs(v []EventLog) { + o.EventLogs = v } func (o EventLogCollection) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.EventLogs != nil { - toSerialize["event_logs"] = o.EventLogs + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.TotalEntries != nil { + return json.Marshal(toSerialize) +} + +func (o EventLogCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalEntries) { toSerialize["total_entries"] = o.TotalEntries } - return json.Marshal(toSerialize) + if !IsNil(o.EventLogs) { + toSerialize["event_logs"] = o.EventLogs + } + return toSerialize, nil } type NullableEventLogCollection struct { diff --git a/airflow/model_extra_link.go b/airflow/model_extra_link.go index 2bfc2d4..3038615 100644 --- a/airflow/model_extra_link.go +++ b/airflow/model_extra_link.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,11 +15,14 @@ import ( "encoding/json" ) +// checks if the ExtraLink type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ExtraLink{} + // ExtraLink Additional links containing additional information about the task. type ExtraLink struct { ClassRef *ClassReference `json:"class_ref,omitempty"` - Name *string `json:"name,omitempty"` Href *string `json:"href,omitempty"` + Name *string `json:"name,omitempty"` } // NewExtraLink instantiates a new ExtraLink object @@ -58,7 +44,7 @@ func NewExtraLinkWithDefaults() *ExtraLink { // GetClassRef returns the ClassRef field value if set, zero value otherwise. func (o *ExtraLink) GetClassRef() ClassReference { - if o == nil || o.ClassRef == nil { + if o == nil || IsNil(o.ClassRef) { var ret ClassReference return ret } @@ -68,7 +54,7 @@ func (o *ExtraLink) GetClassRef() ClassReference { // GetClassRefOk returns a tuple with the ClassRef field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ExtraLink) GetClassRefOk() (*ClassReference, bool) { - if o == nil || o.ClassRef == nil { + if o == nil || IsNil(o.ClassRef) { return nil, false } return o.ClassRef, true @@ -76,7 +62,7 @@ func (o *ExtraLink) GetClassRefOk() (*ClassReference, bool) { // HasClassRef returns a boolean if a field has been set. func (o *ExtraLink) HasClassRef() bool { - if o != nil && o.ClassRef != nil { + if o != nil && !IsNil(o.ClassRef) { return true } @@ -88,82 +74,90 @@ func (o *ExtraLink) SetClassRef(v ClassReference) { o.ClassRef = &v } -// GetName returns the Name field value if set, zero value otherwise. -func (o *ExtraLink) GetName() string { - if o == nil || o.Name == nil { +// GetHref returns the Href field value if set, zero value otherwise. +func (o *ExtraLink) GetHref() string { + if o == nil || IsNil(o.Href) { var ret string return ret } - return *o.Name + return *o.Href } -// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// GetHrefOk returns a tuple with the Href field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ExtraLink) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { +func (o *ExtraLink) GetHrefOk() (*string, bool) { + if o == nil || IsNil(o.Href) { return nil, false } - return o.Name, true + return o.Href, true } -// HasName returns a boolean if a field has been set. -func (o *ExtraLink) HasName() bool { - if o != nil && o.Name != nil { +// HasHref returns a boolean if a field has been set. +func (o *ExtraLink) HasHref() bool { + if o != nil && !IsNil(o.Href) { return true } return false } -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *ExtraLink) SetName(v string) { - o.Name = &v +// SetHref gets a reference to the given string and assigns it to the Href field. +func (o *ExtraLink) SetHref(v string) { + o.Href = &v } -// GetHref returns the Href field value if set, zero value otherwise. -func (o *ExtraLink) GetHref() string { - if o == nil || o.Href == nil { +// GetName returns the Name field value if set, zero value otherwise. +func (o *ExtraLink) GetName() string { + if o == nil || IsNil(o.Name) { var ret string return ret } - return *o.Href + return *o.Name } -// GetHrefOk returns a tuple with the Href field value if set, nil otherwise +// GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ExtraLink) GetHrefOk() (*string, bool) { - if o == nil || o.Href == nil { +func (o *ExtraLink) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { return nil, false } - return o.Href, true + return o.Name, true } -// HasHref returns a boolean if a field has been set. -func (o *ExtraLink) HasHref() bool { - if o != nil && o.Href != nil { +// HasName returns a boolean if a field has been set. +func (o *ExtraLink) HasName() bool { + if o != nil && !IsNil(o.Name) { return true } return false } -// SetHref gets a reference to the given string and assigns it to the Href field. -func (o *ExtraLink) SetHref(v string) { - o.Href = &v +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *ExtraLink) SetName(v string) { + o.Name = &v } func (o ExtraLink) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExtraLink) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.ClassRef != nil { + if !IsNil(o.ClassRef) { toSerialize["class_ref"] = o.ClassRef } - if o.Name != nil { - toSerialize["name"] = o.Name - } - if o.Href != nil { + if !IsNil(o.Href) { toSerialize["href"] = o.Href } - return json.Marshal(toSerialize) + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil } type NullableExtraLink struct { diff --git a/airflow/model_extra_link_collection.go b/airflow/model_extra_link_collection.go index 02aaffd..2a0183b 100644 --- a/airflow/model_extra_link_collection.go +++ b/airflow/model_extra_link_collection.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,9 +15,12 @@ import ( "encoding/json" ) +// checks if the ExtraLinkCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ExtraLinkCollection{} + // ExtraLinkCollection The collection of extra links. type ExtraLinkCollection struct { - ExtraLinks *[]ExtraLink `json:"extra_links,omitempty"` + ExtraLinks []ExtraLink `json:"extra_links,omitempty"` } // NewExtraLinkCollection instantiates a new ExtraLinkCollection object @@ -56,17 +42,17 @@ func NewExtraLinkCollectionWithDefaults() *ExtraLinkCollection { // GetExtraLinks returns the ExtraLinks field value if set, zero value otherwise. func (o *ExtraLinkCollection) GetExtraLinks() []ExtraLink { - if o == nil || o.ExtraLinks == nil { + if o == nil || IsNil(o.ExtraLinks) { var ret []ExtraLink return ret } - return *o.ExtraLinks + return o.ExtraLinks } // GetExtraLinksOk returns a tuple with the ExtraLinks field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ExtraLinkCollection) GetExtraLinksOk() (*[]ExtraLink, bool) { - if o == nil || o.ExtraLinks == nil { +func (o *ExtraLinkCollection) GetExtraLinksOk() ([]ExtraLink, bool) { + if o == nil || IsNil(o.ExtraLinks) { return nil, false } return o.ExtraLinks, true @@ -74,7 +60,7 @@ func (o *ExtraLinkCollection) GetExtraLinksOk() (*[]ExtraLink, bool) { // HasExtraLinks returns a boolean if a field has been set. func (o *ExtraLinkCollection) HasExtraLinks() bool { - if o != nil && o.ExtraLinks != nil { + if o != nil && !IsNil(o.ExtraLinks) { return true } @@ -83,15 +69,23 @@ func (o *ExtraLinkCollection) HasExtraLinks() bool { // SetExtraLinks gets a reference to the given []ExtraLink and assigns it to the ExtraLinks field. func (o *ExtraLinkCollection) SetExtraLinks(v []ExtraLink) { - o.ExtraLinks = &v + o.ExtraLinks = v } func (o ExtraLinkCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExtraLinkCollection) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.ExtraLinks != nil { + if !IsNil(o.ExtraLinks) { toSerialize["extra_links"] = o.ExtraLinks } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableExtraLinkCollection struct { diff --git a/airflow/model_get_dag_source_200_response.go b/airflow/model_get_dag_source_200_response.go new file mode 100644 index 0000000..2e70ae4 --- /dev/null +++ b/airflow/model_get_dag_source_200_response.go @@ -0,0 +1,127 @@ +/* +Airflow API (Stable) + +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. + +API version: 2.10.5 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package airflow + +import ( + "encoding/json" +) + +// checks if the GetDagSource200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetDagSource200Response{} + +// GetDagSource200Response struct for GetDagSource200Response +type GetDagSource200Response struct { + Content *string `json:"content,omitempty"` +} + +// NewGetDagSource200Response instantiates a new GetDagSource200Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetDagSource200Response() *GetDagSource200Response { + this := GetDagSource200Response{} + return &this +} + +// NewGetDagSource200ResponseWithDefaults instantiates a new GetDagSource200Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetDagSource200ResponseWithDefaults() *GetDagSource200Response { + this := GetDagSource200Response{} + return &this +} + +// GetContent returns the Content field value if set, zero value otherwise. +func (o *GetDagSource200Response) GetContent() string { + if o == nil || IsNil(o.Content) { + var ret string + return ret + } + return *o.Content +} + +// GetContentOk returns a tuple with the Content field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetDagSource200Response) GetContentOk() (*string, bool) { + if o == nil || IsNil(o.Content) { + return nil, false + } + return o.Content, true +} + +// HasContent returns a boolean if a field has been set. +func (o *GetDagSource200Response) HasContent() bool { + if o != nil && !IsNil(o.Content) { + return true + } + + return false +} + +// SetContent gets a reference to the given string and assigns it to the Content field. +func (o *GetDagSource200Response) SetContent(v string) { + o.Content = &v +} + +func (o GetDagSource200Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetDagSource200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Content) { + toSerialize["content"] = o.Content + } + return toSerialize, nil +} + +type NullableGetDagSource200Response struct { + value *GetDagSource200Response + isSet bool +} + +func (v NullableGetDagSource200Response) Get() *GetDagSource200Response { + return v.value +} + +func (v *NullableGetDagSource200Response) Set(val *GetDagSource200Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetDagSource200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetDagSource200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetDagSource200Response(val *GetDagSource200Response) *NullableGetDagSource200Response { + return &NullableGetDagSource200Response{value: val, isSet: true} +} + +func (v NullableGetDagSource200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetDagSource200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/model_get_log_200_response.go b/airflow/model_get_log_200_response.go new file mode 100644 index 0000000..72e77fe --- /dev/null +++ b/airflow/model_get_log_200_response.go @@ -0,0 +1,163 @@ +/* +Airflow API (Stable) + +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. + +API version: 2.10.5 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package airflow + +import ( + "encoding/json" +) + +// checks if the GetLog200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetLog200Response{} + +// GetLog200Response struct for GetLog200Response +type GetLog200Response struct { + Content *string `json:"content,omitempty"` + ContinuationToken *string `json:"continuation_token,omitempty"` +} + +// NewGetLog200Response instantiates a new GetLog200Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetLog200Response() *GetLog200Response { + this := GetLog200Response{} + return &this +} + +// NewGetLog200ResponseWithDefaults instantiates a new GetLog200Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetLog200ResponseWithDefaults() *GetLog200Response { + this := GetLog200Response{} + return &this +} + +// GetContent returns the Content field value if set, zero value otherwise. +func (o *GetLog200Response) GetContent() string { + if o == nil || IsNil(o.Content) { + var ret string + return ret + } + return *o.Content +} + +// GetContentOk returns a tuple with the Content field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetLog200Response) GetContentOk() (*string, bool) { + if o == nil || IsNil(o.Content) { + return nil, false + } + return o.Content, true +} + +// HasContent returns a boolean if a field has been set. +func (o *GetLog200Response) HasContent() bool { + if o != nil && !IsNil(o.Content) { + return true + } + + return false +} + +// SetContent gets a reference to the given string and assigns it to the Content field. +func (o *GetLog200Response) SetContent(v string) { + o.Content = &v +} + +// GetContinuationToken returns the ContinuationToken field value if set, zero value otherwise. +func (o *GetLog200Response) GetContinuationToken() string { + if o == nil || IsNil(o.ContinuationToken) { + var ret string + return ret + } + return *o.ContinuationToken +} + +// GetContinuationTokenOk returns a tuple with the ContinuationToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetLog200Response) GetContinuationTokenOk() (*string, bool) { + if o == nil || IsNil(o.ContinuationToken) { + return nil, false + } + return o.ContinuationToken, true +} + +// HasContinuationToken returns a boolean if a field has been set. +func (o *GetLog200Response) HasContinuationToken() bool { + if o != nil && !IsNil(o.ContinuationToken) { + return true + } + + return false +} + +// SetContinuationToken gets a reference to the given string and assigns it to the ContinuationToken field. +func (o *GetLog200Response) SetContinuationToken(v string) { + o.ContinuationToken = &v +} + +func (o GetLog200Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetLog200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Content) { + toSerialize["content"] = o.Content + } + if !IsNil(o.ContinuationToken) { + toSerialize["continuation_token"] = o.ContinuationToken + } + return toSerialize, nil +} + +type NullableGetLog200Response struct { + value *GetLog200Response + isSet bool +} + +func (v NullableGetLog200Response) Get() *GetLog200Response { + return v.value +} + +func (v *NullableGetLog200Response) Set(val *GetLog200Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetLog200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetLog200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetLog200Response(val *GetLog200Response) *NullableGetLog200Response { + return &NullableGetLog200Response{value: val, isSet: true} +} + +func (v NullableGetLog200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetLog200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/model_get_providers_200_response.go b/airflow/model_get_providers_200_response.go new file mode 100644 index 0000000..ceb0858 --- /dev/null +++ b/airflow/model_get_providers_200_response.go @@ -0,0 +1,164 @@ +/* +Airflow API (Stable) + +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. + +API version: 2.10.5 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package airflow + +import ( + "encoding/json" +) + +// checks if the GetProviders200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetProviders200Response{} + +// GetProviders200Response struct for GetProviders200Response +type GetProviders200Response struct { + Providers []Provider `json:"providers,omitempty"` + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. + TotalEntries *int32 `json:"total_entries,omitempty"` +} + +// NewGetProviders200Response instantiates a new GetProviders200Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetProviders200Response() *GetProviders200Response { + this := GetProviders200Response{} + return &this +} + +// NewGetProviders200ResponseWithDefaults instantiates a new GetProviders200Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetProviders200ResponseWithDefaults() *GetProviders200Response { + this := GetProviders200Response{} + return &this +} + +// GetProviders returns the Providers field value if set, zero value otherwise. +func (o *GetProviders200Response) GetProviders() []Provider { + if o == nil || IsNil(o.Providers) { + var ret []Provider + return ret + } + return o.Providers +} + +// GetProvidersOk returns a tuple with the Providers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetProviders200Response) GetProvidersOk() ([]Provider, bool) { + if o == nil || IsNil(o.Providers) { + return nil, false + } + return o.Providers, true +} + +// HasProviders returns a boolean if a field has been set. +func (o *GetProviders200Response) HasProviders() bool { + if o != nil && !IsNil(o.Providers) { + return true + } + + return false +} + +// SetProviders gets a reference to the given []Provider and assigns it to the Providers field. +func (o *GetProviders200Response) SetProviders(v []Provider) { + o.Providers = v +} + +// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. +func (o *GetProviders200Response) GetTotalEntries() int32 { + if o == nil || IsNil(o.TotalEntries) { + var ret int32 + return ret + } + return *o.TotalEntries +} + +// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetProviders200Response) GetTotalEntriesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalEntries) { + return nil, false + } + return o.TotalEntries, true +} + +// HasTotalEntries returns a boolean if a field has been set. +func (o *GetProviders200Response) HasTotalEntries() bool { + if o != nil && !IsNil(o.TotalEntries) { + return true + } + + return false +} + +// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. +func (o *GetProviders200Response) SetTotalEntries(v int32) { + o.TotalEntries = &v +} + +func (o GetProviders200Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetProviders200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Providers) { + toSerialize["providers"] = o.Providers + } + if !IsNil(o.TotalEntries) { + toSerialize["total_entries"] = o.TotalEntries + } + return toSerialize, nil +} + +type NullableGetProviders200Response struct { + value *GetProviders200Response + isSet bool +} + +func (v NullableGetProviders200Response) Get() *GetProviders200Response { + return v.value +} + +func (v *NullableGetProviders200Response) Set(val *GetProviders200Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetProviders200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetProviders200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetProviders200Response(val *GetProviders200Response) *NullableGetProviders200Response { + return &NullableGetProviders200Response{value: val, isSet: true} +} + +func (v NullableGetProviders200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetProviders200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/model_health_info.go b/airflow/model_health_info.go index e6eb1ce..2d214f7 100644 --- a/airflow/model_health_info.go +++ b/airflow/model_health_info.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,10 +15,15 @@ import ( "encoding/json" ) +// checks if the HealthInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HealthInfo{} + // HealthInfo Instance status information. type HealthInfo struct { + DagProcessor *DagProcessorStatus `json:"dag_processor,omitempty"` Metadatabase *MetadatabaseStatus `json:"metadatabase,omitempty"` Scheduler *SchedulerStatus `json:"scheduler,omitempty"` + Triggerer *TriggererStatus `json:"triggerer,omitempty"` } // NewHealthInfo instantiates a new HealthInfo object @@ -55,9 +43,41 @@ func NewHealthInfoWithDefaults() *HealthInfo { return &this } +// GetDagProcessor returns the DagProcessor field value if set, zero value otherwise. +func (o *HealthInfo) GetDagProcessor() DagProcessorStatus { + if o == nil || IsNil(o.DagProcessor) { + var ret DagProcessorStatus + return ret + } + return *o.DagProcessor +} + +// GetDagProcessorOk returns a tuple with the DagProcessor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HealthInfo) GetDagProcessorOk() (*DagProcessorStatus, bool) { + if o == nil || IsNil(o.DagProcessor) { + return nil, false + } + return o.DagProcessor, true +} + +// HasDagProcessor returns a boolean if a field has been set. +func (o *HealthInfo) HasDagProcessor() bool { + if o != nil && !IsNil(o.DagProcessor) { + return true + } + + return false +} + +// SetDagProcessor gets a reference to the given DagProcessorStatus and assigns it to the DagProcessor field. +func (o *HealthInfo) SetDagProcessor(v DagProcessorStatus) { + o.DagProcessor = &v +} + // GetMetadatabase returns the Metadatabase field value if set, zero value otherwise. func (o *HealthInfo) GetMetadatabase() MetadatabaseStatus { - if o == nil || o.Metadatabase == nil { + if o == nil || IsNil(o.Metadatabase) { var ret MetadatabaseStatus return ret } @@ -67,7 +87,7 @@ func (o *HealthInfo) GetMetadatabase() MetadatabaseStatus { // GetMetadatabaseOk returns a tuple with the Metadatabase field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *HealthInfo) GetMetadatabaseOk() (*MetadatabaseStatus, bool) { - if o == nil || o.Metadatabase == nil { + if o == nil || IsNil(o.Metadatabase) { return nil, false } return o.Metadatabase, true @@ -75,7 +95,7 @@ func (o *HealthInfo) GetMetadatabaseOk() (*MetadatabaseStatus, bool) { // HasMetadatabase returns a boolean if a field has been set. func (o *HealthInfo) HasMetadatabase() bool { - if o != nil && o.Metadatabase != nil { + if o != nil && !IsNil(o.Metadatabase) { return true } @@ -89,7 +109,7 @@ func (o *HealthInfo) SetMetadatabase(v MetadatabaseStatus) { // GetScheduler returns the Scheduler field value if set, zero value otherwise. func (o *HealthInfo) GetScheduler() SchedulerStatus { - if o == nil || o.Scheduler == nil { + if o == nil || IsNil(o.Scheduler) { var ret SchedulerStatus return ret } @@ -99,7 +119,7 @@ func (o *HealthInfo) GetScheduler() SchedulerStatus { // GetSchedulerOk returns a tuple with the Scheduler field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *HealthInfo) GetSchedulerOk() (*SchedulerStatus, bool) { - if o == nil || o.Scheduler == nil { + if o == nil || IsNil(o.Scheduler) { return nil, false } return o.Scheduler, true @@ -107,7 +127,7 @@ func (o *HealthInfo) GetSchedulerOk() (*SchedulerStatus, bool) { // HasScheduler returns a boolean if a field has been set. func (o *HealthInfo) HasScheduler() bool { - if o != nil && o.Scheduler != nil { + if o != nil && !IsNil(o.Scheduler) { return true } @@ -119,15 +139,61 @@ func (o *HealthInfo) SetScheduler(v SchedulerStatus) { o.Scheduler = &v } +// GetTriggerer returns the Triggerer field value if set, zero value otherwise. +func (o *HealthInfo) GetTriggerer() TriggererStatus { + if o == nil || IsNil(o.Triggerer) { + var ret TriggererStatus + return ret + } + return *o.Triggerer +} + +// GetTriggererOk returns a tuple with the Triggerer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HealthInfo) GetTriggererOk() (*TriggererStatus, bool) { + if o == nil || IsNil(o.Triggerer) { + return nil, false + } + return o.Triggerer, true +} + +// HasTriggerer returns a boolean if a field has been set. +func (o *HealthInfo) HasTriggerer() bool { + if o != nil && !IsNil(o.Triggerer) { + return true + } + + return false +} + +// SetTriggerer gets a reference to the given TriggererStatus and assigns it to the Triggerer field. +func (o *HealthInfo) SetTriggerer(v TriggererStatus) { + o.Triggerer = &v +} + func (o HealthInfo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HealthInfo) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Metadatabase != nil { + if !IsNil(o.DagProcessor) { + toSerialize["dag_processor"] = o.DagProcessor + } + if !IsNil(o.Metadatabase) { toSerialize["metadatabase"] = o.Metadatabase } - if o.Scheduler != nil { + if !IsNil(o.Scheduler) { toSerialize["scheduler"] = o.Scheduler } - return json.Marshal(toSerialize) + if !IsNil(o.Triggerer) { + toSerialize["triggerer"] = o.Triggerer + } + return toSerialize, nil } type NullableHealthInfo struct { diff --git a/airflow/model_health_status.go b/airflow/model_health_status.go index b9365fc..d3b80b8 100644 --- a/airflow/model_health_status.go +++ b/airflow/model_health_status.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -38,8 +21,8 @@ type HealthStatus string // List of HealthStatus const ( - HEALTHSTATUS_HEALTHY HealthStatus = "healthy" - HEALTHSTATUS_UNHEALTHY HealthStatus = "unhealthy" + HEALTHY HealthStatus = "healthy" + UNHEALTHY HealthStatus = "unhealthy" ) // All allowed values of HealthStatus enum diff --git a/airflow/model_import_error.go b/airflow/model_import_error.go index 66613e0..b61ed04 100644 --- a/airflow/model_import_error.go +++ b/airflow/model_import_error.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,16 +15,19 @@ import ( "encoding/json" ) +// checks if the ImportError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImportError{} + // ImportError struct for ImportError type ImportError struct { + // The filename + Filename *string `json:"filename,omitempty"` // The import error ID. ImportErrorId *int32 `json:"import_error_id,omitempty"` + // The full stackstrace. + StackTrace *string `json:"stack_trace,omitempty"` // The time when this error was created. Timestamp *string `json:"timestamp,omitempty"` - // The filename - Filename *string `json:"filename,omitempty"` - // The full stackstrace.. - StackTrace *string `json:"stack_trace,omitempty"` } // NewImportError instantiates a new ImportError object @@ -61,149 +47,157 @@ func NewImportErrorWithDefaults() *ImportError { return &this } -// GetImportErrorId returns the ImportErrorId field value if set, zero value otherwise. -func (o *ImportError) GetImportErrorId() int32 { - if o == nil || o.ImportErrorId == nil { - var ret int32 +// GetFilename returns the Filename field value if set, zero value otherwise. +func (o *ImportError) GetFilename() string { + if o == nil || IsNil(o.Filename) { + var ret string return ret } - return *o.ImportErrorId + return *o.Filename } -// GetImportErrorIdOk returns a tuple with the ImportErrorId field value if set, nil otherwise +// GetFilenameOk returns a tuple with the Filename field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ImportError) GetImportErrorIdOk() (*int32, bool) { - if o == nil || o.ImportErrorId == nil { +func (o *ImportError) GetFilenameOk() (*string, bool) { + if o == nil || IsNil(o.Filename) { return nil, false } - return o.ImportErrorId, true + return o.Filename, true } -// HasImportErrorId returns a boolean if a field has been set. -func (o *ImportError) HasImportErrorId() bool { - if o != nil && o.ImportErrorId != nil { +// HasFilename returns a boolean if a field has been set. +func (o *ImportError) HasFilename() bool { + if o != nil && !IsNil(o.Filename) { return true } return false } -// SetImportErrorId gets a reference to the given int32 and assigns it to the ImportErrorId field. -func (o *ImportError) SetImportErrorId(v int32) { - o.ImportErrorId = &v +// SetFilename gets a reference to the given string and assigns it to the Filename field. +func (o *ImportError) SetFilename(v string) { + o.Filename = &v } -// GetTimestamp returns the Timestamp field value if set, zero value otherwise. -func (o *ImportError) GetTimestamp() string { - if o == nil || o.Timestamp == nil { - var ret string +// GetImportErrorId returns the ImportErrorId field value if set, zero value otherwise. +func (o *ImportError) GetImportErrorId() int32 { + if o == nil || IsNil(o.ImportErrorId) { + var ret int32 return ret } - return *o.Timestamp + return *o.ImportErrorId } -// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// GetImportErrorIdOk returns a tuple with the ImportErrorId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ImportError) GetTimestampOk() (*string, bool) { - if o == nil || o.Timestamp == nil { +func (o *ImportError) GetImportErrorIdOk() (*int32, bool) { + if o == nil || IsNil(o.ImportErrorId) { return nil, false } - return o.Timestamp, true + return o.ImportErrorId, true } -// HasTimestamp returns a boolean if a field has been set. -func (o *ImportError) HasTimestamp() bool { - if o != nil && o.Timestamp != nil { +// HasImportErrorId returns a boolean if a field has been set. +func (o *ImportError) HasImportErrorId() bool { + if o != nil && !IsNil(o.ImportErrorId) { return true } return false } -// SetTimestamp gets a reference to the given string and assigns it to the Timestamp field. -func (o *ImportError) SetTimestamp(v string) { - o.Timestamp = &v +// SetImportErrorId gets a reference to the given int32 and assigns it to the ImportErrorId field. +func (o *ImportError) SetImportErrorId(v int32) { + o.ImportErrorId = &v } -// GetFilename returns the Filename field value if set, zero value otherwise. -func (o *ImportError) GetFilename() string { - if o == nil || o.Filename == nil { +// GetStackTrace returns the StackTrace field value if set, zero value otherwise. +func (o *ImportError) GetStackTrace() string { + if o == nil || IsNil(o.StackTrace) { var ret string return ret } - return *o.Filename + return *o.StackTrace } -// GetFilenameOk returns a tuple with the Filename field value if set, nil otherwise +// GetStackTraceOk returns a tuple with the StackTrace field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ImportError) GetFilenameOk() (*string, bool) { - if o == nil || o.Filename == nil { +func (o *ImportError) GetStackTraceOk() (*string, bool) { + if o == nil || IsNil(o.StackTrace) { return nil, false } - return o.Filename, true + return o.StackTrace, true } -// HasFilename returns a boolean if a field has been set. -func (o *ImportError) HasFilename() bool { - if o != nil && o.Filename != nil { +// HasStackTrace returns a boolean if a field has been set. +func (o *ImportError) HasStackTrace() bool { + if o != nil && !IsNil(o.StackTrace) { return true } return false } -// SetFilename gets a reference to the given string and assigns it to the Filename field. -func (o *ImportError) SetFilename(v string) { - o.Filename = &v +// SetStackTrace gets a reference to the given string and assigns it to the StackTrace field. +func (o *ImportError) SetStackTrace(v string) { + o.StackTrace = &v } -// GetStackTrace returns the StackTrace field value if set, zero value otherwise. -func (o *ImportError) GetStackTrace() string { - if o == nil || o.StackTrace == nil { +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *ImportError) GetTimestamp() string { + if o == nil || IsNil(o.Timestamp) { var ret string return ret } - return *o.StackTrace + return *o.Timestamp } -// GetStackTraceOk returns a tuple with the StackTrace field value if set, nil otherwise +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ImportError) GetStackTraceOk() (*string, bool) { - if o == nil || o.StackTrace == nil { +func (o *ImportError) GetTimestampOk() (*string, bool) { + if o == nil || IsNil(o.Timestamp) { return nil, false } - return o.StackTrace, true + return o.Timestamp, true } -// HasStackTrace returns a boolean if a field has been set. -func (o *ImportError) HasStackTrace() bool { - if o != nil && o.StackTrace != nil { +// HasTimestamp returns a boolean if a field has been set. +func (o *ImportError) HasTimestamp() bool { + if o != nil && !IsNil(o.Timestamp) { return true } return false } -// SetStackTrace gets a reference to the given string and assigns it to the StackTrace field. -func (o *ImportError) SetStackTrace(v string) { - o.StackTrace = &v +// SetTimestamp gets a reference to the given string and assigns it to the Timestamp field. +func (o *ImportError) SetTimestamp(v string) { + o.Timestamp = &v } func (o ImportError) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.ImportErrorId != nil { - toSerialize["import_error_id"] = o.ImportErrorId + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.Timestamp != nil { - toSerialize["timestamp"] = o.Timestamp - } - if o.Filename != nil { + return json.Marshal(toSerialize) +} + +func (o ImportError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Filename) { toSerialize["filename"] = o.Filename } - if o.StackTrace != nil { + if !IsNil(o.ImportErrorId) { + toSerialize["import_error_id"] = o.ImportErrorId + } + if !IsNil(o.StackTrace) { toSerialize["stack_trace"] = o.StackTrace } - return json.Marshal(toSerialize) + if !IsNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } + return toSerialize, nil } type NullableImportError struct { diff --git a/airflow/model_import_error_collection.go b/airflow/model_import_error_collection.go index c53ca1c..7bc9951 100644 --- a/airflow/model_import_error_collection.go +++ b/airflow/model_import_error_collection.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,11 +15,14 @@ import ( "encoding/json" ) +// checks if the ImportErrorCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImportErrorCollection{} + // ImportErrorCollection Collection of import errors. *Changed in version 2.1.0*: 'total_entries' field is added. type ImportErrorCollection struct { - ImportErrors *[]ImportError `json:"import_errors,omitempty"` - // Count of objects in the current result set. + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. TotalEntries *int32 `json:"total_entries,omitempty"` + ImportErrors []ImportError `json:"import_errors,omitempty"` } // NewImportErrorCollection instantiates a new ImportErrorCollection object @@ -56,79 +42,87 @@ func NewImportErrorCollectionWithDefaults() *ImportErrorCollection { return &this } -// GetImportErrors returns the ImportErrors field value if set, zero value otherwise. -func (o *ImportErrorCollection) GetImportErrors() []ImportError { - if o == nil || o.ImportErrors == nil { - var ret []ImportError +// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. +func (o *ImportErrorCollection) GetTotalEntries() int32 { + if o == nil || IsNil(o.TotalEntries) { + var ret int32 return ret } - return *o.ImportErrors + return *o.TotalEntries } -// GetImportErrorsOk returns a tuple with the ImportErrors field value if set, nil otherwise +// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ImportErrorCollection) GetImportErrorsOk() (*[]ImportError, bool) { - if o == nil || o.ImportErrors == nil { +func (o *ImportErrorCollection) GetTotalEntriesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalEntries) { return nil, false } - return o.ImportErrors, true + return o.TotalEntries, true } -// HasImportErrors returns a boolean if a field has been set. -func (o *ImportErrorCollection) HasImportErrors() bool { - if o != nil && o.ImportErrors != nil { +// HasTotalEntries returns a boolean if a field has been set. +func (o *ImportErrorCollection) HasTotalEntries() bool { + if o != nil && !IsNil(o.TotalEntries) { return true } return false } -// SetImportErrors gets a reference to the given []ImportError and assigns it to the ImportErrors field. -func (o *ImportErrorCollection) SetImportErrors(v []ImportError) { - o.ImportErrors = &v +// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. +func (o *ImportErrorCollection) SetTotalEntries(v int32) { + o.TotalEntries = &v } -// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. -func (o *ImportErrorCollection) GetTotalEntries() int32 { - if o == nil || o.TotalEntries == nil { - var ret int32 +// GetImportErrors returns the ImportErrors field value if set, zero value otherwise. +func (o *ImportErrorCollection) GetImportErrors() []ImportError { + if o == nil || IsNil(o.ImportErrors) { + var ret []ImportError return ret } - return *o.TotalEntries + return o.ImportErrors } -// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise +// GetImportErrorsOk returns a tuple with the ImportErrors field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ImportErrorCollection) GetTotalEntriesOk() (*int32, bool) { - if o == nil || o.TotalEntries == nil { +func (o *ImportErrorCollection) GetImportErrorsOk() ([]ImportError, bool) { + if o == nil || IsNil(o.ImportErrors) { return nil, false } - return o.TotalEntries, true + return o.ImportErrors, true } -// HasTotalEntries returns a boolean if a field has been set. -func (o *ImportErrorCollection) HasTotalEntries() bool { - if o != nil && o.TotalEntries != nil { +// HasImportErrors returns a boolean if a field has been set. +func (o *ImportErrorCollection) HasImportErrors() bool { + if o != nil && !IsNil(o.ImportErrors) { return true } return false } -// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. -func (o *ImportErrorCollection) SetTotalEntries(v int32) { - o.TotalEntries = &v +// SetImportErrors gets a reference to the given []ImportError and assigns it to the ImportErrors field. +func (o *ImportErrorCollection) SetImportErrors(v []ImportError) { + o.ImportErrors = v } func (o ImportErrorCollection) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.ImportErrors != nil { - toSerialize["import_errors"] = o.ImportErrors + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.TotalEntries != nil { + return json.Marshal(toSerialize) +} + +func (o ImportErrorCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalEntries) { toSerialize["total_entries"] = o.TotalEntries } - return json.Marshal(toSerialize) + if !IsNil(o.ImportErrors) { + toSerialize["import_errors"] = o.ImportErrors + } + return toSerialize, nil } type NullableImportErrorCollection struct { diff --git a/airflow/model_job.go b/airflow/model_job.go index 9fb2357..9112725 100644 --- a/airflow/model_job.go +++ b/airflow/model_job.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,17 +15,20 @@ import ( "encoding/json" ) +// checks if the Job type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Job{} + // Job struct for Job type Job struct { - Id *int32 `json:"id,omitempty"` DagId NullableString `json:"dag_id,omitempty"` - State NullableString `json:"state,omitempty"` - JobType NullableString `json:"job_type,omitempty"` - StartDate NullableString `json:"start_date,omitempty"` EndDate NullableString `json:"end_date,omitempty"` - LatestHeartbeat NullableString `json:"latest_heartbeat,omitempty"` ExecutorClass NullableString `json:"executor_class,omitempty"` Hostname NullableString `json:"hostname,omitempty"` + Id *int32 `json:"id,omitempty"` + JobType NullableString `json:"job_type,omitempty"` + LatestHeartbeat NullableString `json:"latest_heartbeat,omitempty"` + StartDate NullableString `json:"start_date,omitempty"` + State NullableString `json:"state,omitempty"` Unixname NullableString `json:"unixname,omitempty"` } @@ -63,41 +49,9 @@ func NewJobWithDefaults() *Job { return &this } -// GetId returns the Id field value if set, zero value otherwise. -func (o *Job) GetId() int32 { - if o == nil || o.Id == nil { - var ret int32 - return ret - } - return *o.Id -} - -// GetIdOk returns a tuple with the Id field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Job) GetIdOk() (*int32, bool) { - if o == nil || o.Id == nil { - return nil, false - } - return o.Id, true -} - -// HasId returns a boolean if a field has been set. -func (o *Job) HasId() bool { - if o != nil && o.Id != nil { - return true - } - - return false -} - -// SetId gets a reference to the given int32 and assigns it to the Id field. -func (o *Job) SetId(v int32) { - o.Id = &v -} - // GetDagId returns the DagId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Job) GetDagId() string { - if o == nil || o.DagId.Get() == nil { + if o == nil || IsNil(o.DagId.Get()) { var ret string return ret } @@ -108,7 +62,7 @@ func (o *Job) GetDagId() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Job) GetDagIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.DagId.Get(), o.DagId.IsSet() @@ -137,177 +91,209 @@ func (o *Job) UnsetDagId() { o.DagId.Unset() } -// GetState returns the State field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Job) GetState() string { - if o == nil || o.State.Get() == nil { +// GetEndDate returns the EndDate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Job) GetEndDate() string { + if o == nil || IsNil(o.EndDate.Get()) { var ret string return ret } - return *o.State.Get() + return *o.EndDate.Get() } -// GetStateOk returns a tuple with the State field value if set, nil otherwise +// GetEndDateOk returns a tuple with the EndDate field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Job) GetStateOk() (*string, bool) { - if o == nil { +func (o *Job) GetEndDateOk() (*string, bool) { + if o == nil { return nil, false } - return o.State.Get(), o.State.IsSet() + return o.EndDate.Get(), o.EndDate.IsSet() } -// HasState returns a boolean if a field has been set. -func (o *Job) HasState() bool { - if o != nil && o.State.IsSet() { +// HasEndDate returns a boolean if a field has been set. +func (o *Job) HasEndDate() bool { + if o != nil && o.EndDate.IsSet() { return true } return false } -// SetState gets a reference to the given NullableString and assigns it to the State field. -func (o *Job) SetState(v string) { - o.State.Set(&v) +// SetEndDate gets a reference to the given NullableString and assigns it to the EndDate field. +func (o *Job) SetEndDate(v string) { + o.EndDate.Set(&v) } -// SetStateNil sets the value for State to be an explicit nil -func (o *Job) SetStateNil() { - o.State.Set(nil) +// SetEndDateNil sets the value for EndDate to be an explicit nil +func (o *Job) SetEndDateNil() { + o.EndDate.Set(nil) } -// UnsetState ensures that no value is present for State, not even an explicit nil -func (o *Job) UnsetState() { - o.State.Unset() +// UnsetEndDate ensures that no value is present for EndDate, not even an explicit nil +func (o *Job) UnsetEndDate() { + o.EndDate.Unset() } -// GetJobType returns the JobType field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Job) GetJobType() string { - if o == nil || o.JobType.Get() == nil { +// GetExecutorClass returns the ExecutorClass field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Job) GetExecutorClass() string { + if o == nil || IsNil(o.ExecutorClass.Get()) { var ret string return ret } - return *o.JobType.Get() + return *o.ExecutorClass.Get() } -// GetJobTypeOk returns a tuple with the JobType field value if set, nil otherwise +// GetExecutorClassOk returns a tuple with the ExecutorClass field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Job) GetJobTypeOk() (*string, bool) { - if o == nil { +func (o *Job) GetExecutorClassOk() (*string, bool) { + if o == nil { return nil, false } - return o.JobType.Get(), o.JobType.IsSet() + return o.ExecutorClass.Get(), o.ExecutorClass.IsSet() } -// HasJobType returns a boolean if a field has been set. -func (o *Job) HasJobType() bool { - if o != nil && o.JobType.IsSet() { +// HasExecutorClass returns a boolean if a field has been set. +func (o *Job) HasExecutorClass() bool { + if o != nil && o.ExecutorClass.IsSet() { return true } return false } -// SetJobType gets a reference to the given NullableString and assigns it to the JobType field. -func (o *Job) SetJobType(v string) { - o.JobType.Set(&v) +// SetExecutorClass gets a reference to the given NullableString and assigns it to the ExecutorClass field. +func (o *Job) SetExecutorClass(v string) { + o.ExecutorClass.Set(&v) } -// SetJobTypeNil sets the value for JobType to be an explicit nil -func (o *Job) SetJobTypeNil() { - o.JobType.Set(nil) +// SetExecutorClassNil sets the value for ExecutorClass to be an explicit nil +func (o *Job) SetExecutorClassNil() { + o.ExecutorClass.Set(nil) } -// UnsetJobType ensures that no value is present for JobType, not even an explicit nil -func (o *Job) UnsetJobType() { - o.JobType.Unset() +// UnsetExecutorClass ensures that no value is present for ExecutorClass, not even an explicit nil +func (o *Job) UnsetExecutorClass() { + o.ExecutorClass.Unset() } -// GetStartDate returns the StartDate field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Job) GetStartDate() string { - if o == nil || o.StartDate.Get() == nil { +// GetHostname returns the Hostname field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Job) GetHostname() string { + if o == nil || IsNil(o.Hostname.Get()) { var ret string return ret } - return *o.StartDate.Get() + return *o.Hostname.Get() } -// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise +// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Job) GetStartDateOk() (*string, bool) { - if o == nil { +func (o *Job) GetHostnameOk() (*string, bool) { + if o == nil { return nil, false } - return o.StartDate.Get(), o.StartDate.IsSet() + return o.Hostname.Get(), o.Hostname.IsSet() } -// HasStartDate returns a boolean if a field has been set. -func (o *Job) HasStartDate() bool { - if o != nil && o.StartDate.IsSet() { +// HasHostname returns a boolean if a field has been set. +func (o *Job) HasHostname() bool { + if o != nil && o.Hostname.IsSet() { return true } return false } -// SetStartDate gets a reference to the given NullableString and assigns it to the StartDate field. -func (o *Job) SetStartDate(v string) { - o.StartDate.Set(&v) +// SetHostname gets a reference to the given NullableString and assigns it to the Hostname field. +func (o *Job) SetHostname(v string) { + o.Hostname.Set(&v) } -// SetStartDateNil sets the value for StartDate to be an explicit nil -func (o *Job) SetStartDateNil() { - o.StartDate.Set(nil) +// SetHostnameNil sets the value for Hostname to be an explicit nil +func (o *Job) SetHostnameNil() { + o.Hostname.Set(nil) } -// UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil -func (o *Job) UnsetStartDate() { - o.StartDate.Unset() +// UnsetHostname ensures that no value is present for Hostname, not even an explicit nil +func (o *Job) UnsetHostname() { + o.Hostname.Unset() } -// GetEndDate returns the EndDate field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Job) GetEndDate() string { - if o == nil || o.EndDate.Get() == nil { +// GetId returns the Id field value if set, zero value otherwise. +func (o *Job) GetId() int32 { + if o == nil || IsNil(o.Id) { + var ret int32 + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Job) GetIdOk() (*int32, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Job) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given int32 and assigns it to the Id field. +func (o *Job) SetId(v int32) { + o.Id = &v +} + +// GetJobType returns the JobType field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Job) GetJobType() string { + if o == nil || IsNil(o.JobType.Get()) { var ret string return ret } - return *o.EndDate.Get() + return *o.JobType.Get() } -// GetEndDateOk returns a tuple with the EndDate field value if set, nil otherwise +// GetJobTypeOk returns a tuple with the JobType field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Job) GetEndDateOk() (*string, bool) { - if o == nil { +func (o *Job) GetJobTypeOk() (*string, bool) { + if o == nil { return nil, false } - return o.EndDate.Get(), o.EndDate.IsSet() + return o.JobType.Get(), o.JobType.IsSet() } -// HasEndDate returns a boolean if a field has been set. -func (o *Job) HasEndDate() bool { - if o != nil && o.EndDate.IsSet() { +// HasJobType returns a boolean if a field has been set. +func (o *Job) HasJobType() bool { + if o != nil && o.JobType.IsSet() { return true } return false } -// SetEndDate gets a reference to the given NullableString and assigns it to the EndDate field. -func (o *Job) SetEndDate(v string) { - o.EndDate.Set(&v) +// SetJobType gets a reference to the given NullableString and assigns it to the JobType field. +func (o *Job) SetJobType(v string) { + o.JobType.Set(&v) } -// SetEndDateNil sets the value for EndDate to be an explicit nil -func (o *Job) SetEndDateNil() { - o.EndDate.Set(nil) +// SetJobTypeNil sets the value for JobType to be an explicit nil +func (o *Job) SetJobTypeNil() { + o.JobType.Set(nil) } -// UnsetEndDate ensures that no value is present for EndDate, not even an explicit nil -func (o *Job) UnsetEndDate() { - o.EndDate.Unset() +// UnsetJobType ensures that no value is present for JobType, not even an explicit nil +func (o *Job) UnsetJobType() { + o.JobType.Unset() } // GetLatestHeartbeat returns the LatestHeartbeat field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Job) GetLatestHeartbeat() string { - if o == nil || o.LatestHeartbeat.Get() == nil { + if o == nil || IsNil(o.LatestHeartbeat.Get()) { var ret string return ret } @@ -318,7 +304,7 @@ func (o *Job) GetLatestHeartbeat() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Job) GetLatestHeartbeatOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.LatestHeartbeat.Get(), o.LatestHeartbeat.IsSet() @@ -347,93 +333,93 @@ func (o *Job) UnsetLatestHeartbeat() { o.LatestHeartbeat.Unset() } -// GetExecutorClass returns the ExecutorClass field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Job) GetExecutorClass() string { - if o == nil || o.ExecutorClass.Get() == nil { +// GetStartDate returns the StartDate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Job) GetStartDate() string { + if o == nil || IsNil(o.StartDate.Get()) { var ret string return ret } - return *o.ExecutorClass.Get() + return *o.StartDate.Get() } -// GetExecutorClassOk returns a tuple with the ExecutorClass field value if set, nil otherwise +// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Job) GetExecutorClassOk() (*string, bool) { - if o == nil { +func (o *Job) GetStartDateOk() (*string, bool) { + if o == nil { return nil, false } - return o.ExecutorClass.Get(), o.ExecutorClass.IsSet() + return o.StartDate.Get(), o.StartDate.IsSet() } -// HasExecutorClass returns a boolean if a field has been set. -func (o *Job) HasExecutorClass() bool { - if o != nil && o.ExecutorClass.IsSet() { +// HasStartDate returns a boolean if a field has been set. +func (o *Job) HasStartDate() bool { + if o != nil && o.StartDate.IsSet() { return true } return false } -// SetExecutorClass gets a reference to the given NullableString and assigns it to the ExecutorClass field. -func (o *Job) SetExecutorClass(v string) { - o.ExecutorClass.Set(&v) +// SetStartDate gets a reference to the given NullableString and assigns it to the StartDate field. +func (o *Job) SetStartDate(v string) { + o.StartDate.Set(&v) } -// SetExecutorClassNil sets the value for ExecutorClass to be an explicit nil -func (o *Job) SetExecutorClassNil() { - o.ExecutorClass.Set(nil) +// SetStartDateNil sets the value for StartDate to be an explicit nil +func (o *Job) SetStartDateNil() { + o.StartDate.Set(nil) } -// UnsetExecutorClass ensures that no value is present for ExecutorClass, not even an explicit nil -func (o *Job) UnsetExecutorClass() { - o.ExecutorClass.Unset() +// UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil +func (o *Job) UnsetStartDate() { + o.StartDate.Unset() } -// GetHostname returns the Hostname field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Job) GetHostname() string { - if o == nil || o.Hostname.Get() == nil { +// GetState returns the State field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Job) GetState() string { + if o == nil || IsNil(o.State.Get()) { var ret string return ret } - return *o.Hostname.Get() + return *o.State.Get() } -// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise +// GetStateOk returns a tuple with the State field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Job) GetHostnameOk() (*string, bool) { - if o == nil { +func (o *Job) GetStateOk() (*string, bool) { + if o == nil { return nil, false } - return o.Hostname.Get(), o.Hostname.IsSet() + return o.State.Get(), o.State.IsSet() } -// HasHostname returns a boolean if a field has been set. -func (o *Job) HasHostname() bool { - if o != nil && o.Hostname.IsSet() { +// HasState returns a boolean if a field has been set. +func (o *Job) HasState() bool { + if o != nil && o.State.IsSet() { return true } return false } -// SetHostname gets a reference to the given NullableString and assigns it to the Hostname field. -func (o *Job) SetHostname(v string) { - o.Hostname.Set(&v) +// SetState gets a reference to the given NullableString and assigns it to the State field. +func (o *Job) SetState(v string) { + o.State.Set(&v) } -// SetHostnameNil sets the value for Hostname to be an explicit nil -func (o *Job) SetHostnameNil() { - o.Hostname.Set(nil) +// SetStateNil sets the value for State to be an explicit nil +func (o *Job) SetStateNil() { + o.State.Set(nil) } -// UnsetHostname ensures that no value is present for Hostname, not even an explicit nil -func (o *Job) UnsetHostname() { - o.Hostname.Unset() +// UnsetState ensures that no value is present for State, not even an explicit nil +func (o *Job) UnsetState() { + o.State.Unset() } // GetUnixname returns the Unixname field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Job) GetUnixname() string { - if o == nil || o.Unixname.Get() == nil { + if o == nil || IsNil(o.Unixname.Get()) { var ret string return ret } @@ -444,7 +430,7 @@ func (o *Job) GetUnixname() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Job) GetUnixnameOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Unixname.Get(), o.Unixname.IsSet() @@ -474,38 +460,46 @@ func (o *Job) UnsetUnixname() { } func (o Job) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Id != nil { - toSerialize["id"] = o.Id + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o Job) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} if o.DagId.IsSet() { toSerialize["dag_id"] = o.DagId.Get() } - if o.State.IsSet() { - toSerialize["state"] = o.State.Get() - } - if o.JobType.IsSet() { - toSerialize["job_type"] = o.JobType.Get() - } - if o.StartDate.IsSet() { - toSerialize["start_date"] = o.StartDate.Get() - } if o.EndDate.IsSet() { toSerialize["end_date"] = o.EndDate.Get() } - if o.LatestHeartbeat.IsSet() { - toSerialize["latest_heartbeat"] = o.LatestHeartbeat.Get() - } if o.ExecutorClass.IsSet() { toSerialize["executor_class"] = o.ExecutorClass.Get() } if o.Hostname.IsSet() { toSerialize["hostname"] = o.Hostname.Get() } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if o.JobType.IsSet() { + toSerialize["job_type"] = o.JobType.Get() + } + if o.LatestHeartbeat.IsSet() { + toSerialize["latest_heartbeat"] = o.LatestHeartbeat.Get() + } + if o.StartDate.IsSet() { + toSerialize["start_date"] = o.StartDate.Get() + } + if o.State.IsSet() { + toSerialize["state"] = o.State.Get() + } if o.Unixname.IsSet() { toSerialize["unixname"] = o.Unixname.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableJob struct { diff --git a/airflow/model_list_dag_runs_form.go b/airflow/model_list_dag_runs_form.go index 3ab0675..90ef821 100644 --- a/airflow/model_list_dag_runs_form.go +++ b/airflow/model_list_dag_runs_form.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -33,30 +16,33 @@ import ( "time" ) +// checks if the ListDagRunsForm type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListDagRunsForm{} + // ListDagRunsForm struct for ListDagRunsForm type ListDagRunsForm struct { - // The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* - OrderBy *string `json:"order_by,omitempty"` - // The number of items to skip before starting to collect the result set. - PageOffset *int32 `json:"page_offset,omitempty"` - // The numbers of items to return. - PageLimit *int32 `json:"page_limit,omitempty"` // Return objects with specific DAG IDs. The value can be repeated to retrieve multiple matching values (OR condition). - DagIds *[]string `json:"dag_ids,omitempty"` - // Return objects with specific states. The value can be repeated to retrieve multiple matching values (OR condition). - States *[]string `json:"states,omitempty"` + DagIds []string `json:"dag_ids,omitempty"` + // Returns objects greater or equal the specified date. This can be combined with end_date_lte parameter to receive only the selected period. + EndDateGte *time.Time `json:"end_date_gte,omitempty"` + // Returns objects less than or equal to the specified date. This can be combined with end_date_gte parameter to receive only the selected period. + EndDateLte *time.Time `json:"end_date_lte,omitempty"` // Returns objects greater or equal to the specified date. This can be combined with execution_date_lte key to receive only the selected period. ExecutionDateGte *time.Time `json:"execution_date_gte,omitempty"` // Returns objects less than or equal to the specified date. This can be combined with execution_date_gte key to receive only the selected period. ExecutionDateLte *time.Time `json:"execution_date_lte,omitempty"` + // The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.1.0* + OrderBy *string `json:"order_by,omitempty"` + // The numbers of items to return. + PageLimit *int32 `json:"page_limit,omitempty"` + // The number of items to skip before starting to collect the result set. + PageOffset *int32 `json:"page_offset,omitempty"` // Returns objects greater or equal the specified date. This can be combined with start_date_lte key to receive only the selected period. StartDateGte *time.Time `json:"start_date_gte,omitempty"` // Returns objects less or equal the specified date. This can be combined with start_date_gte parameter to receive only the selected period StartDateLte *time.Time `json:"start_date_lte,omitempty"` - // Returns objects greater or equal the specified date. This can be combined with end_date_lte parameter to receive only the selected period. - EndDateGte *time.Time `json:"end_date_gte,omitempty"` - // Returns objects less than or equal to the specified date. This can be combined with end_date_gte parameter to receive only the selected period. - EndDateLte *time.Time `json:"end_date_lte,omitempty"` + // Return objects with specific states. The value can be repeated to retrieve multiple matching values (OR condition). + States []string `json:"states,omitempty"` } // NewListDagRunsForm instantiates a new ListDagRunsForm object @@ -80,233 +66,265 @@ func NewListDagRunsFormWithDefaults() *ListDagRunsForm { return &this } -// GetOrderBy returns the OrderBy field value if set, zero value otherwise. -func (o *ListDagRunsForm) GetOrderBy() string { - if o == nil || o.OrderBy == nil { - var ret string +// GetDagIds returns the DagIds field value if set, zero value otherwise. +func (o *ListDagRunsForm) GetDagIds() []string { + if o == nil || IsNil(o.DagIds) { + var ret []string return ret } - return *o.OrderBy + return o.DagIds } -// GetOrderByOk returns a tuple with the OrderBy field value if set, nil otherwise +// GetDagIdsOk returns a tuple with the DagIds field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListDagRunsForm) GetOrderByOk() (*string, bool) { - if o == nil || o.OrderBy == nil { +func (o *ListDagRunsForm) GetDagIdsOk() ([]string, bool) { + if o == nil || IsNil(o.DagIds) { return nil, false } - return o.OrderBy, true + return o.DagIds, true } -// HasOrderBy returns a boolean if a field has been set. -func (o *ListDagRunsForm) HasOrderBy() bool { - if o != nil && o.OrderBy != nil { +// HasDagIds returns a boolean if a field has been set. +func (o *ListDagRunsForm) HasDagIds() bool { + if o != nil && !IsNil(o.DagIds) { return true } return false } -// SetOrderBy gets a reference to the given string and assigns it to the OrderBy field. -func (o *ListDagRunsForm) SetOrderBy(v string) { - o.OrderBy = &v +// SetDagIds gets a reference to the given []string and assigns it to the DagIds field. +func (o *ListDagRunsForm) SetDagIds(v []string) { + o.DagIds = v } -// GetPageOffset returns the PageOffset field value if set, zero value otherwise. -func (o *ListDagRunsForm) GetPageOffset() int32 { - if o == nil || o.PageOffset == nil { - var ret int32 +// GetEndDateGte returns the EndDateGte field value if set, zero value otherwise. +func (o *ListDagRunsForm) GetEndDateGte() time.Time { + if o == nil || IsNil(o.EndDateGte) { + var ret time.Time return ret } - return *o.PageOffset + return *o.EndDateGte } -// GetPageOffsetOk returns a tuple with the PageOffset field value if set, nil otherwise +// GetEndDateGteOk returns a tuple with the EndDateGte field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListDagRunsForm) GetPageOffsetOk() (*int32, bool) { - if o == nil || o.PageOffset == nil { +func (o *ListDagRunsForm) GetEndDateGteOk() (*time.Time, bool) { + if o == nil || IsNil(o.EndDateGte) { return nil, false } - return o.PageOffset, true + return o.EndDateGte, true } -// HasPageOffset returns a boolean if a field has been set. -func (o *ListDagRunsForm) HasPageOffset() bool { - if o != nil && o.PageOffset != nil { +// HasEndDateGte returns a boolean if a field has been set. +func (o *ListDagRunsForm) HasEndDateGte() bool { + if o != nil && !IsNil(o.EndDateGte) { return true } return false } -// SetPageOffset gets a reference to the given int32 and assigns it to the PageOffset field. -func (o *ListDagRunsForm) SetPageOffset(v int32) { - o.PageOffset = &v +// SetEndDateGte gets a reference to the given time.Time and assigns it to the EndDateGte field. +func (o *ListDagRunsForm) SetEndDateGte(v time.Time) { + o.EndDateGte = &v } -// GetPageLimit returns the PageLimit field value if set, zero value otherwise. -func (o *ListDagRunsForm) GetPageLimit() int32 { - if o == nil || o.PageLimit == nil { - var ret int32 +// GetEndDateLte returns the EndDateLte field value if set, zero value otherwise. +func (o *ListDagRunsForm) GetEndDateLte() time.Time { + if o == nil || IsNil(o.EndDateLte) { + var ret time.Time return ret } - return *o.PageLimit + return *o.EndDateLte } -// GetPageLimitOk returns a tuple with the PageLimit field value if set, nil otherwise +// GetEndDateLteOk returns a tuple with the EndDateLte field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListDagRunsForm) GetPageLimitOk() (*int32, bool) { - if o == nil || o.PageLimit == nil { +func (o *ListDagRunsForm) GetEndDateLteOk() (*time.Time, bool) { + if o == nil || IsNil(o.EndDateLte) { return nil, false } - return o.PageLimit, true + return o.EndDateLte, true } -// HasPageLimit returns a boolean if a field has been set. -func (o *ListDagRunsForm) HasPageLimit() bool { - if o != nil && o.PageLimit != nil { +// HasEndDateLte returns a boolean if a field has been set. +func (o *ListDagRunsForm) HasEndDateLte() bool { + if o != nil && !IsNil(o.EndDateLte) { return true } return false } -// SetPageLimit gets a reference to the given int32 and assigns it to the PageLimit field. -func (o *ListDagRunsForm) SetPageLimit(v int32) { - o.PageLimit = &v +// SetEndDateLte gets a reference to the given time.Time and assigns it to the EndDateLte field. +func (o *ListDagRunsForm) SetEndDateLte(v time.Time) { + o.EndDateLte = &v } -// GetDagIds returns the DagIds field value if set, zero value otherwise. -func (o *ListDagRunsForm) GetDagIds() []string { - if o == nil || o.DagIds == nil { - var ret []string +// GetExecutionDateGte returns the ExecutionDateGte field value if set, zero value otherwise. +func (o *ListDagRunsForm) GetExecutionDateGte() time.Time { + if o == nil || IsNil(o.ExecutionDateGte) { + var ret time.Time return ret } - return *o.DagIds + return *o.ExecutionDateGte } -// GetDagIdsOk returns a tuple with the DagIds field value if set, nil otherwise +// GetExecutionDateGteOk returns a tuple with the ExecutionDateGte field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListDagRunsForm) GetDagIdsOk() (*[]string, bool) { - if o == nil || o.DagIds == nil { +func (o *ListDagRunsForm) GetExecutionDateGteOk() (*time.Time, bool) { + if o == nil || IsNil(o.ExecutionDateGte) { return nil, false } - return o.DagIds, true + return o.ExecutionDateGte, true } -// HasDagIds returns a boolean if a field has been set. -func (o *ListDagRunsForm) HasDagIds() bool { - if o != nil && o.DagIds != nil { +// HasExecutionDateGte returns a boolean if a field has been set. +func (o *ListDagRunsForm) HasExecutionDateGte() bool { + if o != nil && !IsNil(o.ExecutionDateGte) { return true } return false } -// SetDagIds gets a reference to the given []string and assigns it to the DagIds field. -func (o *ListDagRunsForm) SetDagIds(v []string) { - o.DagIds = &v +// SetExecutionDateGte gets a reference to the given time.Time and assigns it to the ExecutionDateGte field. +func (o *ListDagRunsForm) SetExecutionDateGte(v time.Time) { + o.ExecutionDateGte = &v } -// GetStates returns the States field value if set, zero value otherwise. -func (o *ListDagRunsForm) GetStates() []string { - if o == nil || o.States == nil { - var ret []string +// GetExecutionDateLte returns the ExecutionDateLte field value if set, zero value otherwise. +func (o *ListDagRunsForm) GetExecutionDateLte() time.Time { + if o == nil || IsNil(o.ExecutionDateLte) { + var ret time.Time return ret } - return *o.States + return *o.ExecutionDateLte } -// GetStatesOk returns a tuple with the States field value if set, nil otherwise +// GetExecutionDateLteOk returns a tuple with the ExecutionDateLte field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListDagRunsForm) GetStatesOk() (*[]string, bool) { - if o == nil || o.States == nil { +func (o *ListDagRunsForm) GetExecutionDateLteOk() (*time.Time, bool) { + if o == nil || IsNil(o.ExecutionDateLte) { return nil, false } - return o.States, true + return o.ExecutionDateLte, true } -// HasStates returns a boolean if a field has been set. -func (o *ListDagRunsForm) HasStates() bool { - if o != nil && o.States != nil { +// HasExecutionDateLte returns a boolean if a field has been set. +func (o *ListDagRunsForm) HasExecutionDateLte() bool { + if o != nil && !IsNil(o.ExecutionDateLte) { return true } return false } -// SetStates gets a reference to the given []string and assigns it to the States field. -func (o *ListDagRunsForm) SetStates(v []string) { - o.States = &v +// SetExecutionDateLte gets a reference to the given time.Time and assigns it to the ExecutionDateLte field. +func (o *ListDagRunsForm) SetExecutionDateLte(v time.Time) { + o.ExecutionDateLte = &v } -// GetExecutionDateGte returns the ExecutionDateGte field value if set, zero value otherwise. -func (o *ListDagRunsForm) GetExecutionDateGte() time.Time { - if o == nil || o.ExecutionDateGte == nil { - var ret time.Time +// GetOrderBy returns the OrderBy field value if set, zero value otherwise. +func (o *ListDagRunsForm) GetOrderBy() string { + if o == nil || IsNil(o.OrderBy) { + var ret string return ret } - return *o.ExecutionDateGte + return *o.OrderBy } -// GetExecutionDateGteOk returns a tuple with the ExecutionDateGte field value if set, nil otherwise +// GetOrderByOk returns a tuple with the OrderBy field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListDagRunsForm) GetExecutionDateGteOk() (*time.Time, bool) { - if o == nil || o.ExecutionDateGte == nil { +func (o *ListDagRunsForm) GetOrderByOk() (*string, bool) { + if o == nil || IsNil(o.OrderBy) { return nil, false } - return o.ExecutionDateGte, true + return o.OrderBy, true } -// HasExecutionDateGte returns a boolean if a field has been set. -func (o *ListDagRunsForm) HasExecutionDateGte() bool { - if o != nil && o.ExecutionDateGte != nil { +// HasOrderBy returns a boolean if a field has been set. +func (o *ListDagRunsForm) HasOrderBy() bool { + if o != nil && !IsNil(o.OrderBy) { return true } return false } -// SetExecutionDateGte gets a reference to the given time.Time and assigns it to the ExecutionDateGte field. -func (o *ListDagRunsForm) SetExecutionDateGte(v time.Time) { - o.ExecutionDateGte = &v +// SetOrderBy gets a reference to the given string and assigns it to the OrderBy field. +func (o *ListDagRunsForm) SetOrderBy(v string) { + o.OrderBy = &v } -// GetExecutionDateLte returns the ExecutionDateLte field value if set, zero value otherwise. -func (o *ListDagRunsForm) GetExecutionDateLte() time.Time { - if o == nil || o.ExecutionDateLte == nil { - var ret time.Time +// GetPageLimit returns the PageLimit field value if set, zero value otherwise. +func (o *ListDagRunsForm) GetPageLimit() int32 { + if o == nil || IsNil(o.PageLimit) { + var ret int32 return ret } - return *o.ExecutionDateLte + return *o.PageLimit } -// GetExecutionDateLteOk returns a tuple with the ExecutionDateLte field value if set, nil otherwise +// GetPageLimitOk returns a tuple with the PageLimit field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListDagRunsForm) GetExecutionDateLteOk() (*time.Time, bool) { - if o == nil || o.ExecutionDateLte == nil { +func (o *ListDagRunsForm) GetPageLimitOk() (*int32, bool) { + if o == nil || IsNil(o.PageLimit) { return nil, false } - return o.ExecutionDateLte, true + return o.PageLimit, true } -// HasExecutionDateLte returns a boolean if a field has been set. -func (o *ListDagRunsForm) HasExecutionDateLte() bool { - if o != nil && o.ExecutionDateLte != nil { +// HasPageLimit returns a boolean if a field has been set. +func (o *ListDagRunsForm) HasPageLimit() bool { + if o != nil && !IsNil(o.PageLimit) { return true } return false } -// SetExecutionDateLte gets a reference to the given time.Time and assigns it to the ExecutionDateLte field. -func (o *ListDagRunsForm) SetExecutionDateLte(v time.Time) { - o.ExecutionDateLte = &v +// SetPageLimit gets a reference to the given int32 and assigns it to the PageLimit field. +func (o *ListDagRunsForm) SetPageLimit(v int32) { + o.PageLimit = &v +} + +// GetPageOffset returns the PageOffset field value if set, zero value otherwise. +func (o *ListDagRunsForm) GetPageOffset() int32 { + if o == nil || IsNil(o.PageOffset) { + var ret int32 + return ret + } + return *o.PageOffset +} + +// GetPageOffsetOk returns a tuple with the PageOffset field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListDagRunsForm) GetPageOffsetOk() (*int32, bool) { + if o == nil || IsNil(o.PageOffset) { + return nil, false + } + return o.PageOffset, true +} + +// HasPageOffset returns a boolean if a field has been set. +func (o *ListDagRunsForm) HasPageOffset() bool { + if o != nil && !IsNil(o.PageOffset) { + return true + } + + return false +} + +// SetPageOffset gets a reference to the given int32 and assigns it to the PageOffset field. +func (o *ListDagRunsForm) SetPageOffset(v int32) { + o.PageOffset = &v } // GetStartDateGte returns the StartDateGte field value if set, zero value otherwise. func (o *ListDagRunsForm) GetStartDateGte() time.Time { - if o == nil || o.StartDateGte == nil { + if o == nil || IsNil(o.StartDateGte) { var ret time.Time return ret } @@ -316,7 +334,7 @@ func (o *ListDagRunsForm) GetStartDateGte() time.Time { // GetStartDateGteOk returns a tuple with the StartDateGte field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ListDagRunsForm) GetStartDateGteOk() (*time.Time, bool) { - if o == nil || o.StartDateGte == nil { + if o == nil || IsNil(o.StartDateGte) { return nil, false } return o.StartDateGte, true @@ -324,7 +342,7 @@ func (o *ListDagRunsForm) GetStartDateGteOk() (*time.Time, bool) { // HasStartDateGte returns a boolean if a field has been set. func (o *ListDagRunsForm) HasStartDateGte() bool { - if o != nil && o.StartDateGte != nil { + if o != nil && !IsNil(o.StartDateGte) { return true } @@ -338,7 +356,7 @@ func (o *ListDagRunsForm) SetStartDateGte(v time.Time) { // GetStartDateLte returns the StartDateLte field value if set, zero value otherwise. func (o *ListDagRunsForm) GetStartDateLte() time.Time { - if o == nil || o.StartDateLte == nil { + if o == nil || IsNil(o.StartDateLte) { var ret time.Time return ret } @@ -348,7 +366,7 @@ func (o *ListDagRunsForm) GetStartDateLte() time.Time { // GetStartDateLteOk returns a tuple with the StartDateLte field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ListDagRunsForm) GetStartDateLteOk() (*time.Time, bool) { - if o == nil || o.StartDateLte == nil { + if o == nil || IsNil(o.StartDateLte) { return nil, false } return o.StartDateLte, true @@ -356,7 +374,7 @@ func (o *ListDagRunsForm) GetStartDateLteOk() (*time.Time, bool) { // HasStartDateLte returns a boolean if a field has been set. func (o *ListDagRunsForm) HasStartDateLte() bool { - if o != nil && o.StartDateLte != nil { + if o != nil && !IsNil(o.StartDateLte) { return true } @@ -368,106 +386,82 @@ func (o *ListDagRunsForm) SetStartDateLte(v time.Time) { o.StartDateLte = &v } -// GetEndDateGte returns the EndDateGte field value if set, zero value otherwise. -func (o *ListDagRunsForm) GetEndDateGte() time.Time { - if o == nil || o.EndDateGte == nil { - var ret time.Time +// GetStates returns the States field value if set, zero value otherwise. +func (o *ListDagRunsForm) GetStates() []string { + if o == nil || IsNil(o.States) { + var ret []string return ret } - return *o.EndDateGte + return o.States } -// GetEndDateGteOk returns a tuple with the EndDateGte field value if set, nil otherwise +// GetStatesOk returns a tuple with the States field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListDagRunsForm) GetEndDateGteOk() (*time.Time, bool) { - if o == nil || o.EndDateGte == nil { +func (o *ListDagRunsForm) GetStatesOk() ([]string, bool) { + if o == nil || IsNil(o.States) { return nil, false } - return o.EndDateGte, true + return o.States, true } -// HasEndDateGte returns a boolean if a field has been set. -func (o *ListDagRunsForm) HasEndDateGte() bool { - if o != nil && o.EndDateGte != nil { +// HasStates returns a boolean if a field has been set. +func (o *ListDagRunsForm) HasStates() bool { + if o != nil && !IsNil(o.States) { return true } return false } -// SetEndDateGte gets a reference to the given time.Time and assigns it to the EndDateGte field. -func (o *ListDagRunsForm) SetEndDateGte(v time.Time) { - o.EndDateGte = &v -} - -// GetEndDateLte returns the EndDateLte field value if set, zero value otherwise. -func (o *ListDagRunsForm) GetEndDateLte() time.Time { - if o == nil || o.EndDateLte == nil { - var ret time.Time - return ret - } - return *o.EndDateLte -} - -// GetEndDateLteOk returns a tuple with the EndDateLte field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListDagRunsForm) GetEndDateLteOk() (*time.Time, bool) { - if o == nil || o.EndDateLte == nil { - return nil, false - } - return o.EndDateLte, true +// SetStates gets a reference to the given []string and assigns it to the States field. +func (o *ListDagRunsForm) SetStates(v []string) { + o.States = v } -// HasEndDateLte returns a boolean if a field has been set. -func (o *ListDagRunsForm) HasEndDateLte() bool { - if o != nil && o.EndDateLte != nil { - return true +func (o ListDagRunsForm) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - - return false -} - -// SetEndDateLte gets a reference to the given time.Time and assigns it to the EndDateLte field. -func (o *ListDagRunsForm) SetEndDateLte(v time.Time) { - o.EndDateLte = &v + return json.Marshal(toSerialize) } -func (o ListDagRunsForm) MarshalJSON() ([]byte, error) { +func (o ListDagRunsForm) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.OrderBy != nil { - toSerialize["order_by"] = o.OrderBy - } - if o.PageOffset != nil { - toSerialize["page_offset"] = o.PageOffset - } - if o.PageLimit != nil { - toSerialize["page_limit"] = o.PageLimit - } - if o.DagIds != nil { + if !IsNil(o.DagIds) { toSerialize["dag_ids"] = o.DagIds } - if o.States != nil { - toSerialize["states"] = o.States + if !IsNil(o.EndDateGte) { + toSerialize["end_date_gte"] = o.EndDateGte } - if o.ExecutionDateGte != nil { + if !IsNil(o.EndDateLte) { + toSerialize["end_date_lte"] = o.EndDateLte + } + if !IsNil(o.ExecutionDateGte) { toSerialize["execution_date_gte"] = o.ExecutionDateGte } - if o.ExecutionDateLte != nil { + if !IsNil(o.ExecutionDateLte) { toSerialize["execution_date_lte"] = o.ExecutionDateLte } - if o.StartDateGte != nil { + if !IsNil(o.OrderBy) { + toSerialize["order_by"] = o.OrderBy + } + if !IsNil(o.PageLimit) { + toSerialize["page_limit"] = o.PageLimit + } + if !IsNil(o.PageOffset) { + toSerialize["page_offset"] = o.PageOffset + } + if !IsNil(o.StartDateGte) { toSerialize["start_date_gte"] = o.StartDateGte } - if o.StartDateLte != nil { + if !IsNil(o.StartDateLte) { toSerialize["start_date_lte"] = o.StartDateLte } - if o.EndDateGte != nil { - toSerialize["end_date_gte"] = o.EndDateGte - } - if o.EndDateLte != nil { - toSerialize["end_date_lte"] = o.EndDateLte + if !IsNil(o.States) { + toSerialize["states"] = o.States } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableListDagRunsForm struct { diff --git a/airflow/model_list_task_instance_form.go b/airflow/model_list_task_instance_form.go index 01211d7..3194206 100644 --- a/airflow/model_list_task_instance_form.go +++ b/airflow/model_list_task_instance_form.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -33,32 +16,45 @@ import ( "time" ) +// checks if the ListTaskInstanceForm type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListTaskInstanceForm{} + // ListTaskInstanceForm struct for ListTaskInstanceForm type ListTaskInstanceForm struct { // Return objects with specific DAG IDs. The value can be repeated to retrieve multiple matching values (OR condition). - DagIds *[]string `json:"dag_ids,omitempty"` + DagIds []string `json:"dag_ids,omitempty"` + // Return objects with specific DAG Run IDs. The value can be repeated to retrieve multiple matching values (OR condition). *New in version 2.7.1* + DagRunIds []string `json:"dag_run_ids,omitempty"` + // Returns objects greater than or equal to the specified values. This can be combined with duration_lte parameter to receive only the selected period. + DurationGte *float32 `json:"duration_gte,omitempty"` + // Returns objects less than or equal to the specified values. This can be combined with duration_gte parameter to receive only the selected range. + DurationLte *float32 `json:"duration_lte,omitempty"` + // Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. + EndDateGte *time.Time `json:"end_date_gte,omitempty"` + // Returns objects less than or equal to the specified date. This can be combined with start_date_gte parameter to receive only the selected period. + EndDateLte *time.Time `json:"end_date_lte,omitempty"` // Returns objects greater or equal to the specified date. This can be combined with execution_date_lte parameter to receive only the selected period. ExecutionDateGte *time.Time `json:"execution_date_gte,omitempty"` // Returns objects less than or equal to the specified date. This can be combined with execution_date_gte parameter to receive only the selected period. ExecutionDateLte *time.Time `json:"execution_date_lte,omitempty"` + // The value can be repeated to retrieve multiple matching values (OR condition). + Executor []string `json:"executor,omitempty"` + // The numbers of items to return. + PageLimit *int32 `json:"page_limit,omitempty"` + // The number of items to skip before starting to collect the result set. + PageOffset *int32 `json:"page_offset,omitempty"` + // The value can be repeated to retrieve multiple matching values (OR condition). + Pool []string `json:"pool,omitempty"` + // The value can be repeated to retrieve multiple matching values (OR condition). + Queue []string `json:"queue,omitempty"` // Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. StartDateGte *time.Time `json:"start_date_gte,omitempty"` // Returns objects less or equal the specified date. This can be combined with start_date_gte parameter to receive only the selected period. StartDateLte *time.Time `json:"start_date_lte,omitempty"` - // Returns objects greater or equal the specified date. This can be combined with start_date_lte parameter to receive only the selected period. - EndDateGte *time.Time `json:"end_date_gte,omitempty"` - // Returns objects less than or equal to the specified date. This can be combined with start_date_gte parameter to receive only the selected period. - EndDateLte *time.Time `json:"end_date_lte,omitempty"` - // Returns objects greater than or equal to the specified values. This can be combined with duration_lte parameter to receive only the selected period. - DurationGte *float32 `json:"duration_gte,omitempty"` - // Returns objects less than or equal to the specified values. This can be combined with duration_gte parameter to receive only the selected range. - DurationLte *float32 `json:"duration_lte,omitempty"` // The value can be repeated to retrieve multiple matching values (OR condition). - State *[]TaskState `json:"state,omitempty"` - // The value can be repeated to retrieve multiple matching values (OR condition). - Pool *[]string `json:"pool,omitempty"` - // The value can be repeated to retrieve multiple matching values (OR condition). - Queue *[]string `json:"queue,omitempty"` + State []TaskState `json:"state,omitempty"` + // Return objects with specific task IDs. The value can be repeated to retrieve multiple matching values (OR condition). *New in version 2.7.1* + TaskIds []string `json:"task_ids,omitempty"` } // NewListTaskInstanceForm instantiates a new ListTaskInstanceForm object @@ -67,6 +63,8 @@ type ListTaskInstanceForm struct { // will change when the set of required properties is changed func NewListTaskInstanceForm() *ListTaskInstanceForm { this := ListTaskInstanceForm{} + var pageLimit int32 = 100 + this.PageLimit = &pageLimit return &this } @@ -75,22 +73,24 @@ func NewListTaskInstanceForm() *ListTaskInstanceForm { // but it doesn't guarantee that properties required by API are set func NewListTaskInstanceFormWithDefaults() *ListTaskInstanceForm { this := ListTaskInstanceForm{} + var pageLimit int32 = 100 + this.PageLimit = &pageLimit return &this } // GetDagIds returns the DagIds field value if set, zero value otherwise. func (o *ListTaskInstanceForm) GetDagIds() []string { - if o == nil || o.DagIds == nil { + if o == nil || IsNil(o.DagIds) { var ret []string return ret } - return *o.DagIds + return o.DagIds } // GetDagIdsOk returns a tuple with the DagIds field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListTaskInstanceForm) GetDagIdsOk() (*[]string, bool) { - if o == nil || o.DagIds == nil { +func (o *ListTaskInstanceForm) GetDagIdsOk() ([]string, bool) { + if o == nil || IsNil(o.DagIds) { return nil, false } return o.DagIds, true @@ -98,7 +98,7 @@ func (o *ListTaskInstanceForm) GetDagIdsOk() (*[]string, bool) { // HasDagIds returns a boolean if a field has been set. func (o *ListTaskInstanceForm) HasDagIds() bool { - if o != nil && o.DagIds != nil { + if o != nil && !IsNil(o.DagIds) { return true } @@ -107,140 +107,108 @@ func (o *ListTaskInstanceForm) HasDagIds() bool { // SetDagIds gets a reference to the given []string and assigns it to the DagIds field. func (o *ListTaskInstanceForm) SetDagIds(v []string) { - o.DagIds = &v -} - -// GetExecutionDateGte returns the ExecutionDateGte field value if set, zero value otherwise. -func (o *ListTaskInstanceForm) GetExecutionDateGte() time.Time { - if o == nil || o.ExecutionDateGte == nil { - var ret time.Time - return ret - } - return *o.ExecutionDateGte -} - -// GetExecutionDateGteOk returns a tuple with the ExecutionDateGte field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ListTaskInstanceForm) GetExecutionDateGteOk() (*time.Time, bool) { - if o == nil || o.ExecutionDateGte == nil { - return nil, false - } - return o.ExecutionDateGte, true -} - -// HasExecutionDateGte returns a boolean if a field has been set. -func (o *ListTaskInstanceForm) HasExecutionDateGte() bool { - if o != nil && o.ExecutionDateGte != nil { - return true - } - - return false + o.DagIds = v } -// SetExecutionDateGte gets a reference to the given time.Time and assigns it to the ExecutionDateGte field. -func (o *ListTaskInstanceForm) SetExecutionDateGte(v time.Time) { - o.ExecutionDateGte = &v -} - -// GetExecutionDateLte returns the ExecutionDateLte field value if set, zero value otherwise. -func (o *ListTaskInstanceForm) GetExecutionDateLte() time.Time { - if o == nil || o.ExecutionDateLte == nil { - var ret time.Time +// GetDagRunIds returns the DagRunIds field value if set, zero value otherwise. +func (o *ListTaskInstanceForm) GetDagRunIds() []string { + if o == nil || IsNil(o.DagRunIds) { + var ret []string return ret } - return *o.ExecutionDateLte + return o.DagRunIds } -// GetExecutionDateLteOk returns a tuple with the ExecutionDateLte field value if set, nil otherwise +// GetDagRunIdsOk returns a tuple with the DagRunIds field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListTaskInstanceForm) GetExecutionDateLteOk() (*time.Time, bool) { - if o == nil || o.ExecutionDateLte == nil { +func (o *ListTaskInstanceForm) GetDagRunIdsOk() ([]string, bool) { + if o == nil || IsNil(o.DagRunIds) { return nil, false } - return o.ExecutionDateLte, true + return o.DagRunIds, true } -// HasExecutionDateLte returns a boolean if a field has been set. -func (o *ListTaskInstanceForm) HasExecutionDateLte() bool { - if o != nil && o.ExecutionDateLte != nil { +// HasDagRunIds returns a boolean if a field has been set. +func (o *ListTaskInstanceForm) HasDagRunIds() bool { + if o != nil && !IsNil(o.DagRunIds) { return true } return false } -// SetExecutionDateLte gets a reference to the given time.Time and assigns it to the ExecutionDateLte field. -func (o *ListTaskInstanceForm) SetExecutionDateLte(v time.Time) { - o.ExecutionDateLte = &v +// SetDagRunIds gets a reference to the given []string and assigns it to the DagRunIds field. +func (o *ListTaskInstanceForm) SetDagRunIds(v []string) { + o.DagRunIds = v } -// GetStartDateGte returns the StartDateGte field value if set, zero value otherwise. -func (o *ListTaskInstanceForm) GetStartDateGte() time.Time { - if o == nil || o.StartDateGte == nil { - var ret time.Time +// GetDurationGte returns the DurationGte field value if set, zero value otherwise. +func (o *ListTaskInstanceForm) GetDurationGte() float32 { + if o == nil || IsNil(o.DurationGte) { + var ret float32 return ret } - return *o.StartDateGte + return *o.DurationGte } -// GetStartDateGteOk returns a tuple with the StartDateGte field value if set, nil otherwise +// GetDurationGteOk returns a tuple with the DurationGte field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListTaskInstanceForm) GetStartDateGteOk() (*time.Time, bool) { - if o == nil || o.StartDateGte == nil { +func (o *ListTaskInstanceForm) GetDurationGteOk() (*float32, bool) { + if o == nil || IsNil(o.DurationGte) { return nil, false } - return o.StartDateGte, true + return o.DurationGte, true } -// HasStartDateGte returns a boolean if a field has been set. -func (o *ListTaskInstanceForm) HasStartDateGte() bool { - if o != nil && o.StartDateGte != nil { +// HasDurationGte returns a boolean if a field has been set. +func (o *ListTaskInstanceForm) HasDurationGte() bool { + if o != nil && !IsNil(o.DurationGte) { return true } return false } -// SetStartDateGte gets a reference to the given time.Time and assigns it to the StartDateGte field. -func (o *ListTaskInstanceForm) SetStartDateGte(v time.Time) { - o.StartDateGte = &v +// SetDurationGte gets a reference to the given float32 and assigns it to the DurationGte field. +func (o *ListTaskInstanceForm) SetDurationGte(v float32) { + o.DurationGte = &v } -// GetStartDateLte returns the StartDateLte field value if set, zero value otherwise. -func (o *ListTaskInstanceForm) GetStartDateLte() time.Time { - if o == nil || o.StartDateLte == nil { - var ret time.Time +// GetDurationLte returns the DurationLte field value if set, zero value otherwise. +func (o *ListTaskInstanceForm) GetDurationLte() float32 { + if o == nil || IsNil(o.DurationLte) { + var ret float32 return ret } - return *o.StartDateLte + return *o.DurationLte } -// GetStartDateLteOk returns a tuple with the StartDateLte field value if set, nil otherwise +// GetDurationLteOk returns a tuple with the DurationLte field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListTaskInstanceForm) GetStartDateLteOk() (*time.Time, bool) { - if o == nil || o.StartDateLte == nil { +func (o *ListTaskInstanceForm) GetDurationLteOk() (*float32, bool) { + if o == nil || IsNil(o.DurationLte) { return nil, false } - return o.StartDateLte, true + return o.DurationLte, true } -// HasStartDateLte returns a boolean if a field has been set. -func (o *ListTaskInstanceForm) HasStartDateLte() bool { - if o != nil && o.StartDateLte != nil { +// HasDurationLte returns a boolean if a field has been set. +func (o *ListTaskInstanceForm) HasDurationLte() bool { + if o != nil && !IsNil(o.DurationLte) { return true } return false } -// SetStartDateLte gets a reference to the given time.Time and assigns it to the StartDateLte field. -func (o *ListTaskInstanceForm) SetStartDateLte(v time.Time) { - o.StartDateLte = &v +// SetDurationLte gets a reference to the given float32 and assigns it to the DurationLte field. +func (o *ListTaskInstanceForm) SetDurationLte(v float32) { + o.DurationLte = &v } // GetEndDateGte returns the EndDateGte field value if set, zero value otherwise. func (o *ListTaskInstanceForm) GetEndDateGte() time.Time { - if o == nil || o.EndDateGte == nil { + if o == nil || IsNil(o.EndDateGte) { var ret time.Time return ret } @@ -250,7 +218,7 @@ func (o *ListTaskInstanceForm) GetEndDateGte() time.Time { // GetEndDateGteOk returns a tuple with the EndDateGte field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ListTaskInstanceForm) GetEndDateGteOk() (*time.Time, bool) { - if o == nil || o.EndDateGte == nil { + if o == nil || IsNil(o.EndDateGte) { return nil, false } return o.EndDateGte, true @@ -258,7 +226,7 @@ func (o *ListTaskInstanceForm) GetEndDateGteOk() (*time.Time, bool) { // HasEndDateGte returns a boolean if a field has been set. func (o *ListTaskInstanceForm) HasEndDateGte() bool { - if o != nil && o.EndDateGte != nil { + if o != nil && !IsNil(o.EndDateGte) { return true } @@ -272,7 +240,7 @@ func (o *ListTaskInstanceForm) SetEndDateGte(v time.Time) { // GetEndDateLte returns the EndDateLte field value if set, zero value otherwise. func (o *ListTaskInstanceForm) GetEndDateLte() time.Time { - if o == nil || o.EndDateLte == nil { + if o == nil || IsNil(o.EndDateLte) { var ret time.Time return ret } @@ -282,7 +250,7 @@ func (o *ListTaskInstanceForm) GetEndDateLte() time.Time { // GetEndDateLteOk returns a tuple with the EndDateLte field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ListTaskInstanceForm) GetEndDateLteOk() (*time.Time, bool) { - if o == nil || o.EndDateLte == nil { + if o == nil || IsNil(o.EndDateLte) { return nil, false } return o.EndDateLte, true @@ -290,7 +258,7 @@ func (o *ListTaskInstanceForm) GetEndDateLteOk() (*time.Time, bool) { // HasEndDateLte returns a boolean if a field has been set. func (o *ListTaskInstanceForm) HasEndDateLte() bool { - if o != nil && o.EndDateLte != nil { + if o != nil && !IsNil(o.EndDateLte) { return true } @@ -302,115 +270,179 @@ func (o *ListTaskInstanceForm) SetEndDateLte(v time.Time) { o.EndDateLte = &v } -// GetDurationGte returns the DurationGte field value if set, zero value otherwise. -func (o *ListTaskInstanceForm) GetDurationGte() float32 { - if o == nil || o.DurationGte == nil { - var ret float32 +// GetExecutionDateGte returns the ExecutionDateGte field value if set, zero value otherwise. +func (o *ListTaskInstanceForm) GetExecutionDateGte() time.Time { + if o == nil || IsNil(o.ExecutionDateGte) { + var ret time.Time return ret } - return *o.DurationGte + return *o.ExecutionDateGte } -// GetDurationGteOk returns a tuple with the DurationGte field value if set, nil otherwise +// GetExecutionDateGteOk returns a tuple with the ExecutionDateGte field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListTaskInstanceForm) GetDurationGteOk() (*float32, bool) { - if o == nil || o.DurationGte == nil { +func (o *ListTaskInstanceForm) GetExecutionDateGteOk() (*time.Time, bool) { + if o == nil || IsNil(o.ExecutionDateGte) { return nil, false } - return o.DurationGte, true + return o.ExecutionDateGte, true } -// HasDurationGte returns a boolean if a field has been set. -func (o *ListTaskInstanceForm) HasDurationGte() bool { - if o != nil && o.DurationGte != nil { +// HasExecutionDateGte returns a boolean if a field has been set. +func (o *ListTaskInstanceForm) HasExecutionDateGte() bool { + if o != nil && !IsNil(o.ExecutionDateGte) { return true } return false } -// SetDurationGte gets a reference to the given float32 and assigns it to the DurationGte field. -func (o *ListTaskInstanceForm) SetDurationGte(v float32) { - o.DurationGte = &v +// SetExecutionDateGte gets a reference to the given time.Time and assigns it to the ExecutionDateGte field. +func (o *ListTaskInstanceForm) SetExecutionDateGte(v time.Time) { + o.ExecutionDateGte = &v } -// GetDurationLte returns the DurationLte field value if set, zero value otherwise. -func (o *ListTaskInstanceForm) GetDurationLte() float32 { - if o == nil || o.DurationLte == nil { - var ret float32 +// GetExecutionDateLte returns the ExecutionDateLte field value if set, zero value otherwise. +func (o *ListTaskInstanceForm) GetExecutionDateLte() time.Time { + if o == nil || IsNil(o.ExecutionDateLte) { + var ret time.Time return ret } - return *o.DurationLte + return *o.ExecutionDateLte } -// GetDurationLteOk returns a tuple with the DurationLte field value if set, nil otherwise +// GetExecutionDateLteOk returns a tuple with the ExecutionDateLte field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListTaskInstanceForm) GetDurationLteOk() (*float32, bool) { - if o == nil || o.DurationLte == nil { +func (o *ListTaskInstanceForm) GetExecutionDateLteOk() (*time.Time, bool) { + if o == nil || IsNil(o.ExecutionDateLte) { return nil, false } - return o.DurationLte, true + return o.ExecutionDateLte, true } -// HasDurationLte returns a boolean if a field has been set. -func (o *ListTaskInstanceForm) HasDurationLte() bool { - if o != nil && o.DurationLte != nil { +// HasExecutionDateLte returns a boolean if a field has been set. +func (o *ListTaskInstanceForm) HasExecutionDateLte() bool { + if o != nil && !IsNil(o.ExecutionDateLte) { return true } return false } -// SetDurationLte gets a reference to the given float32 and assigns it to the DurationLte field. -func (o *ListTaskInstanceForm) SetDurationLte(v float32) { - o.DurationLte = &v +// SetExecutionDateLte gets a reference to the given time.Time and assigns it to the ExecutionDateLte field. +func (o *ListTaskInstanceForm) SetExecutionDateLte(v time.Time) { + o.ExecutionDateLte = &v } -// GetState returns the State field value if set, zero value otherwise. -func (o *ListTaskInstanceForm) GetState() []TaskState { - if o == nil || o.State == nil { - var ret []TaskState +// GetExecutor returns the Executor field value if set, zero value otherwise. +func (o *ListTaskInstanceForm) GetExecutor() []string { + if o == nil || IsNil(o.Executor) { + var ret []string return ret } - return *o.State + return o.Executor } -// GetStateOk returns a tuple with the State field value if set, nil otherwise +// GetExecutorOk returns a tuple with the Executor field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListTaskInstanceForm) GetStateOk() (*[]TaskState, bool) { - if o == nil || o.State == nil { +func (o *ListTaskInstanceForm) GetExecutorOk() ([]string, bool) { + if o == nil || IsNil(o.Executor) { return nil, false } - return o.State, true + return o.Executor, true } -// HasState returns a boolean if a field has been set. -func (o *ListTaskInstanceForm) HasState() bool { - if o != nil && o.State != nil { +// HasExecutor returns a boolean if a field has been set. +func (o *ListTaskInstanceForm) HasExecutor() bool { + if o != nil && !IsNil(o.Executor) { return true } return false } -// SetState gets a reference to the given []TaskState and assigns it to the State field. -func (o *ListTaskInstanceForm) SetState(v []TaskState) { - o.State = &v +// SetExecutor gets a reference to the given []string and assigns it to the Executor field. +func (o *ListTaskInstanceForm) SetExecutor(v []string) { + o.Executor = v +} + +// GetPageLimit returns the PageLimit field value if set, zero value otherwise. +func (o *ListTaskInstanceForm) GetPageLimit() int32 { + if o == nil || IsNil(o.PageLimit) { + var ret int32 + return ret + } + return *o.PageLimit +} + +// GetPageLimitOk returns a tuple with the PageLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListTaskInstanceForm) GetPageLimitOk() (*int32, bool) { + if o == nil || IsNil(o.PageLimit) { + return nil, false + } + return o.PageLimit, true +} + +// HasPageLimit returns a boolean if a field has been set. +func (o *ListTaskInstanceForm) HasPageLimit() bool { + if o != nil && !IsNil(o.PageLimit) { + return true + } + + return false +} + +// SetPageLimit gets a reference to the given int32 and assigns it to the PageLimit field. +func (o *ListTaskInstanceForm) SetPageLimit(v int32) { + o.PageLimit = &v +} + +// GetPageOffset returns the PageOffset field value if set, zero value otherwise. +func (o *ListTaskInstanceForm) GetPageOffset() int32 { + if o == nil || IsNil(o.PageOffset) { + var ret int32 + return ret + } + return *o.PageOffset +} + +// GetPageOffsetOk returns a tuple with the PageOffset field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListTaskInstanceForm) GetPageOffsetOk() (*int32, bool) { + if o == nil || IsNil(o.PageOffset) { + return nil, false + } + return o.PageOffset, true +} + +// HasPageOffset returns a boolean if a field has been set. +func (o *ListTaskInstanceForm) HasPageOffset() bool { + if o != nil && !IsNil(o.PageOffset) { + return true + } + + return false +} + +// SetPageOffset gets a reference to the given int32 and assigns it to the PageOffset field. +func (o *ListTaskInstanceForm) SetPageOffset(v int32) { + o.PageOffset = &v } // GetPool returns the Pool field value if set, zero value otherwise. func (o *ListTaskInstanceForm) GetPool() []string { - if o == nil || o.Pool == nil { + if o == nil || IsNil(o.Pool) { var ret []string return ret } - return *o.Pool + return o.Pool } // GetPoolOk returns a tuple with the Pool field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListTaskInstanceForm) GetPoolOk() (*[]string, bool) { - if o == nil || o.Pool == nil { +func (o *ListTaskInstanceForm) GetPoolOk() ([]string, bool) { + if o == nil || IsNil(o.Pool) { return nil, false } return o.Pool, true @@ -418,7 +450,7 @@ func (o *ListTaskInstanceForm) GetPoolOk() (*[]string, bool) { // HasPool returns a boolean if a field has been set. func (o *ListTaskInstanceForm) HasPool() bool { - if o != nil && o.Pool != nil { + if o != nil && !IsNil(o.Pool) { return true } @@ -427,22 +459,22 @@ func (o *ListTaskInstanceForm) HasPool() bool { // SetPool gets a reference to the given []string and assigns it to the Pool field. func (o *ListTaskInstanceForm) SetPool(v []string) { - o.Pool = &v + o.Pool = v } // GetQueue returns the Queue field value if set, zero value otherwise. func (o *ListTaskInstanceForm) GetQueue() []string { - if o == nil || o.Queue == nil { + if o == nil || IsNil(o.Queue) { var ret []string return ret } - return *o.Queue + return o.Queue } // GetQueueOk returns a tuple with the Queue field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListTaskInstanceForm) GetQueueOk() (*[]string, bool) { - if o == nil || o.Queue == nil { +func (o *ListTaskInstanceForm) GetQueueOk() ([]string, bool) { + if o == nil || IsNil(o.Queue) { return nil, false } return o.Queue, true @@ -450,7 +482,7 @@ func (o *ListTaskInstanceForm) GetQueueOk() (*[]string, bool) { // HasQueue returns a boolean if a field has been set. func (o *ListTaskInstanceForm) HasQueue() bool { - if o != nil && o.Queue != nil { + if o != nil && !IsNil(o.Queue) { return true } @@ -459,48 +491,199 @@ func (o *ListTaskInstanceForm) HasQueue() bool { // SetQueue gets a reference to the given []string and assigns it to the Queue field. func (o *ListTaskInstanceForm) SetQueue(v []string) { - o.Queue = &v + o.Queue = v +} + +// GetStartDateGte returns the StartDateGte field value if set, zero value otherwise. +func (o *ListTaskInstanceForm) GetStartDateGte() time.Time { + if o == nil || IsNil(o.StartDateGte) { + var ret time.Time + return ret + } + return *o.StartDateGte +} + +// GetStartDateGteOk returns a tuple with the StartDateGte field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListTaskInstanceForm) GetStartDateGteOk() (*time.Time, bool) { + if o == nil || IsNil(o.StartDateGte) { + return nil, false + } + return o.StartDateGte, true +} + +// HasStartDateGte returns a boolean if a field has been set. +func (o *ListTaskInstanceForm) HasStartDateGte() bool { + if o != nil && !IsNil(o.StartDateGte) { + return true + } + + return false +} + +// SetStartDateGte gets a reference to the given time.Time and assigns it to the StartDateGte field. +func (o *ListTaskInstanceForm) SetStartDateGte(v time.Time) { + o.StartDateGte = &v +} + +// GetStartDateLte returns the StartDateLte field value if set, zero value otherwise. +func (o *ListTaskInstanceForm) GetStartDateLte() time.Time { + if o == nil || IsNil(o.StartDateLte) { + var ret time.Time + return ret + } + return *o.StartDateLte +} + +// GetStartDateLteOk returns a tuple with the StartDateLte field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListTaskInstanceForm) GetStartDateLteOk() (*time.Time, bool) { + if o == nil || IsNil(o.StartDateLte) { + return nil, false + } + return o.StartDateLte, true +} + +// HasStartDateLte returns a boolean if a field has been set. +func (o *ListTaskInstanceForm) HasStartDateLte() bool { + if o != nil && !IsNil(o.StartDateLte) { + return true + } + + return false +} + +// SetStartDateLte gets a reference to the given time.Time and assigns it to the StartDateLte field. +func (o *ListTaskInstanceForm) SetStartDateLte(v time.Time) { + o.StartDateLte = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *ListTaskInstanceForm) GetState() []TaskState { + if o == nil || IsNil(o.State) { + var ret []TaskState + return ret + } + return o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListTaskInstanceForm) GetStateOk() ([]TaskState, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *ListTaskInstanceForm) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given []TaskState and assigns it to the State field. +func (o *ListTaskInstanceForm) SetState(v []TaskState) { + o.State = v +} + +// GetTaskIds returns the TaskIds field value if set, zero value otherwise. +func (o *ListTaskInstanceForm) GetTaskIds() []string { + if o == nil || IsNil(o.TaskIds) { + var ret []string + return ret + } + return o.TaskIds +} + +// GetTaskIdsOk returns a tuple with the TaskIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListTaskInstanceForm) GetTaskIdsOk() ([]string, bool) { + if o == nil || IsNil(o.TaskIds) { + return nil, false + } + return o.TaskIds, true +} + +// HasTaskIds returns a boolean if a field has been set. +func (o *ListTaskInstanceForm) HasTaskIds() bool { + if o != nil && !IsNil(o.TaskIds) { + return true + } + + return false +} + +// SetTaskIds gets a reference to the given []string and assigns it to the TaskIds field. +func (o *ListTaskInstanceForm) SetTaskIds(v []string) { + o.TaskIds = v } func (o ListTaskInstanceForm) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListTaskInstanceForm) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.DagIds != nil { + if !IsNil(o.DagIds) { toSerialize["dag_ids"] = o.DagIds } - if o.ExecutionDateGte != nil { - toSerialize["execution_date_gte"] = o.ExecutionDateGte + if !IsNil(o.DagRunIds) { + toSerialize["dag_run_ids"] = o.DagRunIds } - if o.ExecutionDateLte != nil { - toSerialize["execution_date_lte"] = o.ExecutionDateLte - } - if o.StartDateGte != nil { - toSerialize["start_date_gte"] = o.StartDateGte + if !IsNil(o.DurationGte) { + toSerialize["duration_gte"] = o.DurationGte } - if o.StartDateLte != nil { - toSerialize["start_date_lte"] = o.StartDateLte + if !IsNil(o.DurationLte) { + toSerialize["duration_lte"] = o.DurationLte } - if o.EndDateGte != nil { + if !IsNil(o.EndDateGte) { toSerialize["end_date_gte"] = o.EndDateGte } - if o.EndDateLte != nil { + if !IsNil(o.EndDateLte) { toSerialize["end_date_lte"] = o.EndDateLte } - if o.DurationGte != nil { - toSerialize["duration_gte"] = o.DurationGte + if !IsNil(o.ExecutionDateGte) { + toSerialize["execution_date_gte"] = o.ExecutionDateGte } - if o.DurationLte != nil { - toSerialize["duration_lte"] = o.DurationLte + if !IsNil(o.ExecutionDateLte) { + toSerialize["execution_date_lte"] = o.ExecutionDateLte } - if o.State != nil { - toSerialize["state"] = o.State + if !IsNil(o.Executor) { + toSerialize["executor"] = o.Executor } - if o.Pool != nil { + if !IsNil(o.PageLimit) { + toSerialize["page_limit"] = o.PageLimit + } + if !IsNil(o.PageOffset) { + toSerialize["page_offset"] = o.PageOffset + } + if !IsNil(o.Pool) { toSerialize["pool"] = o.Pool } - if o.Queue != nil { + if !IsNil(o.Queue) { toSerialize["queue"] = o.Queue } - return json.Marshal(toSerialize) + if !IsNil(o.StartDateGte) { + toSerialize["start_date_gte"] = o.StartDateGte + } + if !IsNil(o.StartDateLte) { + toSerialize["start_date_lte"] = o.StartDateLte + } + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + if !IsNil(o.TaskIds) { + toSerialize["task_ids"] = o.TaskIds + } + return toSerialize, nil } type NullableListTaskInstanceForm struct { diff --git a/airflow/model_metadatabase_status.go b/airflow/model_metadatabase_status.go index 133bc00..412b0f1 100644 --- a/airflow/model_metadatabase_status.go +++ b/airflow/model_metadatabase_status.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,9 +15,12 @@ import ( "encoding/json" ) +// checks if the MetadatabaseStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MetadatabaseStatus{} + // MetadatabaseStatus The status of the metadatabase. type MetadatabaseStatus struct { - Status *HealthStatus `json:"status,omitempty"` + Status NullableHealthStatus `json:"status,omitempty"` } // NewMetadatabaseStatus instantiates a new MetadatabaseStatus object @@ -54,46 +40,64 @@ func NewMetadatabaseStatusWithDefaults() *MetadatabaseStatus { return &this } -// GetStatus returns the Status field value if set, zero value otherwise. +// GetStatus returns the Status field value if set, zero value otherwise (both if not set or set to explicit null). func (o *MetadatabaseStatus) GetStatus() HealthStatus { - if o == nil || o.Status == nil { + if o == nil || IsNil(o.Status.Get()) { var ret HealthStatus return ret } - return *o.Status + return *o.Status.Get() } // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *MetadatabaseStatus) GetStatusOk() (*HealthStatus, bool) { - if o == nil || o.Status == nil { + if o == nil { return nil, false } - return o.Status, true + return o.Status.Get(), o.Status.IsSet() } // HasStatus returns a boolean if a field has been set. func (o *MetadatabaseStatus) HasStatus() bool { - if o != nil && o.Status != nil { + if o != nil && o.Status.IsSet() { return true } return false } -// SetStatus gets a reference to the given HealthStatus and assigns it to the Status field. +// SetStatus gets a reference to the given NullableHealthStatus and assigns it to the Status field. func (o *MetadatabaseStatus) SetStatus(v HealthStatus) { - o.Status = &v + o.Status.Set(&v) +} +// SetStatusNil sets the value for Status to be an explicit nil +func (o *MetadatabaseStatus) SetStatusNil() { + o.Status.Set(nil) +} + +// UnsetStatus ensures that no value is present for Status, not even an explicit nil +func (o *MetadatabaseStatus) UnsetStatus() { + o.Status.Unset() } func (o MetadatabaseStatus) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Status != nil { - toSerialize["status"] = o.Status + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o MetadatabaseStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Status.IsSet() { + toSerialize["status"] = o.Status.Get() + } + return toSerialize, nil +} + type NullableMetadatabaseStatus struct { value *MetadatabaseStatus isSet bool diff --git a/airflow/model_plugin_collection.go b/airflow/model_plugin_collection.go index ae7127b..d3de3bc 100644 --- a/airflow/model_plugin_collection.go +++ b/airflow/model_plugin_collection.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,11 +15,14 @@ import ( "encoding/json" ) +// checks if the PluginCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PluginCollection{} + // PluginCollection A collection of plugin. *New in version 2.1.0* type PluginCollection struct { - Plugins *[]PluginCollectionItem `json:"plugins,omitempty"` - // Count of objects in the current result set. + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. TotalEntries *int32 `json:"total_entries,omitempty"` + Plugins []PluginCollectionItem `json:"plugins,omitempty"` } // NewPluginCollection instantiates a new PluginCollection object @@ -56,79 +42,87 @@ func NewPluginCollectionWithDefaults() *PluginCollection { return &this } -// GetPlugins returns the Plugins field value if set, zero value otherwise. -func (o *PluginCollection) GetPlugins() []PluginCollectionItem { - if o == nil || o.Plugins == nil { - var ret []PluginCollectionItem +// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. +func (o *PluginCollection) GetTotalEntries() int32 { + if o == nil || IsNil(o.TotalEntries) { + var ret int32 return ret } - return *o.Plugins + return *o.TotalEntries } -// GetPluginsOk returns a tuple with the Plugins field value if set, nil otherwise +// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PluginCollection) GetPluginsOk() (*[]PluginCollectionItem, bool) { - if o == nil || o.Plugins == nil { +func (o *PluginCollection) GetTotalEntriesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalEntries) { return nil, false } - return o.Plugins, true + return o.TotalEntries, true } -// HasPlugins returns a boolean if a field has been set. -func (o *PluginCollection) HasPlugins() bool { - if o != nil && o.Plugins != nil { +// HasTotalEntries returns a boolean if a field has been set. +func (o *PluginCollection) HasTotalEntries() bool { + if o != nil && !IsNil(o.TotalEntries) { return true } return false } -// SetPlugins gets a reference to the given []PluginCollectionItem and assigns it to the Plugins field. -func (o *PluginCollection) SetPlugins(v []PluginCollectionItem) { - o.Plugins = &v +// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. +func (o *PluginCollection) SetTotalEntries(v int32) { + o.TotalEntries = &v } -// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. -func (o *PluginCollection) GetTotalEntries() int32 { - if o == nil || o.TotalEntries == nil { - var ret int32 +// GetPlugins returns the Plugins field value if set, zero value otherwise. +func (o *PluginCollection) GetPlugins() []PluginCollectionItem { + if o == nil || IsNil(o.Plugins) { + var ret []PluginCollectionItem return ret } - return *o.TotalEntries + return o.Plugins } -// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise +// GetPluginsOk returns a tuple with the Plugins field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PluginCollection) GetTotalEntriesOk() (*int32, bool) { - if o == nil || o.TotalEntries == nil { +func (o *PluginCollection) GetPluginsOk() ([]PluginCollectionItem, bool) { + if o == nil || IsNil(o.Plugins) { return nil, false } - return o.TotalEntries, true + return o.Plugins, true } -// HasTotalEntries returns a boolean if a field has been set. -func (o *PluginCollection) HasTotalEntries() bool { - if o != nil && o.TotalEntries != nil { +// HasPlugins returns a boolean if a field has been set. +func (o *PluginCollection) HasPlugins() bool { + if o != nil && !IsNil(o.Plugins) { return true } return false } -// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. -func (o *PluginCollection) SetTotalEntries(v int32) { - o.TotalEntries = &v +// SetPlugins gets a reference to the given []PluginCollectionItem and assigns it to the Plugins field. +func (o *PluginCollection) SetPlugins(v []PluginCollectionItem) { + o.Plugins = v } func (o PluginCollection) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Plugins != nil { - toSerialize["plugins"] = o.Plugins + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.TotalEntries != nil { + return json.Marshal(toSerialize) +} + +func (o PluginCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalEntries) { toSerialize["total_entries"] = o.TotalEntries } - return json.Marshal(toSerialize) + if !IsNil(o.Plugins) { + toSerialize["plugins"] = o.Plugins + } + return toSerialize, nil } type NullablePluginCollection struct { diff --git a/airflow/model_plugin_collection_item.go b/airflow/model_plugin_collection_item.go index b1f3960..5062ace 100644 --- a/airflow/model_plugin_collection_item.go +++ b/airflow/model_plugin_collection_item.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,28 +15,37 @@ import ( "encoding/json" ) +// checks if the PluginCollectionItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PluginCollectionItem{} + // PluginCollectionItem A plugin Item. *New in version 2.1.0* type PluginCollectionItem struct { - // The name of the plugin - Name *string `json:"name,omitempty"` - // The plugin hooks - Hooks *[]*string `json:"hooks,omitempty"` + // The Flask Appbuilder menu items + AppbuilderMenuItems []*map[string]interface{} `json:"appbuilder_menu_items,omitempty"` + // The appuilder views + AppbuilderViews []*map[string]interface{} `json:"appbuilder_views,omitempty"` // The plugin executors - Executors *[]*string `json:"executors,omitempty"` - // The plugin macros - Macros *[]*map[string]interface{} `json:"macros,omitempty"` + Executors []*string `json:"executors,omitempty"` // The flask blueprints - FlaskBlueprints *[]*map[string]interface{} `json:"flask_blueprints,omitempty"` - // The appuilder views - AppbuilderViews *[]*map[string]interface{} `json:"appbuilder_views,omitempty"` - // The Flask Appbuilder menu items - AppbuilderMenuItems *[]*map[string]interface{} `json:"appbuilder_menu_items,omitempty"` + FlaskBlueprints []*string `json:"flask_blueprints,omitempty"` // The global operator extra links - GlobalOperatorExtraLinks *[]*map[string]interface{} `json:"global_operator_extra_links,omitempty"` + GlobalOperatorExtraLinks []*string `json:"global_operator_extra_links,omitempty"` + // The plugin hooks + Hooks []*string `json:"hooks,omitempty"` + // The plugin listeners + Listeners []string `json:"listeners,omitempty"` + // The plugin macros + Macros []*string `json:"macros,omitempty"` + // The name of the plugin + Name *string `json:"name,omitempty"` // Operator extra links - OperatorExtraLinks *[]*map[string]interface{} `json:"operator_extra_links,omitempty"` + OperatorExtraLinks []*string `json:"operator_extra_links,omitempty"` // The plugin source Source NullableString `json:"source,omitempty"` + // The plugin task instance dependencies + TiDeps []string `json:"ti_deps,omitempty"` + // The plugin timetables + Timetables []string `json:"timetables,omitempty"` } // NewPluginCollectionItem instantiates a new PluginCollectionItem object @@ -73,83 +65,83 @@ func NewPluginCollectionItemWithDefaults() *PluginCollectionItem { return &this } -// GetName returns the Name field value if set, zero value otherwise. -func (o *PluginCollectionItem) GetName() string { - if o == nil || o.Name == nil { - var ret string +// GetAppbuilderMenuItems returns the AppbuilderMenuItems field value if set, zero value otherwise. +func (o *PluginCollectionItem) GetAppbuilderMenuItems() []*map[string]interface{} { + if o == nil || IsNil(o.AppbuilderMenuItems) { + var ret []*map[string]interface{} return ret } - return *o.Name + return o.AppbuilderMenuItems } -// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// GetAppbuilderMenuItemsOk returns a tuple with the AppbuilderMenuItems field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PluginCollectionItem) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { +func (o *PluginCollectionItem) GetAppbuilderMenuItemsOk() ([]*map[string]interface{}, bool) { + if o == nil || IsNil(o.AppbuilderMenuItems) { return nil, false } - return o.Name, true + return o.AppbuilderMenuItems, true } -// HasName returns a boolean if a field has been set. -func (o *PluginCollectionItem) HasName() bool { - if o != nil && o.Name != nil { +// HasAppbuilderMenuItems returns a boolean if a field has been set. +func (o *PluginCollectionItem) HasAppbuilderMenuItems() bool { + if o != nil && !IsNil(o.AppbuilderMenuItems) { return true } return false } -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *PluginCollectionItem) SetName(v string) { - o.Name = &v +// SetAppbuilderMenuItems gets a reference to the given []*map[string]interface{} and assigns it to the AppbuilderMenuItems field. +func (o *PluginCollectionItem) SetAppbuilderMenuItems(v []*map[string]interface{}) { + o.AppbuilderMenuItems = v } -// GetHooks returns the Hooks field value if set, zero value otherwise. -func (o *PluginCollectionItem) GetHooks() []*string { - if o == nil || o.Hooks == nil { - var ret []*string +// GetAppbuilderViews returns the AppbuilderViews field value if set, zero value otherwise. +func (o *PluginCollectionItem) GetAppbuilderViews() []*map[string]interface{} { + if o == nil || IsNil(o.AppbuilderViews) { + var ret []*map[string]interface{} return ret } - return *o.Hooks + return o.AppbuilderViews } -// GetHooksOk returns a tuple with the Hooks field value if set, nil otherwise +// GetAppbuilderViewsOk returns a tuple with the AppbuilderViews field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PluginCollectionItem) GetHooksOk() (*[]*string, bool) { - if o == nil || o.Hooks == nil { +func (o *PluginCollectionItem) GetAppbuilderViewsOk() ([]*map[string]interface{}, bool) { + if o == nil || IsNil(o.AppbuilderViews) { return nil, false } - return o.Hooks, true + return o.AppbuilderViews, true } -// HasHooks returns a boolean if a field has been set. -func (o *PluginCollectionItem) HasHooks() bool { - if o != nil && o.Hooks != nil { +// HasAppbuilderViews returns a boolean if a field has been set. +func (o *PluginCollectionItem) HasAppbuilderViews() bool { + if o != nil && !IsNil(o.AppbuilderViews) { return true } return false } -// SetHooks gets a reference to the given []*string and assigns it to the Hooks field. -func (o *PluginCollectionItem) SetHooks(v []*string) { - o.Hooks = &v +// SetAppbuilderViews gets a reference to the given []*map[string]interface{} and assigns it to the AppbuilderViews field. +func (o *PluginCollectionItem) SetAppbuilderViews(v []*map[string]interface{}) { + o.AppbuilderViews = v } // GetExecutors returns the Executors field value if set, zero value otherwise. func (o *PluginCollectionItem) GetExecutors() []*string { - if o == nil || o.Executors == nil { + if o == nil || IsNil(o.Executors) { var ret []*string return ret } - return *o.Executors + return o.Executors } // GetExecutorsOk returns a tuple with the Executors field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PluginCollectionItem) GetExecutorsOk() (*[]*string, bool) { - if o == nil || o.Executors == nil { +func (o *PluginCollectionItem) GetExecutorsOk() ([]*string, bool) { + if o == nil || IsNil(o.Executors) { return nil, false } return o.Executors, true @@ -157,7 +149,7 @@ func (o *PluginCollectionItem) GetExecutorsOk() (*[]*string, bool) { // HasExecutors returns a boolean if a field has been set. func (o *PluginCollectionItem) HasExecutors() bool { - if o != nil && o.Executors != nil { + if o != nil && !IsNil(o.Executors) { return true } @@ -166,182 +158,214 @@ func (o *PluginCollectionItem) HasExecutors() bool { // SetExecutors gets a reference to the given []*string and assigns it to the Executors field. func (o *PluginCollectionItem) SetExecutors(v []*string) { - o.Executors = &v + o.Executors = v } -// GetMacros returns the Macros field value if set, zero value otherwise. -func (o *PluginCollectionItem) GetMacros() []*map[string]interface{} { - if o == nil || o.Macros == nil { - var ret []*map[string]interface{} +// GetFlaskBlueprints returns the FlaskBlueprints field value if set, zero value otherwise. +func (o *PluginCollectionItem) GetFlaskBlueprints() []*string { + if o == nil || IsNil(o.FlaskBlueprints) { + var ret []*string return ret } - return *o.Macros + return o.FlaskBlueprints } -// GetMacrosOk returns a tuple with the Macros field value if set, nil otherwise +// GetFlaskBlueprintsOk returns a tuple with the FlaskBlueprints field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PluginCollectionItem) GetMacrosOk() (*[]*map[string]interface{}, bool) { - if o == nil || o.Macros == nil { +func (o *PluginCollectionItem) GetFlaskBlueprintsOk() ([]*string, bool) { + if o == nil || IsNil(o.FlaskBlueprints) { return nil, false } - return o.Macros, true + return o.FlaskBlueprints, true } -// HasMacros returns a boolean if a field has been set. -func (o *PluginCollectionItem) HasMacros() bool { - if o != nil && o.Macros != nil { +// HasFlaskBlueprints returns a boolean if a field has been set. +func (o *PluginCollectionItem) HasFlaskBlueprints() bool { + if o != nil && !IsNil(o.FlaskBlueprints) { return true } return false } -// SetMacros gets a reference to the given []*map[string]interface{} and assigns it to the Macros field. -func (o *PluginCollectionItem) SetMacros(v []*map[string]interface{}) { - o.Macros = &v +// SetFlaskBlueprints gets a reference to the given []*string and assigns it to the FlaskBlueprints field. +func (o *PluginCollectionItem) SetFlaskBlueprints(v []*string) { + o.FlaskBlueprints = v } -// GetFlaskBlueprints returns the FlaskBlueprints field value if set, zero value otherwise. -func (o *PluginCollectionItem) GetFlaskBlueprints() []*map[string]interface{} { - if o == nil || o.FlaskBlueprints == nil { - var ret []*map[string]interface{} +// GetGlobalOperatorExtraLinks returns the GlobalOperatorExtraLinks field value if set, zero value otherwise. +func (o *PluginCollectionItem) GetGlobalOperatorExtraLinks() []*string { + if o == nil || IsNil(o.GlobalOperatorExtraLinks) { + var ret []*string return ret } - return *o.FlaskBlueprints + return o.GlobalOperatorExtraLinks } -// GetFlaskBlueprintsOk returns a tuple with the FlaskBlueprints field value if set, nil otherwise +// GetGlobalOperatorExtraLinksOk returns a tuple with the GlobalOperatorExtraLinks field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PluginCollectionItem) GetFlaskBlueprintsOk() (*[]*map[string]interface{}, bool) { - if o == nil || o.FlaskBlueprints == nil { +func (o *PluginCollectionItem) GetGlobalOperatorExtraLinksOk() ([]*string, bool) { + if o == nil || IsNil(o.GlobalOperatorExtraLinks) { return nil, false } - return o.FlaskBlueprints, true + return o.GlobalOperatorExtraLinks, true } -// HasFlaskBlueprints returns a boolean if a field has been set. -func (o *PluginCollectionItem) HasFlaskBlueprints() bool { - if o != nil && o.FlaskBlueprints != nil { +// HasGlobalOperatorExtraLinks returns a boolean if a field has been set. +func (o *PluginCollectionItem) HasGlobalOperatorExtraLinks() bool { + if o != nil && !IsNil(o.GlobalOperatorExtraLinks) { return true } return false } -// SetFlaskBlueprints gets a reference to the given []*map[string]interface{} and assigns it to the FlaskBlueprints field. -func (o *PluginCollectionItem) SetFlaskBlueprints(v []*map[string]interface{}) { - o.FlaskBlueprints = &v +// SetGlobalOperatorExtraLinks gets a reference to the given []*string and assigns it to the GlobalOperatorExtraLinks field. +func (o *PluginCollectionItem) SetGlobalOperatorExtraLinks(v []*string) { + o.GlobalOperatorExtraLinks = v } -// GetAppbuilderViews returns the AppbuilderViews field value if set, zero value otherwise. -func (o *PluginCollectionItem) GetAppbuilderViews() []*map[string]interface{} { - if o == nil || o.AppbuilderViews == nil { - var ret []*map[string]interface{} +// GetHooks returns the Hooks field value if set, zero value otherwise. +func (o *PluginCollectionItem) GetHooks() []*string { + if o == nil || IsNil(o.Hooks) { + var ret []*string return ret } - return *o.AppbuilderViews + return o.Hooks } -// GetAppbuilderViewsOk returns a tuple with the AppbuilderViews field value if set, nil otherwise +// GetHooksOk returns a tuple with the Hooks field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PluginCollectionItem) GetAppbuilderViewsOk() (*[]*map[string]interface{}, bool) { - if o == nil || o.AppbuilderViews == nil { +func (o *PluginCollectionItem) GetHooksOk() ([]*string, bool) { + if o == nil || IsNil(o.Hooks) { return nil, false } - return o.AppbuilderViews, true + return o.Hooks, true } -// HasAppbuilderViews returns a boolean if a field has been set. -func (o *PluginCollectionItem) HasAppbuilderViews() bool { - if o != nil && o.AppbuilderViews != nil { +// HasHooks returns a boolean if a field has been set. +func (o *PluginCollectionItem) HasHooks() bool { + if o != nil && !IsNil(o.Hooks) { return true } return false } -// SetAppbuilderViews gets a reference to the given []*map[string]interface{} and assigns it to the AppbuilderViews field. -func (o *PluginCollectionItem) SetAppbuilderViews(v []*map[string]interface{}) { - o.AppbuilderViews = &v +// SetHooks gets a reference to the given []*string and assigns it to the Hooks field. +func (o *PluginCollectionItem) SetHooks(v []*string) { + o.Hooks = v } -// GetAppbuilderMenuItems returns the AppbuilderMenuItems field value if set, zero value otherwise. -func (o *PluginCollectionItem) GetAppbuilderMenuItems() []*map[string]interface{} { - if o == nil || o.AppbuilderMenuItems == nil { - var ret []*map[string]interface{} +// GetListeners returns the Listeners field value if set, zero value otherwise. +func (o *PluginCollectionItem) GetListeners() []string { + if o == nil || IsNil(o.Listeners) { + var ret []string return ret } - return *o.AppbuilderMenuItems + return o.Listeners } -// GetAppbuilderMenuItemsOk returns a tuple with the AppbuilderMenuItems field value if set, nil otherwise +// GetListenersOk returns a tuple with the Listeners field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PluginCollectionItem) GetAppbuilderMenuItemsOk() (*[]*map[string]interface{}, bool) { - if o == nil || o.AppbuilderMenuItems == nil { +func (o *PluginCollectionItem) GetListenersOk() ([]string, bool) { + if o == nil || IsNil(o.Listeners) { return nil, false } - return o.AppbuilderMenuItems, true + return o.Listeners, true } -// HasAppbuilderMenuItems returns a boolean if a field has been set. -func (o *PluginCollectionItem) HasAppbuilderMenuItems() bool { - if o != nil && o.AppbuilderMenuItems != nil { +// HasListeners returns a boolean if a field has been set. +func (o *PluginCollectionItem) HasListeners() bool { + if o != nil && !IsNil(o.Listeners) { return true } return false } -// SetAppbuilderMenuItems gets a reference to the given []*map[string]interface{} and assigns it to the AppbuilderMenuItems field. -func (o *PluginCollectionItem) SetAppbuilderMenuItems(v []*map[string]interface{}) { - o.AppbuilderMenuItems = &v +// SetListeners gets a reference to the given []string and assigns it to the Listeners field. +func (o *PluginCollectionItem) SetListeners(v []string) { + o.Listeners = v } -// GetGlobalOperatorExtraLinks returns the GlobalOperatorExtraLinks field value if set, zero value otherwise. -func (o *PluginCollectionItem) GetGlobalOperatorExtraLinks() []*map[string]interface{} { - if o == nil || o.GlobalOperatorExtraLinks == nil { - var ret []*map[string]interface{} +// GetMacros returns the Macros field value if set, zero value otherwise. +func (o *PluginCollectionItem) GetMacros() []*string { + if o == nil || IsNil(o.Macros) { + var ret []*string return ret } - return *o.GlobalOperatorExtraLinks + return o.Macros } -// GetGlobalOperatorExtraLinksOk returns a tuple with the GlobalOperatorExtraLinks field value if set, nil otherwise +// GetMacrosOk returns a tuple with the Macros field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PluginCollectionItem) GetGlobalOperatorExtraLinksOk() (*[]*map[string]interface{}, bool) { - if o == nil || o.GlobalOperatorExtraLinks == nil { +func (o *PluginCollectionItem) GetMacrosOk() ([]*string, bool) { + if o == nil || IsNil(o.Macros) { return nil, false } - return o.GlobalOperatorExtraLinks, true + return o.Macros, true } -// HasGlobalOperatorExtraLinks returns a boolean if a field has been set. -func (o *PluginCollectionItem) HasGlobalOperatorExtraLinks() bool { - if o != nil && o.GlobalOperatorExtraLinks != nil { +// HasMacros returns a boolean if a field has been set. +func (o *PluginCollectionItem) HasMacros() bool { + if o != nil && !IsNil(o.Macros) { return true } return false } -// SetGlobalOperatorExtraLinks gets a reference to the given []*map[string]interface{} and assigns it to the GlobalOperatorExtraLinks field. -func (o *PluginCollectionItem) SetGlobalOperatorExtraLinks(v []*map[string]interface{}) { - o.GlobalOperatorExtraLinks = &v +// SetMacros gets a reference to the given []*string and assigns it to the Macros field. +func (o *PluginCollectionItem) SetMacros(v []*string) { + o.Macros = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PluginCollectionItem) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PluginCollectionItem) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PluginCollectionItem) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PluginCollectionItem) SetName(v string) { + o.Name = &v } // GetOperatorExtraLinks returns the OperatorExtraLinks field value if set, zero value otherwise. -func (o *PluginCollectionItem) GetOperatorExtraLinks() []*map[string]interface{} { - if o == nil || o.OperatorExtraLinks == nil { - var ret []*map[string]interface{} +func (o *PluginCollectionItem) GetOperatorExtraLinks() []*string { + if o == nil || IsNil(o.OperatorExtraLinks) { + var ret []*string return ret } - return *o.OperatorExtraLinks + return o.OperatorExtraLinks } // GetOperatorExtraLinksOk returns a tuple with the OperatorExtraLinks field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PluginCollectionItem) GetOperatorExtraLinksOk() (*[]*map[string]interface{}, bool) { - if o == nil || o.OperatorExtraLinks == nil { +func (o *PluginCollectionItem) GetOperatorExtraLinksOk() ([]*string, bool) { + if o == nil || IsNil(o.OperatorExtraLinks) { return nil, false } return o.OperatorExtraLinks, true @@ -349,21 +373,21 @@ func (o *PluginCollectionItem) GetOperatorExtraLinksOk() (*[]*map[string]interfa // HasOperatorExtraLinks returns a boolean if a field has been set. func (o *PluginCollectionItem) HasOperatorExtraLinks() bool { - if o != nil && o.OperatorExtraLinks != nil { + if o != nil && !IsNil(o.OperatorExtraLinks) { return true } return false } -// SetOperatorExtraLinks gets a reference to the given []*map[string]interface{} and assigns it to the OperatorExtraLinks field. -func (o *PluginCollectionItem) SetOperatorExtraLinks(v []*map[string]interface{}) { - o.OperatorExtraLinks = &v +// SetOperatorExtraLinks gets a reference to the given []*string and assigns it to the OperatorExtraLinks field. +func (o *PluginCollectionItem) SetOperatorExtraLinks(v []*string) { + o.OperatorExtraLinks = v } // GetSource returns the Source field value if set, zero value otherwise (both if not set or set to explicit null). func (o *PluginCollectionItem) GetSource() string { - if o == nil || o.Source.Get() == nil { + if o == nil || IsNil(o.Source.Get()) { var ret string return ret } @@ -374,7 +398,7 @@ func (o *PluginCollectionItem) GetSource() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *PluginCollectionItem) GetSourceOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Source.Get(), o.Source.IsSet() @@ -403,39 +427,120 @@ func (o *PluginCollectionItem) UnsetSource() { o.Source.Unset() } +// GetTiDeps returns the TiDeps field value if set, zero value otherwise. +func (o *PluginCollectionItem) GetTiDeps() []string { + if o == nil || IsNil(o.TiDeps) { + var ret []string + return ret + } + return o.TiDeps +} + +// GetTiDepsOk returns a tuple with the TiDeps field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PluginCollectionItem) GetTiDepsOk() ([]string, bool) { + if o == nil || IsNil(o.TiDeps) { + return nil, false + } + return o.TiDeps, true +} + +// HasTiDeps returns a boolean if a field has been set. +func (o *PluginCollectionItem) HasTiDeps() bool { + if o != nil && !IsNil(o.TiDeps) { + return true + } + + return false +} + +// SetTiDeps gets a reference to the given []string and assigns it to the TiDeps field. +func (o *PluginCollectionItem) SetTiDeps(v []string) { + o.TiDeps = v +} + +// GetTimetables returns the Timetables field value if set, zero value otherwise. +func (o *PluginCollectionItem) GetTimetables() []string { + if o == nil || IsNil(o.Timetables) { + var ret []string + return ret + } + return o.Timetables +} + +// GetTimetablesOk returns a tuple with the Timetables field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PluginCollectionItem) GetTimetablesOk() ([]string, bool) { + if o == nil || IsNil(o.Timetables) { + return nil, false + } + return o.Timetables, true +} + +// HasTimetables returns a boolean if a field has been set. +func (o *PluginCollectionItem) HasTimetables() bool { + if o != nil && !IsNil(o.Timetables) { + return true + } + + return false +} + +// SetTimetables gets a reference to the given []string and assigns it to the Timetables field. +func (o *PluginCollectionItem) SetTimetables(v []string) { + o.Timetables = v +} + func (o PluginCollectionItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PluginCollectionItem) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { - toSerialize["name"] = o.Name + if !IsNil(o.AppbuilderMenuItems) { + toSerialize["appbuilder_menu_items"] = o.AppbuilderMenuItems } - if o.Hooks != nil { - toSerialize["hooks"] = o.Hooks + if !IsNil(o.AppbuilderViews) { + toSerialize["appbuilder_views"] = o.AppbuilderViews } - if o.Executors != nil { + if !IsNil(o.Executors) { toSerialize["executors"] = o.Executors } - if o.Macros != nil { - toSerialize["macros"] = o.Macros - } - if o.FlaskBlueprints != nil { + if !IsNil(o.FlaskBlueprints) { toSerialize["flask_blueprints"] = o.FlaskBlueprints } - if o.AppbuilderViews != nil { - toSerialize["appbuilder_views"] = o.AppbuilderViews + if !IsNil(o.GlobalOperatorExtraLinks) { + toSerialize["global_operator_extra_links"] = o.GlobalOperatorExtraLinks } - if o.AppbuilderMenuItems != nil { - toSerialize["appbuilder_menu_items"] = o.AppbuilderMenuItems + if !IsNil(o.Hooks) { + toSerialize["hooks"] = o.Hooks } - if o.GlobalOperatorExtraLinks != nil { - toSerialize["global_operator_extra_links"] = o.GlobalOperatorExtraLinks + if !IsNil(o.Listeners) { + toSerialize["listeners"] = o.Listeners + } + if !IsNil(o.Macros) { + toSerialize["macros"] = o.Macros + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name } - if o.OperatorExtraLinks != nil { + if !IsNil(o.OperatorExtraLinks) { toSerialize["operator_extra_links"] = o.OperatorExtraLinks } if o.Source.IsSet() { toSerialize["source"] = o.Source.Get() } - return json.Marshal(toSerialize) + if !IsNil(o.TiDeps) { + toSerialize["ti_deps"] = o.TiDeps + } + if !IsNil(o.Timetables) { + toSerialize["timetables"] = o.Timetables + } + return toSerialize, nil } type NullablePluginCollectionItem struct { diff --git a/airflow/model_pool.go b/airflow/model_pool.go index 45ab430..1f367e9 100644 --- a/airflow/model_pool.go +++ b/airflow/model_pool.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,22 +15,31 @@ import ( "encoding/json" ) +// checks if the Pool type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Pool{} + // Pool The pool type Pool struct { + // The number of slots used by deferred tasks at the moment. Relevant if 'include_deferred' is set to true. *New in version 2.7.0* + DeferredSlots *int32 `json:"deferred_slots,omitempty"` + // The description of the pool. *New in version 2.3.0* + Description NullableString `json:"description,omitempty"` + // If set to true, deferred tasks are considered when calculating open pool slots. *New in version 2.7.0* + IncludeDeferred *bool `json:"include_deferred,omitempty"` // The name of pool. Name *string `json:"name,omitempty"` - // The maximum number of slots that can be assigned to tasks. One job may occupy one or more slots. - Slots *int32 `json:"slots,omitempty"` - // The number of slots used by running/queued tasks at the moment. + // The number of slots used by running/queued tasks at the moment. May include deferred tasks if 'include_deferred' is set to true. OccupiedSlots *int32 `json:"occupied_slots,omitempty"` - // The number of slots used by running tasks at the moment. - UsedSlots *int32 `json:"used_slots,omitempty"` - // The number of slots used by queued tasks at the moment. - QueuedSlots *int32 `json:"queued_slots,omitempty"` // The number of free slots at the moment. OpenSlots *int32 `json:"open_slots,omitempty"` - // The description of the pool. *New in version 2.3.0* - Description NullableString `json:"description,omitempty"` + // The number of slots used by queued tasks at the moment. + QueuedSlots *int32 `json:"queued_slots,omitempty"` + // The number of slots used by running tasks at the moment. + RunningSlots *int32 `json:"running_slots,omitempty"` + // The number of slots used by scheduled tasks at the moment. + ScheduledSlots *int32 `json:"scheduled_slots,omitempty"` + // The maximum number of slots that can be assigned to tasks. One job may occupy one or more slots. + Slots *int32 `json:"slots,omitempty"` } // NewPool instantiates a new Pool object @@ -67,73 +59,147 @@ func NewPoolWithDefaults() *Pool { return &this } -// GetName returns the Name field value if set, zero value otherwise. -func (o *Pool) GetName() string { - if o == nil || o.Name == nil { +// GetDeferredSlots returns the DeferredSlots field value if set, zero value otherwise. +func (o *Pool) GetDeferredSlots() int32 { + if o == nil || IsNil(o.DeferredSlots) { + var ret int32 + return ret + } + return *o.DeferredSlots +} + +// GetDeferredSlotsOk returns a tuple with the DeferredSlots field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Pool) GetDeferredSlotsOk() (*int32, bool) { + if o == nil || IsNil(o.DeferredSlots) { + return nil, false + } + return o.DeferredSlots, true +} + +// HasDeferredSlots returns a boolean if a field has been set. +func (o *Pool) HasDeferredSlots() bool { + if o != nil && !IsNil(o.DeferredSlots) { + return true + } + + return false +} + +// SetDeferredSlots gets a reference to the given int32 and assigns it to the DeferredSlots field. +func (o *Pool) SetDeferredSlots(v int32) { + o.DeferredSlots = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Pool) GetDescription() string { + if o == nil || IsNil(o.Description.Get()) { var ret string return ret } - return *o.Name + return *o.Description.Get() } -// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Pool) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Pool) GetDescriptionOk() (*string, bool) { + if o == nil { return nil, false } - return o.Name, true + return o.Description.Get(), o.Description.IsSet() } -// HasName returns a boolean if a field has been set. -func (o *Pool) HasName() bool { - if o != nil && o.Name != nil { +// HasDescription returns a boolean if a field has been set. +func (o *Pool) HasDescription() bool { + if o != nil && o.Description.IsSet() { return true } return false } -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *Pool) SetName(v string) { - o.Name = &v +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. +func (o *Pool) SetDescription(v string) { + o.Description.Set(&v) +} +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *Pool) SetDescriptionNil() { + o.Description.Set(nil) } -// GetSlots returns the Slots field value if set, zero value otherwise. -func (o *Pool) GetSlots() int32 { - if o == nil || o.Slots == nil { - var ret int32 +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *Pool) UnsetDescription() { + o.Description.Unset() +} + +// GetIncludeDeferred returns the IncludeDeferred field value if set, zero value otherwise. +func (o *Pool) GetIncludeDeferred() bool { + if o == nil || IsNil(o.IncludeDeferred) { + var ret bool return ret } - return *o.Slots + return *o.IncludeDeferred } -// GetSlotsOk returns a tuple with the Slots field value if set, nil otherwise +// GetIncludeDeferredOk returns a tuple with the IncludeDeferred field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Pool) GetSlotsOk() (*int32, bool) { - if o == nil || o.Slots == nil { +func (o *Pool) GetIncludeDeferredOk() (*bool, bool) { + if o == nil || IsNil(o.IncludeDeferred) { return nil, false } - return o.Slots, true + return o.IncludeDeferred, true } -// HasSlots returns a boolean if a field has been set. -func (o *Pool) HasSlots() bool { - if o != nil && o.Slots != nil { +// HasIncludeDeferred returns a boolean if a field has been set. +func (o *Pool) HasIncludeDeferred() bool { + if o != nil && !IsNil(o.IncludeDeferred) { return true } return false } -// SetSlots gets a reference to the given int32 and assigns it to the Slots field. -func (o *Pool) SetSlots(v int32) { - o.Slots = &v +// SetIncludeDeferred gets a reference to the given bool and assigns it to the IncludeDeferred field. +func (o *Pool) SetIncludeDeferred(v bool) { + o.IncludeDeferred = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Pool) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Pool) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Pool) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Pool) SetName(v string) { + o.Name = &v } // GetOccupiedSlots returns the OccupiedSlots field value if set, zero value otherwise. func (o *Pool) GetOccupiedSlots() int32 { - if o == nil || o.OccupiedSlots == nil { + if o == nil || IsNil(o.OccupiedSlots) { var ret int32 return ret } @@ -143,7 +209,7 @@ func (o *Pool) GetOccupiedSlots() int32 { // GetOccupiedSlotsOk returns a tuple with the OccupiedSlots field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Pool) GetOccupiedSlotsOk() (*int32, bool) { - if o == nil || o.OccupiedSlots == nil { + if o == nil || IsNil(o.OccupiedSlots) { return nil, false } return o.OccupiedSlots, true @@ -151,7 +217,7 @@ func (o *Pool) GetOccupiedSlotsOk() (*int32, bool) { // HasOccupiedSlots returns a boolean if a field has been set. func (o *Pool) HasOccupiedSlots() bool { - if o != nil && o.OccupiedSlots != nil { + if o != nil && !IsNil(o.OccupiedSlots) { return true } @@ -163,41 +229,41 @@ func (o *Pool) SetOccupiedSlots(v int32) { o.OccupiedSlots = &v } -// GetUsedSlots returns the UsedSlots field value if set, zero value otherwise. -func (o *Pool) GetUsedSlots() int32 { - if o == nil || o.UsedSlots == nil { +// GetOpenSlots returns the OpenSlots field value if set, zero value otherwise. +func (o *Pool) GetOpenSlots() int32 { + if o == nil || IsNil(o.OpenSlots) { var ret int32 return ret } - return *o.UsedSlots + return *o.OpenSlots } -// GetUsedSlotsOk returns a tuple with the UsedSlots field value if set, nil otherwise +// GetOpenSlotsOk returns a tuple with the OpenSlots field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Pool) GetUsedSlotsOk() (*int32, bool) { - if o == nil || o.UsedSlots == nil { +func (o *Pool) GetOpenSlotsOk() (*int32, bool) { + if o == nil || IsNil(o.OpenSlots) { return nil, false } - return o.UsedSlots, true + return o.OpenSlots, true } -// HasUsedSlots returns a boolean if a field has been set. -func (o *Pool) HasUsedSlots() bool { - if o != nil && o.UsedSlots != nil { +// HasOpenSlots returns a boolean if a field has been set. +func (o *Pool) HasOpenSlots() bool { + if o != nil && !IsNil(o.OpenSlots) { return true } return false } -// SetUsedSlots gets a reference to the given int32 and assigns it to the UsedSlots field. -func (o *Pool) SetUsedSlots(v int32) { - o.UsedSlots = &v +// SetOpenSlots gets a reference to the given int32 and assigns it to the OpenSlots field. +func (o *Pool) SetOpenSlots(v int32) { + o.OpenSlots = &v } // GetQueuedSlots returns the QueuedSlots field value if set, zero value otherwise. func (o *Pool) GetQueuedSlots() int32 { - if o == nil || o.QueuedSlots == nil { + if o == nil || IsNil(o.QueuedSlots) { var ret int32 return ret } @@ -207,7 +273,7 @@ func (o *Pool) GetQueuedSlots() int32 { // GetQueuedSlotsOk returns a tuple with the QueuedSlots field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Pool) GetQueuedSlotsOk() (*int32, bool) { - if o == nil || o.QueuedSlots == nil { + if o == nil || IsNil(o.QueuedSlots) { return nil, false } return o.QueuedSlots, true @@ -215,7 +281,7 @@ func (o *Pool) GetQueuedSlotsOk() (*int32, bool) { // HasQueuedSlots returns a boolean if a field has been set. func (o *Pool) HasQueuedSlots() bool { - if o != nil && o.QueuedSlots != nil { + if o != nil && !IsNil(o.QueuedSlots) { return true } @@ -227,104 +293,143 @@ func (o *Pool) SetQueuedSlots(v int32) { o.QueuedSlots = &v } -// GetOpenSlots returns the OpenSlots field value if set, zero value otherwise. -func (o *Pool) GetOpenSlots() int32 { - if o == nil || o.OpenSlots == nil { +// GetRunningSlots returns the RunningSlots field value if set, zero value otherwise. +func (o *Pool) GetRunningSlots() int32 { + if o == nil || IsNil(o.RunningSlots) { var ret int32 return ret } - return *o.OpenSlots + return *o.RunningSlots } -// GetOpenSlotsOk returns a tuple with the OpenSlots field value if set, nil otherwise +// GetRunningSlotsOk returns a tuple with the RunningSlots field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Pool) GetOpenSlotsOk() (*int32, bool) { - if o == nil || o.OpenSlots == nil { +func (o *Pool) GetRunningSlotsOk() (*int32, bool) { + if o == nil || IsNil(o.RunningSlots) { return nil, false } - return o.OpenSlots, true + return o.RunningSlots, true } -// HasOpenSlots returns a boolean if a field has been set. -func (o *Pool) HasOpenSlots() bool { - if o != nil && o.OpenSlots != nil { +// HasRunningSlots returns a boolean if a field has been set. +func (o *Pool) HasRunningSlots() bool { + if o != nil && !IsNil(o.RunningSlots) { return true } return false } -// SetOpenSlots gets a reference to the given int32 and assigns it to the OpenSlots field. -func (o *Pool) SetOpenSlots(v int32) { - o.OpenSlots = &v +// SetRunningSlots gets a reference to the given int32 and assigns it to the RunningSlots field. +func (o *Pool) SetRunningSlots(v int32) { + o.RunningSlots = &v } -// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Pool) GetDescription() string { - if o == nil || o.Description.Get() == nil { - var ret string +// GetScheduledSlots returns the ScheduledSlots field value if set, zero value otherwise. +func (o *Pool) GetScheduledSlots() int32 { + if o == nil || IsNil(o.ScheduledSlots) { + var ret int32 return ret } - return *o.Description.Get() + return *o.ScheduledSlots } -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// GetScheduledSlotsOk returns a tuple with the ScheduledSlots field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Pool) GetDescriptionOk() (*string, bool) { - if o == nil { +func (o *Pool) GetScheduledSlotsOk() (*int32, bool) { + if o == nil || IsNil(o.ScheduledSlots) { return nil, false } - return o.Description.Get(), o.Description.IsSet() + return o.ScheduledSlots, true } -// HasDescription returns a boolean if a field has been set. -func (o *Pool) HasDescription() bool { - if o != nil && o.Description.IsSet() { +// HasScheduledSlots returns a boolean if a field has been set. +func (o *Pool) HasScheduledSlots() bool { + if o != nil && !IsNil(o.ScheduledSlots) { return true } return false } -// SetDescription gets a reference to the given NullableString and assigns it to the Description field. -func (o *Pool) SetDescription(v string) { - o.Description.Set(&v) +// SetScheduledSlots gets a reference to the given int32 and assigns it to the ScheduledSlots field. +func (o *Pool) SetScheduledSlots(v int32) { + o.ScheduledSlots = &v } -// SetDescriptionNil sets the value for Description to be an explicit nil -func (o *Pool) SetDescriptionNil() { - o.Description.Set(nil) + +// GetSlots returns the Slots field value if set, zero value otherwise. +func (o *Pool) GetSlots() int32 { + if o == nil || IsNil(o.Slots) { + var ret int32 + return ret + } + return *o.Slots } -// UnsetDescription ensures that no value is present for Description, not even an explicit nil -func (o *Pool) UnsetDescription() { - o.Description.Unset() +// GetSlotsOk returns a tuple with the Slots field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Pool) GetSlotsOk() (*int32, bool) { + if o == nil || IsNil(o.Slots) { + return nil, false + } + return o.Slots, true +} + +// HasSlots returns a boolean if a field has been set. +func (o *Pool) HasSlots() bool { + if o != nil && !IsNil(o.Slots) { + return true + } + + return false +} + +// SetSlots gets a reference to the given int32 and assigns it to the Slots field. +func (o *Pool) SetSlots(v int32) { + o.Slots = &v } func (o Pool) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Pool) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { - toSerialize["name"] = o.Name + if !IsNil(o.DeferredSlots) { + toSerialize["deferred_slots"] = o.DeferredSlots } - if o.Slots != nil { - toSerialize["slots"] = o.Slots + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() + } + if !IsNil(o.IncludeDeferred) { + toSerialize["include_deferred"] = o.IncludeDeferred } - if o.OccupiedSlots != nil { + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.OccupiedSlots) { toSerialize["occupied_slots"] = o.OccupiedSlots } - if o.UsedSlots != nil { - toSerialize["used_slots"] = o.UsedSlots + if !IsNil(o.OpenSlots) { + toSerialize["open_slots"] = o.OpenSlots } - if o.QueuedSlots != nil { + if !IsNil(o.QueuedSlots) { toSerialize["queued_slots"] = o.QueuedSlots } - if o.OpenSlots != nil { - toSerialize["open_slots"] = o.OpenSlots + if !IsNil(o.RunningSlots) { + toSerialize["running_slots"] = o.RunningSlots } - if o.Description.IsSet() { - toSerialize["description"] = o.Description.Get() + if !IsNil(o.ScheduledSlots) { + toSerialize["scheduled_slots"] = o.ScheduledSlots } - return json.Marshal(toSerialize) + if !IsNil(o.Slots) { + toSerialize["slots"] = o.Slots + } + return toSerialize, nil } type NullablePool struct { diff --git a/airflow/model_pool_collection.go b/airflow/model_pool_collection.go index 89693a8..b78fb4e 100644 --- a/airflow/model_pool_collection.go +++ b/airflow/model_pool_collection.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,11 +15,14 @@ import ( "encoding/json" ) +// checks if the PoolCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PoolCollection{} + // PoolCollection Collection of pools. *Changed in version 2.1.0*: 'total_entries' field is added. type PoolCollection struct { - Pools *[]Pool `json:"pools,omitempty"` - // Count of objects in the current result set. + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. TotalEntries *int32 `json:"total_entries,omitempty"` + Pools []Pool `json:"pools,omitempty"` } // NewPoolCollection instantiates a new PoolCollection object @@ -56,79 +42,87 @@ func NewPoolCollectionWithDefaults() *PoolCollection { return &this } -// GetPools returns the Pools field value if set, zero value otherwise. -func (o *PoolCollection) GetPools() []Pool { - if o == nil || o.Pools == nil { - var ret []Pool +// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. +func (o *PoolCollection) GetTotalEntries() int32 { + if o == nil || IsNil(o.TotalEntries) { + var ret int32 return ret } - return *o.Pools + return *o.TotalEntries } -// GetPoolsOk returns a tuple with the Pools field value if set, nil otherwise +// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PoolCollection) GetPoolsOk() (*[]Pool, bool) { - if o == nil || o.Pools == nil { +func (o *PoolCollection) GetTotalEntriesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalEntries) { return nil, false } - return o.Pools, true + return o.TotalEntries, true } -// HasPools returns a boolean if a field has been set. -func (o *PoolCollection) HasPools() bool { - if o != nil && o.Pools != nil { +// HasTotalEntries returns a boolean if a field has been set. +func (o *PoolCollection) HasTotalEntries() bool { + if o != nil && !IsNil(o.TotalEntries) { return true } return false } -// SetPools gets a reference to the given []Pool and assigns it to the Pools field. -func (o *PoolCollection) SetPools(v []Pool) { - o.Pools = &v +// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. +func (o *PoolCollection) SetTotalEntries(v int32) { + o.TotalEntries = &v } -// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. -func (o *PoolCollection) GetTotalEntries() int32 { - if o == nil || o.TotalEntries == nil { - var ret int32 +// GetPools returns the Pools field value if set, zero value otherwise. +func (o *PoolCollection) GetPools() []Pool { + if o == nil || IsNil(o.Pools) { + var ret []Pool return ret } - return *o.TotalEntries + return o.Pools } -// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise +// GetPoolsOk returns a tuple with the Pools field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *PoolCollection) GetTotalEntriesOk() (*int32, bool) { - if o == nil || o.TotalEntries == nil { +func (o *PoolCollection) GetPoolsOk() ([]Pool, bool) { + if o == nil || IsNil(o.Pools) { return nil, false } - return o.TotalEntries, true + return o.Pools, true } -// HasTotalEntries returns a boolean if a field has been set. -func (o *PoolCollection) HasTotalEntries() bool { - if o != nil && o.TotalEntries != nil { +// HasPools returns a boolean if a field has been set. +func (o *PoolCollection) HasPools() bool { + if o != nil && !IsNil(o.Pools) { return true } return false } -// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. -func (o *PoolCollection) SetTotalEntries(v int32) { - o.TotalEntries = &v +// SetPools gets a reference to the given []Pool and assigns it to the Pools field. +func (o *PoolCollection) SetPools(v []Pool) { + o.Pools = v } func (o PoolCollection) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Pools != nil { - toSerialize["pools"] = o.Pools + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.TotalEntries != nil { + return json.Marshal(toSerialize) +} + +func (o PoolCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalEntries) { toSerialize["total_entries"] = o.TotalEntries } - return json.Marshal(toSerialize) + if !IsNil(o.Pools) { + toSerialize["pools"] = o.Pools + } + return toSerialize, nil } type NullablePoolCollection struct { diff --git a/airflow/model_provider.go b/airflow/model_provider.go index 72487a0..3cfbf80 100644 --- a/airflow/model_provider.go +++ b/airflow/model_provider.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,12 +15,15 @@ import ( "encoding/json" ) +// checks if the Provider type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Provider{} + // Provider The provider *New in version 2.1.0* type Provider struct { - // The package name of the provider. - PackageName *string `json:"package_name,omitempty"` // The description of the provider. Description *string `json:"description,omitempty"` + // The package name of the provider. + PackageName *string `json:"package_name,omitempty"` // The version of the provider. Version *string `json:"version,omitempty"` } @@ -59,73 +45,73 @@ func NewProviderWithDefaults() *Provider { return &this } -// GetPackageName returns the PackageName field value if set, zero value otherwise. -func (o *Provider) GetPackageName() string { - if o == nil || o.PackageName == nil { +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Provider) GetDescription() string { + if o == nil || IsNil(o.Description) { var ret string return ret } - return *o.PackageName + return *o.Description } -// GetPackageNameOk returns a tuple with the PackageName field value if set, nil otherwise +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Provider) GetPackageNameOk() (*string, bool) { - if o == nil || o.PackageName == nil { +func (o *Provider) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { return nil, false } - return o.PackageName, true + return o.Description, true } -// HasPackageName returns a boolean if a field has been set. -func (o *Provider) HasPackageName() bool { - if o != nil && o.PackageName != nil { +// HasDescription returns a boolean if a field has been set. +func (o *Provider) HasDescription() bool { + if o != nil && !IsNil(o.Description) { return true } return false } -// SetPackageName gets a reference to the given string and assigns it to the PackageName field. -func (o *Provider) SetPackageName(v string) { - o.PackageName = &v +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Provider) SetDescription(v string) { + o.Description = &v } -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *Provider) GetDescription() string { - if o == nil || o.Description == nil { +// GetPackageName returns the PackageName field value if set, zero value otherwise. +func (o *Provider) GetPackageName() string { + if o == nil || IsNil(o.PackageName) { var ret string return ret } - return *o.Description + return *o.PackageName } -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// GetPackageNameOk returns a tuple with the PackageName field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Provider) GetDescriptionOk() (*string, bool) { - if o == nil || o.Description == nil { +func (o *Provider) GetPackageNameOk() (*string, bool) { + if o == nil || IsNil(o.PackageName) { return nil, false } - return o.Description, true + return o.PackageName, true } -// HasDescription returns a boolean if a field has been set. -func (o *Provider) HasDescription() bool { - if o != nil && o.Description != nil { +// HasPackageName returns a boolean if a field has been set. +func (o *Provider) HasPackageName() bool { + if o != nil && !IsNil(o.PackageName) { return true } return false } -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *Provider) SetDescription(v string) { - o.Description = &v +// SetPackageName gets a reference to the given string and assigns it to the PackageName field. +func (o *Provider) SetPackageName(v string) { + o.PackageName = &v } // GetVersion returns the Version field value if set, zero value otherwise. func (o *Provider) GetVersion() string { - if o == nil || o.Version == nil { + if o == nil || IsNil(o.Version) { var ret string return ret } @@ -135,7 +121,7 @@ func (o *Provider) GetVersion() string { // GetVersionOk returns a tuple with the Version field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Provider) GetVersionOk() (*string, bool) { - if o == nil || o.Version == nil { + if o == nil || IsNil(o.Version) { return nil, false } return o.Version, true @@ -143,7 +129,7 @@ func (o *Provider) GetVersionOk() (*string, bool) { // HasVersion returns a boolean if a field has been set. func (o *Provider) HasVersion() bool { - if o != nil && o.Version != nil { + if o != nil && !IsNil(o.Version) { return true } @@ -156,17 +142,25 @@ func (o *Provider) SetVersion(v string) { } func (o Provider) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.PackageName != nil { - toSerialize["package_name"] = o.PackageName + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.Description != nil { + return json.Marshal(toSerialize) +} + +func (o Provider) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { toSerialize["description"] = o.Description } - if o.Version != nil { + if !IsNil(o.PackageName) { + toSerialize["package_name"] = o.PackageName + } + if !IsNil(o.Version) { toSerialize["version"] = o.Version } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableProvider struct { diff --git a/airflow/model_provider_collection.go b/airflow/model_provider_collection.go index 6e231ee..1945e7f 100644 --- a/airflow/model_provider_collection.go +++ b/airflow/model_provider_collection.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,9 +15,12 @@ import ( "encoding/json" ) +// checks if the ProviderCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProviderCollection{} + // ProviderCollection Collection of providers. *New in version 2.1.0* type ProviderCollection struct { - Providers *[]Provider `json:"providers,omitempty"` + Providers []Provider `json:"providers,omitempty"` } // NewProviderCollection instantiates a new ProviderCollection object @@ -56,17 +42,17 @@ func NewProviderCollectionWithDefaults() *ProviderCollection { // GetProviders returns the Providers field value if set, zero value otherwise. func (o *ProviderCollection) GetProviders() []Provider { - if o == nil || o.Providers == nil { + if o == nil || IsNil(o.Providers) { var ret []Provider return ret } - return *o.Providers + return o.Providers } // GetProvidersOk returns a tuple with the Providers field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ProviderCollection) GetProvidersOk() (*[]Provider, bool) { - if o == nil || o.Providers == nil { +func (o *ProviderCollection) GetProvidersOk() ([]Provider, bool) { + if o == nil || IsNil(o.Providers) { return nil, false } return o.Providers, true @@ -74,7 +60,7 @@ func (o *ProviderCollection) GetProvidersOk() (*[]Provider, bool) { // HasProviders returns a boolean if a field has been set. func (o *ProviderCollection) HasProviders() bool { - if o != nil && o.Providers != nil { + if o != nil && !IsNil(o.Providers) { return true } @@ -83,15 +69,23 @@ func (o *ProviderCollection) HasProviders() bool { // SetProviders gets a reference to the given []Provider and assigns it to the Providers field. func (o *ProviderCollection) SetProviders(v []Provider) { - o.Providers = &v + o.Providers = v } func (o ProviderCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProviderCollection) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Providers != nil { + if !IsNil(o.Providers) { toSerialize["providers"] = o.Providers } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableProviderCollection struct { diff --git a/airflow/model_queued_event.go b/airflow/model_queued_event.go new file mode 100644 index 0000000..92bd461 --- /dev/null +++ b/airflow/model_queued_event.go @@ -0,0 +1,203 @@ +/* +Airflow API (Stable) + +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. + +API version: 2.10.5 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package airflow + +import ( + "encoding/json" + "time" +) + +// checks if the QueuedEvent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QueuedEvent{} + +// QueuedEvent struct for QueuedEvent +type QueuedEvent struct { + // The creation time of QueuedEvent + CreatedAt *time.Time `json:"created_at,omitempty"` + // The DAG ID. + DagId *string `json:"dag_id,omitempty"` + // The datata uri. + Uri *string `json:"uri,omitempty"` +} + +// NewQueuedEvent instantiates a new QueuedEvent object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewQueuedEvent() *QueuedEvent { + this := QueuedEvent{} + return &this +} + +// NewQueuedEventWithDefaults instantiates a new QueuedEvent object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQueuedEventWithDefaults() *QueuedEvent { + this := QueuedEvent{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *QueuedEvent) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QueuedEvent) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *QueuedEvent) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *QueuedEvent) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDagId returns the DagId field value if set, zero value otherwise. +func (o *QueuedEvent) GetDagId() string { + if o == nil || IsNil(o.DagId) { + var ret string + return ret + } + return *o.DagId +} + +// GetDagIdOk returns a tuple with the DagId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QueuedEvent) GetDagIdOk() (*string, bool) { + if o == nil || IsNil(o.DagId) { + return nil, false + } + return o.DagId, true +} + +// HasDagId returns a boolean if a field has been set. +func (o *QueuedEvent) HasDagId() bool { + if o != nil && !IsNil(o.DagId) { + return true + } + + return false +} + +// SetDagId gets a reference to the given string and assigns it to the DagId field. +func (o *QueuedEvent) SetDagId(v string) { + o.DagId = &v +} + +// GetUri returns the Uri field value if set, zero value otherwise. +func (o *QueuedEvent) GetUri() string { + if o == nil || IsNil(o.Uri) { + var ret string + return ret + } + return *o.Uri +} + +// GetUriOk returns a tuple with the Uri field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QueuedEvent) GetUriOk() (*string, bool) { + if o == nil || IsNil(o.Uri) { + return nil, false + } + return o.Uri, true +} + +// HasUri returns a boolean if a field has been set. +func (o *QueuedEvent) HasUri() bool { + if o != nil && !IsNil(o.Uri) { + return true + } + + return false +} + +// SetUri gets a reference to the given string and assigns it to the Uri field. +func (o *QueuedEvent) SetUri(v string) { + o.Uri = &v +} + +func (o QueuedEvent) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o QueuedEvent) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.DagId) { + toSerialize["dag_id"] = o.DagId + } + if !IsNil(o.Uri) { + toSerialize["uri"] = o.Uri + } + return toSerialize, nil +} + +type NullableQueuedEvent struct { + value *QueuedEvent + isSet bool +} + +func (v NullableQueuedEvent) Get() *QueuedEvent { + return v.value +} + +func (v *NullableQueuedEvent) Set(val *QueuedEvent) { + v.value = val + v.isSet = true +} + +func (v NullableQueuedEvent) IsSet() bool { + return v.isSet +} + +func (v *NullableQueuedEvent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQueuedEvent(val *QueuedEvent) *NullableQueuedEvent { + return &NullableQueuedEvent{value: val, isSet: true} +} + +func (v NullableQueuedEvent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQueuedEvent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/model_queued_event_collection.go b/airflow/model_queued_event_collection.go new file mode 100644 index 0000000..3f0ce8e --- /dev/null +++ b/airflow/model_queued_event_collection.go @@ -0,0 +1,164 @@ +/* +Airflow API (Stable) + +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. + +API version: 2.10.5 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package airflow + +import ( + "encoding/json" +) + +// checks if the QueuedEventCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QueuedEventCollection{} + +// QueuedEventCollection A collection of Dataset Dag Run Queues. *New in version 2.9.0* +type QueuedEventCollection struct { + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. + TotalEntries *int32 `json:"total_entries,omitempty"` + Datasets []QueuedEvent `json:"datasets,omitempty"` +} + +// NewQueuedEventCollection instantiates a new QueuedEventCollection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewQueuedEventCollection() *QueuedEventCollection { + this := QueuedEventCollection{} + return &this +} + +// NewQueuedEventCollectionWithDefaults instantiates a new QueuedEventCollection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQueuedEventCollectionWithDefaults() *QueuedEventCollection { + this := QueuedEventCollection{} + return &this +} + +// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. +func (o *QueuedEventCollection) GetTotalEntries() int32 { + if o == nil || IsNil(o.TotalEntries) { + var ret int32 + return ret + } + return *o.TotalEntries +} + +// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QueuedEventCollection) GetTotalEntriesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalEntries) { + return nil, false + } + return o.TotalEntries, true +} + +// HasTotalEntries returns a boolean if a field has been set. +func (o *QueuedEventCollection) HasTotalEntries() bool { + if o != nil && !IsNil(o.TotalEntries) { + return true + } + + return false +} + +// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. +func (o *QueuedEventCollection) SetTotalEntries(v int32) { + o.TotalEntries = &v +} + +// GetDatasets returns the Datasets field value if set, zero value otherwise. +func (o *QueuedEventCollection) GetDatasets() []QueuedEvent { + if o == nil || IsNil(o.Datasets) { + var ret []QueuedEvent + return ret + } + return o.Datasets +} + +// GetDatasetsOk returns a tuple with the Datasets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *QueuedEventCollection) GetDatasetsOk() ([]QueuedEvent, bool) { + if o == nil || IsNil(o.Datasets) { + return nil, false + } + return o.Datasets, true +} + +// HasDatasets returns a boolean if a field has been set. +func (o *QueuedEventCollection) HasDatasets() bool { + if o != nil && !IsNil(o.Datasets) { + return true + } + + return false +} + +// SetDatasets gets a reference to the given []QueuedEvent and assigns it to the Datasets field. +func (o *QueuedEventCollection) SetDatasets(v []QueuedEvent) { + o.Datasets = v +} + +func (o QueuedEventCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o QueuedEventCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalEntries) { + toSerialize["total_entries"] = o.TotalEntries + } + if !IsNil(o.Datasets) { + toSerialize["datasets"] = o.Datasets + } + return toSerialize, nil +} + +type NullableQueuedEventCollection struct { + value *QueuedEventCollection + isSet bool +} + +func (v NullableQueuedEventCollection) Get() *QueuedEventCollection { + return v.value +} + +func (v *NullableQueuedEventCollection) Set(val *QueuedEventCollection) { + v.value = val + v.isSet = true +} + +func (v NullableQueuedEventCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableQueuedEventCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQueuedEventCollection(val *QueuedEventCollection) *NullableQueuedEventCollection { + return &NullableQueuedEventCollection{value: val, isSet: true} +} + +func (v NullableQueuedEventCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQueuedEventCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/model_relative_delta.go b/airflow/model_relative_delta.go index ebbba1c..192c034 100644 --- a/airflow/model_relative_delta.go +++ b/airflow/model_relative_delta.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -30,50 +13,57 @@ package airflow import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the RelativeDelta type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RelativeDelta{} + // RelativeDelta Relative delta type RelativeDelta struct { Type string `json:"__type"` - Years int32 `json:"years"` - Months int32 `json:"months"` + Day int32 `json:"day"` Days int32 `json:"days"` - Leapdays int32 `json:"leapdays"` + Hour int32 `json:"hour"` Hours int32 `json:"hours"` - Minutes int32 `json:"minutes"` - Seconds int32 `json:"seconds"` + Leapdays int32 `json:"leapdays"` + Microsecond int32 `json:"microsecond"` Microseconds int32 `json:"microseconds"` - Year int32 `json:"year"` - Month int32 `json:"month"` - Day int32 `json:"day"` - Hour int32 `json:"hour"` Minute int32 `json:"minute"` + Minutes int32 `json:"minutes"` + Month int32 `json:"month"` + Months int32 `json:"months"` Second int32 `json:"second"` - Microsecond int32 `json:"microsecond"` + Seconds int32 `json:"seconds"` + Year int32 `json:"year"` + Years int32 `json:"years"` } +type _RelativeDelta RelativeDelta + // NewRelativeDelta instantiates a new RelativeDelta object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewRelativeDelta(type_ string, years int32, months int32, days int32, leapdays int32, hours int32, minutes int32, seconds int32, microseconds int32, year int32, month int32, day int32, hour int32, minute int32, second int32, microsecond int32) *RelativeDelta { +func NewRelativeDelta(type_ string, day int32, days int32, hour int32, hours int32, leapdays int32, microsecond int32, microseconds int32, minute int32, minutes int32, month int32, months int32, second int32, seconds int32, year int32, years int32) *RelativeDelta { this := RelativeDelta{} this.Type = type_ - this.Years = years - this.Months = months + this.Day = day this.Days = days - this.Leapdays = leapdays + this.Hour = hour this.Hours = hours - this.Minutes = minutes - this.Seconds = seconds + this.Leapdays = leapdays + this.Microsecond = microsecond this.Microseconds = microseconds - this.Year = year - this.Month = month - this.Day = day - this.Hour = hour this.Minute = minute + this.Minutes = minutes + this.Month = month + this.Months = months this.Second = second - this.Microsecond = microsecond + this.Seconds = seconds + this.Year = year + this.Years = years return &this } @@ -98,7 +88,7 @@ func (o *RelativeDelta) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *RelativeDelta) GetTypeOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Type, true @@ -109,52 +99,28 @@ func (o *RelativeDelta) SetType(v string) { o.Type = v } -// GetYears returns the Years field value -func (o *RelativeDelta) GetYears() int32 { +// GetDay returns the Day field value +func (o *RelativeDelta) GetDay() int32 { if o == nil { var ret int32 return ret } - return o.Years + return o.Day } -// GetYearsOk returns a tuple with the Years field value +// GetDayOk returns a tuple with the Day field value // and a boolean to check if the value has been set. -func (o *RelativeDelta) GetYearsOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Years, true -} - -// SetYears sets field value -func (o *RelativeDelta) SetYears(v int32) { - o.Years = v -} - -// GetMonths returns the Months field value -func (o *RelativeDelta) GetMonths() int32 { +func (o *RelativeDelta) GetDayOk() (*int32, bool) { if o == nil { - var ret int32 - return ret - } - - return o.Months -} - -// GetMonthsOk returns a tuple with the Months field value -// and a boolean to check if the value has been set. -func (o *RelativeDelta) GetMonthsOk() (*int32, bool) { - if o == nil { return nil, false } - return &o.Months, true + return &o.Day, true } -// SetMonths sets field value -func (o *RelativeDelta) SetMonths(v int32) { - o.Months = v +// SetDay sets field value +func (o *RelativeDelta) SetDay(v int32) { + o.Day = v } // GetDays returns the Days field value @@ -170,7 +136,7 @@ func (o *RelativeDelta) GetDays() int32 { // GetDaysOk returns a tuple with the Days field value // and a boolean to check if the value has been set. func (o *RelativeDelta) GetDaysOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Days, true @@ -181,28 +147,28 @@ func (o *RelativeDelta) SetDays(v int32) { o.Days = v } -// GetLeapdays returns the Leapdays field value -func (o *RelativeDelta) GetLeapdays() int32 { +// GetHour returns the Hour field value +func (o *RelativeDelta) GetHour() int32 { if o == nil { var ret int32 return ret } - return o.Leapdays + return o.Hour } -// GetLeapdaysOk returns a tuple with the Leapdays field value +// GetHourOk returns a tuple with the Hour field value // and a boolean to check if the value has been set. -func (o *RelativeDelta) GetLeapdaysOk() (*int32, bool) { - if o == nil { +func (o *RelativeDelta) GetHourOk() (*int32, bool) { + if o == nil { return nil, false } - return &o.Leapdays, true + return &o.Hour, true } -// SetLeapdays sets field value -func (o *RelativeDelta) SetLeapdays(v int32) { - o.Leapdays = v +// SetHour sets field value +func (o *RelativeDelta) SetHour(v int32) { + o.Hour = v } // GetHours returns the Hours field value @@ -218,7 +184,7 @@ func (o *RelativeDelta) GetHours() int32 { // GetHoursOk returns a tuple with the Hours field value // and a boolean to check if the value has been set. func (o *RelativeDelta) GetHoursOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Hours, true @@ -229,52 +195,52 @@ func (o *RelativeDelta) SetHours(v int32) { o.Hours = v } -// GetMinutes returns the Minutes field value -func (o *RelativeDelta) GetMinutes() int32 { +// GetLeapdays returns the Leapdays field value +func (o *RelativeDelta) GetLeapdays() int32 { if o == nil { var ret int32 return ret } - return o.Minutes + return o.Leapdays } -// GetMinutesOk returns a tuple with the Minutes field value +// GetLeapdaysOk returns a tuple with the Leapdays field value // and a boolean to check if the value has been set. -func (o *RelativeDelta) GetMinutesOk() (*int32, bool) { - if o == nil { +func (o *RelativeDelta) GetLeapdaysOk() (*int32, bool) { + if o == nil { return nil, false } - return &o.Minutes, true + return &o.Leapdays, true } -// SetMinutes sets field value -func (o *RelativeDelta) SetMinutes(v int32) { - o.Minutes = v +// SetLeapdays sets field value +func (o *RelativeDelta) SetLeapdays(v int32) { + o.Leapdays = v } -// GetSeconds returns the Seconds field value -func (o *RelativeDelta) GetSeconds() int32 { +// GetMicrosecond returns the Microsecond field value +func (o *RelativeDelta) GetMicrosecond() int32 { if o == nil { var ret int32 return ret } - return o.Seconds + return o.Microsecond } -// GetSecondsOk returns a tuple with the Seconds field value +// GetMicrosecondOk returns a tuple with the Microsecond field value // and a boolean to check if the value has been set. -func (o *RelativeDelta) GetSecondsOk() (*int32, bool) { - if o == nil { +func (o *RelativeDelta) GetMicrosecondOk() (*int32, bool) { + if o == nil { return nil, false } - return &o.Seconds, true + return &o.Microsecond, true } -// SetSeconds sets field value -func (o *RelativeDelta) SetSeconds(v int32) { - o.Seconds = v +// SetMicrosecond sets field value +func (o *RelativeDelta) SetMicrosecond(v int32) { + o.Microsecond = v } // GetMicroseconds returns the Microseconds field value @@ -290,7 +256,7 @@ func (o *RelativeDelta) GetMicroseconds() int32 { // GetMicrosecondsOk returns a tuple with the Microseconds field value // and a boolean to check if the value has been set. func (o *RelativeDelta) GetMicrosecondsOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Microseconds, true @@ -301,28 +267,52 @@ func (o *RelativeDelta) SetMicroseconds(v int32) { o.Microseconds = v } -// GetYear returns the Year field value -func (o *RelativeDelta) GetYear() int32 { +// GetMinute returns the Minute field value +func (o *RelativeDelta) GetMinute() int32 { if o == nil { var ret int32 return ret } - return o.Year + return o.Minute } -// GetYearOk returns a tuple with the Year field value +// GetMinuteOk returns a tuple with the Minute field value // and a boolean to check if the value has been set. -func (o *RelativeDelta) GetYearOk() (*int32, bool) { - if o == nil { +func (o *RelativeDelta) GetMinuteOk() (*int32, bool) { + if o == nil { return nil, false } - return &o.Year, true + return &o.Minute, true } -// SetYear sets field value -func (o *RelativeDelta) SetYear(v int32) { - o.Year = v +// SetMinute sets field value +func (o *RelativeDelta) SetMinute(v int32) { + o.Minute = v +} + +// GetMinutes returns the Minutes field value +func (o *RelativeDelta) GetMinutes() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Minutes +} + +// GetMinutesOk returns a tuple with the Minutes field value +// and a boolean to check if the value has been set. +func (o *RelativeDelta) GetMinutesOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Minutes, true +} + +// SetMinutes sets field value +func (o *RelativeDelta) SetMinutes(v int32) { + o.Minutes = v } // GetMonth returns the Month field value @@ -338,7 +328,7 @@ func (o *RelativeDelta) GetMonth() int32 { // GetMonthOk returns a tuple with the Month field value // and a boolean to check if the value has been set. func (o *RelativeDelta) GetMonthOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Month, true @@ -349,179 +339,207 @@ func (o *RelativeDelta) SetMonth(v int32) { o.Month = v } -// GetDay returns the Day field value -func (o *RelativeDelta) GetDay() int32 { +// GetMonths returns the Months field value +func (o *RelativeDelta) GetMonths() int32 { if o == nil { var ret int32 return ret } - return o.Day + return o.Months } -// GetDayOk returns a tuple with the Day field value +// GetMonthsOk returns a tuple with the Months field value // and a boolean to check if the value has been set. -func (o *RelativeDelta) GetDayOk() (*int32, bool) { - if o == nil { +func (o *RelativeDelta) GetMonthsOk() (*int32, bool) { + if o == nil { return nil, false } - return &o.Day, true + return &o.Months, true } -// SetDay sets field value -func (o *RelativeDelta) SetDay(v int32) { - o.Day = v +// SetMonths sets field value +func (o *RelativeDelta) SetMonths(v int32) { + o.Months = v } -// GetHour returns the Hour field value -func (o *RelativeDelta) GetHour() int32 { +// GetSecond returns the Second field value +func (o *RelativeDelta) GetSecond() int32 { if o == nil { var ret int32 return ret } - return o.Hour + return o.Second } -// GetHourOk returns a tuple with the Hour field value +// GetSecondOk returns a tuple with the Second field value // and a boolean to check if the value has been set. -func (o *RelativeDelta) GetHourOk() (*int32, bool) { - if o == nil { +func (o *RelativeDelta) GetSecondOk() (*int32, bool) { + if o == nil { return nil, false } - return &o.Hour, true + return &o.Second, true } -// SetHour sets field value -func (o *RelativeDelta) SetHour(v int32) { - o.Hour = v +// SetSecond sets field value +func (o *RelativeDelta) SetSecond(v int32) { + o.Second = v } -// GetMinute returns the Minute field value -func (o *RelativeDelta) GetMinute() int32 { +// GetSeconds returns the Seconds field value +func (o *RelativeDelta) GetSeconds() int32 { if o == nil { var ret int32 return ret } - return o.Minute + return o.Seconds } -// GetMinuteOk returns a tuple with the Minute field value +// GetSecondsOk returns a tuple with the Seconds field value // and a boolean to check if the value has been set. -func (o *RelativeDelta) GetMinuteOk() (*int32, bool) { - if o == nil { +func (o *RelativeDelta) GetSecondsOk() (*int32, bool) { + if o == nil { return nil, false } - return &o.Minute, true + return &o.Seconds, true } -// SetMinute sets field value -func (o *RelativeDelta) SetMinute(v int32) { - o.Minute = v +// SetSeconds sets field value +func (o *RelativeDelta) SetSeconds(v int32) { + o.Seconds = v } -// GetSecond returns the Second field value -func (o *RelativeDelta) GetSecond() int32 { +// GetYear returns the Year field value +func (o *RelativeDelta) GetYear() int32 { if o == nil { var ret int32 return ret } - return o.Second + return o.Year } -// GetSecondOk returns a tuple with the Second field value +// GetYearOk returns a tuple with the Year field value // and a boolean to check if the value has been set. -func (o *RelativeDelta) GetSecondOk() (*int32, bool) { - if o == nil { +func (o *RelativeDelta) GetYearOk() (*int32, bool) { + if o == nil { return nil, false } - return &o.Second, true + return &o.Year, true } -// SetSecond sets field value -func (o *RelativeDelta) SetSecond(v int32) { - o.Second = v +// SetYear sets field value +func (o *RelativeDelta) SetYear(v int32) { + o.Year = v } -// GetMicrosecond returns the Microsecond field value -func (o *RelativeDelta) GetMicrosecond() int32 { +// GetYears returns the Years field value +func (o *RelativeDelta) GetYears() int32 { if o == nil { var ret int32 return ret } - return o.Microsecond + return o.Years } -// GetMicrosecondOk returns a tuple with the Microsecond field value +// GetYearsOk returns a tuple with the Years field value // and a boolean to check if the value has been set. -func (o *RelativeDelta) GetMicrosecondOk() (*int32, bool) { - if o == nil { +func (o *RelativeDelta) GetYearsOk() (*int32, bool) { + if o == nil { return nil, false } - return &o.Microsecond, true + return &o.Years, true } -// SetMicrosecond sets field value -func (o *RelativeDelta) SetMicrosecond(v int32) { - o.Microsecond = v +// SetYears sets field value +func (o *RelativeDelta) SetYears(v int32) { + o.Years = v } func (o RelativeDelta) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["__type"] = o.Type - } - if true { - toSerialize["years"] = o.Years - } - if true { - toSerialize["months"] = o.Months - } - if true { - toSerialize["days"] = o.Days - } - if true { - toSerialize["leapdays"] = o.Leapdays - } - if true { - toSerialize["hours"] = o.Hours - } - if true { - toSerialize["minutes"] = o.Minutes - } - if true { - toSerialize["seconds"] = o.Seconds - } - if true { - toSerialize["microseconds"] = o.Microseconds - } - if true { - toSerialize["year"] = o.Year - } - if true { - toSerialize["month"] = o.Month - } - if true { - toSerialize["day"] = o.Day - } - if true { - toSerialize["hour"] = o.Hour - } - if true { - toSerialize["minute"] = o.Minute - } - if true { - toSerialize["second"] = o.Second - } - if true { - toSerialize["microsecond"] = o.Microsecond + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o RelativeDelta) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["__type"] = o.Type + toSerialize["day"] = o.Day + toSerialize["days"] = o.Days + toSerialize["hour"] = o.Hour + toSerialize["hours"] = o.Hours + toSerialize["leapdays"] = o.Leapdays + toSerialize["microsecond"] = o.Microsecond + toSerialize["microseconds"] = o.Microseconds + toSerialize["minute"] = o.Minute + toSerialize["minutes"] = o.Minutes + toSerialize["month"] = o.Month + toSerialize["months"] = o.Months + toSerialize["second"] = o.Second + toSerialize["seconds"] = o.Seconds + toSerialize["year"] = o.Year + toSerialize["years"] = o.Years + return toSerialize, nil +} + +func (o *RelativeDelta) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "__type", + "day", + "days", + "hour", + "hours", + "leapdays", + "microsecond", + "microseconds", + "minute", + "minutes", + "month", + "months", + "second", + "seconds", + "year", + "years", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRelativeDelta := _RelativeDelta{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRelativeDelta) + + if err != nil { + return err + } + + *o = RelativeDelta(varRelativeDelta) + + return err +} + type NullableRelativeDelta struct { value *RelativeDelta isSet bool diff --git a/airflow/model_resource.go b/airflow/model_resource.go index b1eda8a..9f04d19 100644 --- a/airflow/model_resource.go +++ b/airflow/model_resource.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,6 +15,9 @@ import ( "encoding/json" ) +// checks if the Resource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Resource{} + // Resource A resource on which permissions are granted. *New in version 2.1.0* type Resource struct { // The name of the resource @@ -57,7 +43,7 @@ func NewResourceWithDefaults() *Resource { // GetName returns the Name field value if set, zero value otherwise. func (o *Resource) GetName() string { - if o == nil || o.Name == nil { + if o == nil || IsNil(o.Name) { var ret string return ret } @@ -67,7 +53,7 @@ func (o *Resource) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Resource) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { + if o == nil || IsNil(o.Name) { return nil, false } return o.Name, true @@ -75,7 +61,7 @@ func (o *Resource) GetNameOk() (*string, bool) { // HasName returns a boolean if a field has been set. func (o *Resource) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !IsNil(o.Name) { return true } @@ -88,11 +74,19 @@ func (o *Resource) SetName(v string) { } func (o Resource) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Resource) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { + if !IsNil(o.Name) { toSerialize["name"] = o.Name } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableResource struct { diff --git a/airflow/model_role.go b/airflow/model_role.go index dea0413..1fe1e00 100644 --- a/airflow/model_role.go +++ b/airflow/model_role.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,11 +15,14 @@ import ( "encoding/json" ) +// checks if the Role type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Role{} + // Role a role item. *New in version 2.1.0* type Role struct { + Actions []ActionResource `json:"actions,omitempty"` // The name of the role *Changed in version 2.3.0*: A minimum character length requirement ('minLength') is added. Name *string `json:"name,omitempty"` - Actions *[]ActionResource `json:"actions,omitempty"` } // NewRole instantiates a new Role object @@ -56,79 +42,87 @@ func NewRoleWithDefaults() *Role { return &this } -// GetName returns the Name field value if set, zero value otherwise. -func (o *Role) GetName() string { - if o == nil || o.Name == nil { - var ret string +// GetActions returns the Actions field value if set, zero value otherwise. +func (o *Role) GetActions() []ActionResource { + if o == nil || IsNil(o.Actions) { + var ret []ActionResource return ret } - return *o.Name + return o.Actions } -// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// GetActionsOk returns a tuple with the Actions field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Role) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { +func (o *Role) GetActionsOk() ([]ActionResource, bool) { + if o == nil || IsNil(o.Actions) { return nil, false } - return o.Name, true + return o.Actions, true } -// HasName returns a boolean if a field has been set. -func (o *Role) HasName() bool { - if o != nil && o.Name != nil { +// HasActions returns a boolean if a field has been set. +func (o *Role) HasActions() bool { + if o != nil && !IsNil(o.Actions) { return true } return false } -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *Role) SetName(v string) { - o.Name = &v +// SetActions gets a reference to the given []ActionResource and assigns it to the Actions field. +func (o *Role) SetActions(v []ActionResource) { + o.Actions = v } -// GetActions returns the Actions field value if set, zero value otherwise. -func (o *Role) GetActions() []ActionResource { - if o == nil || o.Actions == nil { - var ret []ActionResource +// GetName returns the Name field value if set, zero value otherwise. +func (o *Role) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string return ret } - return *o.Actions + return *o.Name } -// GetActionsOk returns a tuple with the Actions field value if set, nil otherwise +// GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Role) GetActionsOk() (*[]ActionResource, bool) { - if o == nil || o.Actions == nil { +func (o *Role) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { return nil, false } - return o.Actions, true + return o.Name, true } -// HasActions returns a boolean if a field has been set. -func (o *Role) HasActions() bool { - if o != nil && o.Actions != nil { +// HasName returns a boolean if a field has been set. +func (o *Role) HasName() bool { + if o != nil && !IsNil(o.Name) { return true } return false } -// SetActions gets a reference to the given []ActionResource and assigns it to the Actions field. -func (o *Role) SetActions(v []ActionResource) { - o.Actions = &v +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Role) SetName(v string) { + o.Name = &v } func (o Role) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Name != nil { - toSerialize["name"] = o.Name + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.Actions != nil { + return json.Marshal(toSerialize) +} + +func (o Role) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Actions) { toSerialize["actions"] = o.Actions } - return json.Marshal(toSerialize) + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil } type NullableRole struct { diff --git a/airflow/model_role_collection.go b/airflow/model_role_collection.go index 454c997..0d67c43 100644 --- a/airflow/model_role_collection.go +++ b/airflow/model_role_collection.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,11 +15,14 @@ import ( "encoding/json" ) +// checks if the RoleCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RoleCollection{} + // RoleCollection A collection of roles. *New in version 2.1.0* type RoleCollection struct { - Roles *[]Role `json:"roles,omitempty"` - // Count of objects in the current result set. + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. TotalEntries *int32 `json:"total_entries,omitempty"` + Roles []Role `json:"roles,omitempty"` } // NewRoleCollection instantiates a new RoleCollection object @@ -56,79 +42,87 @@ func NewRoleCollectionWithDefaults() *RoleCollection { return &this } -// GetRoles returns the Roles field value if set, zero value otherwise. -func (o *RoleCollection) GetRoles() []Role { - if o == nil || o.Roles == nil { - var ret []Role +// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. +func (o *RoleCollection) GetTotalEntries() int32 { + if o == nil || IsNil(o.TotalEntries) { + var ret int32 return ret } - return *o.Roles + return *o.TotalEntries } -// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *RoleCollection) GetRolesOk() (*[]Role, bool) { - if o == nil || o.Roles == nil { +func (o *RoleCollection) GetTotalEntriesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalEntries) { return nil, false } - return o.Roles, true + return o.TotalEntries, true } -// HasRoles returns a boolean if a field has been set. -func (o *RoleCollection) HasRoles() bool { - if o != nil && o.Roles != nil { +// HasTotalEntries returns a boolean if a field has been set. +func (o *RoleCollection) HasTotalEntries() bool { + if o != nil && !IsNil(o.TotalEntries) { return true } return false } -// SetRoles gets a reference to the given []Role and assigns it to the Roles field. -func (o *RoleCollection) SetRoles(v []Role) { - o.Roles = &v +// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. +func (o *RoleCollection) SetTotalEntries(v int32) { + o.TotalEntries = &v } -// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. -func (o *RoleCollection) GetTotalEntries() int32 { - if o == nil || o.TotalEntries == nil { - var ret int32 +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *RoleCollection) GetRoles() []Role { + if o == nil || IsNil(o.Roles) { + var ret []Role return ret } - return *o.TotalEntries + return o.Roles } -// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *RoleCollection) GetTotalEntriesOk() (*int32, bool) { - if o == nil || o.TotalEntries == nil { +func (o *RoleCollection) GetRolesOk() ([]Role, bool) { + if o == nil || IsNil(o.Roles) { return nil, false } - return o.TotalEntries, true + return o.Roles, true } -// HasTotalEntries returns a boolean if a field has been set. -func (o *RoleCollection) HasTotalEntries() bool { - if o != nil && o.TotalEntries != nil { +// HasRoles returns a boolean if a field has been set. +func (o *RoleCollection) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { return true } return false } -// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. -func (o *RoleCollection) SetTotalEntries(v int32) { - o.TotalEntries = &v +// SetRoles gets a reference to the given []Role and assigns it to the Roles field. +func (o *RoleCollection) SetRoles(v []Role) { + o.Roles = v } func (o RoleCollection) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Roles != nil { - toSerialize["roles"] = o.Roles + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.TotalEntries != nil { + return json.Marshal(toSerialize) +} + +func (o RoleCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalEntries) { toSerialize["total_entries"] = o.TotalEntries } - return json.Marshal(toSerialize) + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + return toSerialize, nil } type NullableRoleCollection struct { diff --git a/airflow/model_schedule_interval.go b/airflow/model_schedule_interval.go index b118247..2311041 100644 --- a/airflow/model_schedule_interval.go +++ b/airflow/model_schedule_interval.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -33,6 +16,9 @@ import ( "fmt" ) +// checks if the ScheduleInterval type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ScheduleInterval{} + // ScheduleInterval Schedule interval. Defines how often DAG runs, this object gets added to your latest task instance's execution_date to figure out the next schedule. type ScheduleInterval struct { CronExpression *CronExpression @@ -52,7 +38,7 @@ func (dst *ScheduleInterval) UnmarshalJSON(data []byte) error { var jsonDict map[string]interface{} err = json.Unmarshal(data, &jsonDict) if err != nil { - return fmt.Errorf("Failed to unmarshal JSON into map for the discriminator lookup.") + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") } // check if the discriminator value is 'CronExpression' @@ -142,11 +128,11 @@ func (dst *ScheduleInterval) UnmarshalJSON(data []byte) error { dst.TimeDelta = nil } - return fmt.Errorf("Data failed to match schemas in anyOf(ScheduleInterval)") + return fmt.Errorf("data failed to match schemas in anyOf(ScheduleInterval)") } // Marshal data from the first non-nil pointers in the struct to JSON -func (src *ScheduleInterval) MarshalJSON() ([]byte, error) { +func (src ScheduleInterval) MarshalJSON() ([]byte, error) { if src.CronExpression != nil { return json.Marshal(&src.CronExpression) } @@ -162,6 +148,22 @@ func (src *ScheduleInterval) MarshalJSON() ([]byte, error) { return nil, nil // no data in anyOf schemas } +func (src ScheduleInterval) ToMap() (map[string]interface{}, error) { + if src.CronExpression != nil { + return src.CronExpression.ToMap() + } + + if src.RelativeDelta != nil { + return src.RelativeDelta.ToMap() + } + + if src.TimeDelta != nil { + return src.TimeDelta.ToMap() + } + + return nil, nil // no data in anyOf schemas +} + type NullableScheduleInterval struct { value *ScheduleInterval isSet bool diff --git a/airflow/model_scheduler_status.go b/airflow/model_scheduler_status.go index 012fd5d..19150cd 100644 --- a/airflow/model_scheduler_status.go +++ b/airflow/model_scheduler_status.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,11 +15,14 @@ import ( "encoding/json" ) +// checks if the SchedulerStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SchedulerStatus{} + // SchedulerStatus The status and the latest scheduler heartbeat. type SchedulerStatus struct { - Status *HealthStatus `json:"status,omitempty"` - // The time the scheduler last do a heartbeat. + // The time the scheduler last did a heartbeat. LatestSchedulerHeartbeat NullableString `json:"latest_scheduler_heartbeat,omitempty"` + Status NullableHealthStatus `json:"status,omitempty"` } // NewSchedulerStatus instantiates a new SchedulerStatus object @@ -56,41 +42,9 @@ func NewSchedulerStatusWithDefaults() *SchedulerStatus { return &this } -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *SchedulerStatus) GetStatus() HealthStatus { - if o == nil || o.Status == nil { - var ret HealthStatus - return ret - } - return *o.Status -} - -// GetStatusOk returns a tuple with the Status field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SchedulerStatus) GetStatusOk() (*HealthStatus, bool) { - if o == nil || o.Status == nil { - return nil, false - } - return o.Status, true -} - -// HasStatus returns a boolean if a field has been set. -func (o *SchedulerStatus) HasStatus() bool { - if o != nil && o.Status != nil { - return true - } - - return false -} - -// SetStatus gets a reference to the given HealthStatus and assigns it to the Status field. -func (o *SchedulerStatus) SetStatus(v HealthStatus) { - o.Status = &v -} - // GetLatestSchedulerHeartbeat returns the LatestSchedulerHeartbeat field value if set, zero value otherwise (both if not set or set to explicit null). func (o *SchedulerStatus) GetLatestSchedulerHeartbeat() string { - if o == nil || o.LatestSchedulerHeartbeat.Get() == nil { + if o == nil || IsNil(o.LatestSchedulerHeartbeat.Get()) { var ret string return ret } @@ -101,7 +55,7 @@ func (o *SchedulerStatus) GetLatestSchedulerHeartbeat() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *SchedulerStatus) GetLatestSchedulerHeartbeatOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.LatestSchedulerHeartbeat.Get(), o.LatestSchedulerHeartbeat.IsSet() @@ -130,15 +84,65 @@ func (o *SchedulerStatus) UnsetLatestSchedulerHeartbeat() { o.LatestSchedulerHeartbeat.Unset() } +// GetStatus returns the Status field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SchedulerStatus) GetStatus() HealthStatus { + if o == nil || IsNil(o.Status.Get()) { + var ret HealthStatus + return ret + } + return *o.Status.Get() +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SchedulerStatus) GetStatusOk() (*HealthStatus, bool) { + if o == nil { + return nil, false + } + return o.Status.Get(), o.Status.IsSet() +} + +// HasStatus returns a boolean if a field has been set. +func (o *SchedulerStatus) HasStatus() bool { + if o != nil && o.Status.IsSet() { + return true + } + + return false +} + +// SetStatus gets a reference to the given NullableHealthStatus and assigns it to the Status field. +func (o *SchedulerStatus) SetStatus(v HealthStatus) { + o.Status.Set(&v) +} +// SetStatusNil sets the value for Status to be an explicit nil +func (o *SchedulerStatus) SetStatusNil() { + o.Status.Set(nil) +} + +// UnsetStatus ensures that no value is present for Status, not even an explicit nil +func (o *SchedulerStatus) UnsetStatus() { + o.Status.Unset() +} + func (o SchedulerStatus) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Status != nil { - toSerialize["status"] = o.Status + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o SchedulerStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} if o.LatestSchedulerHeartbeat.IsSet() { toSerialize["latest_scheduler_heartbeat"] = o.LatestSchedulerHeartbeat.Get() } - return json.Marshal(toSerialize) + if o.Status.IsSet() { + toSerialize["status"] = o.Status.Get() + } + return toSerialize, nil } type NullableSchedulerStatus struct { diff --git a/airflow/model_set_dag_run_note.go b/airflow/model_set_dag_run_note.go index d750532..8f36d67 100644 --- a/airflow/model_set_dag_run_note.go +++ b/airflow/model_set_dag_run_note.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,6 +15,9 @@ import ( "encoding/json" ) +// checks if the SetDagRunNote type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetDagRunNote{} + // SetDagRunNote struct for SetDagRunNote type SetDagRunNote struct { // Custom notes left by users for this Dag Run. @@ -57,7 +43,7 @@ func NewSetDagRunNoteWithDefaults() *SetDagRunNote { // GetNote returns the Note field value if set, zero value otherwise. func (o *SetDagRunNote) GetNote() string { - if o == nil || o.Note == nil { + if o == nil || IsNil(o.Note) { var ret string return ret } @@ -67,7 +53,7 @@ func (o *SetDagRunNote) GetNote() string { // GetNoteOk returns a tuple with the Note field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SetDagRunNote) GetNoteOk() (*string, bool) { - if o == nil || o.Note == nil { + if o == nil || IsNil(o.Note) { return nil, false } return o.Note, true @@ -75,7 +61,7 @@ func (o *SetDagRunNote) GetNoteOk() (*string, bool) { // HasNote returns a boolean if a field has been set. func (o *SetDagRunNote) HasNote() bool { - if o != nil && o.Note != nil { + if o != nil && !IsNil(o.Note) { return true } @@ -88,11 +74,19 @@ func (o *SetDagRunNote) SetNote(v string) { } func (o SetDagRunNote) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetDagRunNote) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Note != nil { + if !IsNil(o.Note) { toSerialize["note"] = o.Note } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableSetDagRunNote struct { diff --git a/airflow/model_set_task_instance_note.go b/airflow/model_set_task_instance_note.go index ed7343f..2dc1edd 100644 --- a/airflow/model_set_task_instance_note.go +++ b/airflow/model_set_task_instance_note.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -30,14 +13,21 @@ package airflow import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the SetTaskInstanceNote type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetTaskInstanceNote{} + // SetTaskInstanceNote struct for SetTaskInstanceNote type SetTaskInstanceNote struct { // The custom note to set for this Task Instance. Note string `json:"note"` } +type _SetTaskInstanceNote SetTaskInstanceNote + // NewSetTaskInstanceNote instantiates a new SetTaskInstanceNote object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -69,7 +59,7 @@ func (o *SetTaskInstanceNote) GetNote() string { // GetNoteOk returns a tuple with the Note field value // and a boolean to check if the value has been set. func (o *SetTaskInstanceNote) GetNoteOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Note, true @@ -81,13 +71,56 @@ func (o *SetTaskInstanceNote) SetNote(v string) { } func (o SetTaskInstanceNote) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["note"] = o.Note + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } return json.Marshal(toSerialize) } +func (o SetTaskInstanceNote) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["note"] = o.Note + return toSerialize, nil +} + +func (o *SetTaskInstanceNote) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "note", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSetTaskInstanceNote := _SetTaskInstanceNote{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSetTaskInstanceNote) + + if err != nil { + return err + } + + *o = SetTaskInstanceNote(varSetTaskInstanceNote) + + return err +} + type NullableSetTaskInstanceNote struct { value *SetTaskInstanceNote isSet bool diff --git a/airflow/model_sla_miss.go b/airflow/model_sla_miss.go index f35e426..39b7b2b 100644 --- a/airflow/model_sla_miss.go +++ b/airflow/model_sla_miss.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,17 +15,20 @@ import ( "encoding/json" ) +// checks if the SLAMiss type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SLAMiss{} + // SLAMiss struct for SLAMiss type SLAMiss struct { - // The task ID. - TaskId *string `json:"task_id,omitempty"` // The DAG ID. DagId *string `json:"dag_id,omitempty"` - ExecutionDate *string `json:"execution_date,omitempty"` - EmailSent *bool `json:"email_sent,omitempty"` - Timestamp *string `json:"timestamp,omitempty"` Description NullableString `json:"description,omitempty"` + EmailSent *bool `json:"email_sent,omitempty"` + ExecutionDate *string `json:"execution_date,omitempty"` NotificationSent *bool `json:"notification_sent,omitempty"` + // The task ID. + TaskId *string `json:"task_id,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` } // NewSLAMiss instantiates a new SLAMiss object @@ -62,41 +48,9 @@ func NewSLAMissWithDefaults() *SLAMiss { return &this } -// GetTaskId returns the TaskId field value if set, zero value otherwise. -func (o *SLAMiss) GetTaskId() string { - if o == nil || o.TaskId == nil { - var ret string - return ret - } - return *o.TaskId -} - -// GetTaskIdOk returns a tuple with the TaskId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SLAMiss) GetTaskIdOk() (*string, bool) { - if o == nil || o.TaskId == nil { - return nil, false - } - return o.TaskId, true -} - -// HasTaskId returns a boolean if a field has been set. -func (o *SLAMiss) HasTaskId() bool { - if o != nil && o.TaskId != nil { - return true - } - - return false -} - -// SetTaskId gets a reference to the given string and assigns it to the TaskId field. -func (o *SLAMiss) SetTaskId(v string) { - o.TaskId = &v -} - // GetDagId returns the DagId field value if set, zero value otherwise. func (o *SLAMiss) GetDagId() string { - if o == nil || o.DagId == nil { + if o == nil || IsNil(o.DagId) { var ret string return ret } @@ -106,7 +60,7 @@ func (o *SLAMiss) GetDagId() string { // GetDagIdOk returns a tuple with the DagId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SLAMiss) GetDagIdOk() (*string, bool) { - if o == nil || o.DagId == nil { + if o == nil || IsNil(o.DagId) { return nil, false } return o.DagId, true @@ -114,7 +68,7 @@ func (o *SLAMiss) GetDagIdOk() (*string, bool) { // HasDagId returns a boolean if a field has been set. func (o *SLAMiss) HasDagId() bool { - if o != nil && o.DagId != nil { + if o != nil && !IsNil(o.DagId) { return true } @@ -126,41 +80,51 @@ func (o *SLAMiss) SetDagId(v string) { o.DagId = &v } -// GetExecutionDate returns the ExecutionDate field value if set, zero value otherwise. -func (o *SLAMiss) GetExecutionDate() string { - if o == nil || o.ExecutionDate == nil { +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SLAMiss) GetDescription() string { + if o == nil || IsNil(o.Description.Get()) { var ret string return ret } - return *o.ExecutionDate + return *o.Description.Get() } -// GetExecutionDateOk returns a tuple with the ExecutionDate field value if set, nil otherwise +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SLAMiss) GetExecutionDateOk() (*string, bool) { - if o == nil || o.ExecutionDate == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SLAMiss) GetDescriptionOk() (*string, bool) { + if o == nil { return nil, false } - return o.ExecutionDate, true + return o.Description.Get(), o.Description.IsSet() } -// HasExecutionDate returns a boolean if a field has been set. -func (o *SLAMiss) HasExecutionDate() bool { - if o != nil && o.ExecutionDate != nil { +// HasDescription returns a boolean if a field has been set. +func (o *SLAMiss) HasDescription() bool { + if o != nil && o.Description.IsSet() { return true } return false } -// SetExecutionDate gets a reference to the given string and assigns it to the ExecutionDate field. -func (o *SLAMiss) SetExecutionDate(v string) { - o.ExecutionDate = &v +// SetDescription gets a reference to the given NullableString and assigns it to the Description field. +func (o *SLAMiss) SetDescription(v string) { + o.Description.Set(&v) +} +// SetDescriptionNil sets the value for Description to be an explicit nil +func (o *SLAMiss) SetDescriptionNil() { + o.Description.Set(nil) +} + +// UnsetDescription ensures that no value is present for Description, not even an explicit nil +func (o *SLAMiss) UnsetDescription() { + o.Description.Unset() } // GetEmailSent returns the EmailSent field value if set, zero value otherwise. func (o *SLAMiss) GetEmailSent() bool { - if o == nil || o.EmailSent == nil { + if o == nil || IsNil(o.EmailSent) { var ret bool return ret } @@ -170,7 +134,7 @@ func (o *SLAMiss) GetEmailSent() bool { // GetEmailSentOk returns a tuple with the EmailSent field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SLAMiss) GetEmailSentOk() (*bool, bool) { - if o == nil || o.EmailSent == nil { + if o == nil || IsNil(o.EmailSent) { return nil, false } return o.EmailSent, true @@ -178,7 +142,7 @@ func (o *SLAMiss) GetEmailSentOk() (*bool, bool) { // HasEmailSent returns a boolean if a field has been set. func (o *SLAMiss) HasEmailSent() bool { - if o != nil && o.EmailSent != nil { + if o != nil && !IsNil(o.EmailSent) { return true } @@ -190,136 +154,166 @@ func (o *SLAMiss) SetEmailSent(v bool) { o.EmailSent = &v } -// GetTimestamp returns the Timestamp field value if set, zero value otherwise. -func (o *SLAMiss) GetTimestamp() string { - if o == nil || o.Timestamp == nil { +// GetExecutionDate returns the ExecutionDate field value if set, zero value otherwise. +func (o *SLAMiss) GetExecutionDate() string { + if o == nil || IsNil(o.ExecutionDate) { var ret string return ret } - return *o.Timestamp + return *o.ExecutionDate } -// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// GetExecutionDateOk returns a tuple with the ExecutionDate field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SLAMiss) GetTimestampOk() (*string, bool) { - if o == nil || o.Timestamp == nil { +func (o *SLAMiss) GetExecutionDateOk() (*string, bool) { + if o == nil || IsNil(o.ExecutionDate) { return nil, false } - return o.Timestamp, true + return o.ExecutionDate, true } -// HasTimestamp returns a boolean if a field has been set. -func (o *SLAMiss) HasTimestamp() bool { - if o != nil && o.Timestamp != nil { +// HasExecutionDate returns a boolean if a field has been set. +func (o *SLAMiss) HasExecutionDate() bool { + if o != nil && !IsNil(o.ExecutionDate) { return true } return false } -// SetTimestamp gets a reference to the given string and assigns it to the Timestamp field. -func (o *SLAMiss) SetTimestamp(v string) { - o.Timestamp = &v +// SetExecutionDate gets a reference to the given string and assigns it to the ExecutionDate field. +func (o *SLAMiss) SetExecutionDate(v string) { + o.ExecutionDate = &v } -// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *SLAMiss) GetDescription() string { - if o == nil || o.Description.Get() == nil { - var ret string +// GetNotificationSent returns the NotificationSent field value if set, zero value otherwise. +func (o *SLAMiss) GetNotificationSent() bool { + if o == nil || IsNil(o.NotificationSent) { + var ret bool return ret } - return *o.Description.Get() + return *o.NotificationSent } -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// GetNotificationSentOk returns a tuple with the NotificationSent field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *SLAMiss) GetDescriptionOk() (*string, bool) { - if o == nil { +func (o *SLAMiss) GetNotificationSentOk() (*bool, bool) { + if o == nil || IsNil(o.NotificationSent) { return nil, false } - return o.Description.Get(), o.Description.IsSet() + return o.NotificationSent, true } -// HasDescription returns a boolean if a field has been set. -func (o *SLAMiss) HasDescription() bool { - if o != nil && o.Description.IsSet() { +// HasNotificationSent returns a boolean if a field has been set. +func (o *SLAMiss) HasNotificationSent() bool { + if o != nil && !IsNil(o.NotificationSent) { return true } return false } -// SetDescription gets a reference to the given NullableString and assigns it to the Description field. -func (o *SLAMiss) SetDescription(v string) { - o.Description.Set(&v) +// SetNotificationSent gets a reference to the given bool and assigns it to the NotificationSent field. +func (o *SLAMiss) SetNotificationSent(v bool) { + o.NotificationSent = &v } -// SetDescriptionNil sets the value for Description to be an explicit nil -func (o *SLAMiss) SetDescriptionNil() { - o.Description.Set(nil) + +// GetTaskId returns the TaskId field value if set, zero value otherwise. +func (o *SLAMiss) GetTaskId() string { + if o == nil || IsNil(o.TaskId) { + var ret string + return ret + } + return *o.TaskId } -// UnsetDescription ensures that no value is present for Description, not even an explicit nil -func (o *SLAMiss) UnsetDescription() { - o.Description.Unset() +// GetTaskIdOk returns a tuple with the TaskId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SLAMiss) GetTaskIdOk() (*string, bool) { + if o == nil || IsNil(o.TaskId) { + return nil, false + } + return o.TaskId, true } -// GetNotificationSent returns the NotificationSent field value if set, zero value otherwise. -func (o *SLAMiss) GetNotificationSent() bool { - if o == nil || o.NotificationSent == nil { - var ret bool +// HasTaskId returns a boolean if a field has been set. +func (o *SLAMiss) HasTaskId() bool { + if o != nil && !IsNil(o.TaskId) { + return true + } + + return false +} + +// SetTaskId gets a reference to the given string and assigns it to the TaskId field. +func (o *SLAMiss) SetTaskId(v string) { + o.TaskId = &v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *SLAMiss) GetTimestamp() string { + if o == nil || IsNil(o.Timestamp) { + var ret string return ret } - return *o.NotificationSent + return *o.Timestamp } -// GetNotificationSentOk returns a tuple with the NotificationSent field value if set, nil otherwise +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SLAMiss) GetNotificationSentOk() (*bool, bool) { - if o == nil || o.NotificationSent == nil { +func (o *SLAMiss) GetTimestampOk() (*string, bool) { + if o == nil || IsNil(o.Timestamp) { return nil, false } - return o.NotificationSent, true + return o.Timestamp, true } -// HasNotificationSent returns a boolean if a field has been set. -func (o *SLAMiss) HasNotificationSent() bool { - if o != nil && o.NotificationSent != nil { +// HasTimestamp returns a boolean if a field has been set. +func (o *SLAMiss) HasTimestamp() bool { + if o != nil && !IsNil(o.Timestamp) { return true } return false } -// SetNotificationSent gets a reference to the given bool and assigns it to the NotificationSent field. -func (o *SLAMiss) SetNotificationSent(v bool) { - o.NotificationSent = &v +// SetTimestamp gets a reference to the given string and assigns it to the Timestamp field. +func (o *SLAMiss) SetTimestamp(v string) { + o.Timestamp = &v } func (o SLAMiss) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.TaskId != nil { - toSerialize["task_id"] = o.TaskId + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.DagId != nil { + return json.Marshal(toSerialize) +} + +func (o SLAMiss) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DagId) { toSerialize["dag_id"] = o.DagId } - if o.ExecutionDate != nil { - toSerialize["execution_date"] = o.ExecutionDate + if o.Description.IsSet() { + toSerialize["description"] = o.Description.Get() } - if o.EmailSent != nil { + if !IsNil(o.EmailSent) { toSerialize["email_sent"] = o.EmailSent } - if o.Timestamp != nil { - toSerialize["timestamp"] = o.Timestamp - } - if o.Description.IsSet() { - toSerialize["description"] = o.Description.Get() + if !IsNil(o.ExecutionDate) { + toSerialize["execution_date"] = o.ExecutionDate } - if o.NotificationSent != nil { + if !IsNil(o.NotificationSent) { toSerialize["notification_sent"] = o.NotificationSent } - return json.Marshal(toSerialize) + if !IsNil(o.TaskId) { + toSerialize["task_id"] = o.TaskId + } + if !IsNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } + return toSerialize, nil } type NullableSLAMiss struct { diff --git a/airflow/model_tag.go b/airflow/model_tag.go index b4748d0..bd4203e 100644 --- a/airflow/model_tag.go +++ b/airflow/model_tag.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,6 +15,9 @@ import ( "encoding/json" ) +// checks if the Tag type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Tag{} + // Tag Tag type Tag struct { Name *string `json:"name,omitempty"` @@ -56,7 +42,7 @@ func NewTagWithDefaults() *Tag { // GetName returns the Name field value if set, zero value otherwise. func (o *Tag) GetName() string { - if o == nil || o.Name == nil { + if o == nil || IsNil(o.Name) { var ret string return ret } @@ -66,7 +52,7 @@ func (o *Tag) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Tag) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { + if o == nil || IsNil(o.Name) { return nil, false } return o.Name, true @@ -74,7 +60,7 @@ func (o *Tag) GetNameOk() (*string, bool) { // HasName returns a boolean if a field has been set. func (o *Tag) HasName() bool { - if o != nil && o.Name != nil { + if o != nil && !IsNil(o.Name) { return true } @@ -87,11 +73,19 @@ func (o *Tag) SetName(v string) { } func (o Tag) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Tag) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Name != nil { + if !IsNil(o.Name) { toSerialize["name"] = o.Name } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableTag struct { diff --git a/airflow/model_task.go b/airflow/model_task.go index e2ae6f3..1d6b4ad 100644 --- a/airflow/model_task.go +++ b/airflow/model_task.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -33,34 +16,41 @@ import ( "time" ) -// Task For details see: [airflow.models.BaseOperator](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/models/index.html#airflow.models.BaseOperator) +// checks if the Task type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Task{} + +// Task For details see: [airflow.models.baseoperator.BaseOperator](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/models/baseoperator/index.html#airflow.models.baseoperator.BaseOperator) type Task struct { ClassRef *ClassReference `json:"class_ref,omitempty"` - TaskId *string `json:"task_id,omitempty"` - Owner *string `json:"owner,omitempty"` - StartDate *time.Time `json:"start_date,omitempty"` - EndDate NullableTime `json:"end_date,omitempty"` - TriggerRule *TriggerRule `json:"trigger_rule,omitempty"` - ExtraLinks *[]TaskExtraLinks `json:"extra_links,omitempty"` DependsOnPast *bool `json:"depends_on_past,omitempty"` + // Task documentation in markdown. *New in version 2.10.0* + DocMd NullableString `json:"doc_md,omitempty"` + DownstreamTaskIds []string `json:"downstream_task_ids,omitempty"` + EndDate NullableTime `json:"end_date,omitempty"` + ExecutionTimeout NullableTimeDelta `json:"execution_timeout,omitempty"` + Executor NullableString `json:"executor,omitempty"` + ExtraLinks []TaskExtraLinksInner `json:"extra_links,omitempty"` IsMapped *bool `json:"is_mapped,omitempty"` - WaitForDownstream *bool `json:"wait_for_downstream,omitempty"` - Retries *float32 `json:"retries,omitempty"` - Queue NullableString `json:"queue,omitempty"` + Owner *string `json:"owner,omitempty"` Pool *string `json:"pool,omitempty"` PoolSlots *float32 `json:"pool_slots,omitempty"` - ExecutionTimeout *TimeDelta `json:"execution_timeout,omitempty"` - RetryDelay *TimeDelta `json:"retry_delay,omitempty"` - RetryExponentialBackoff *bool `json:"retry_exponential_backoff,omitempty"` PriorityWeight *float32 `json:"priority_weight,omitempty"` - WeightRule *WeightRule `json:"weight_rule,omitempty"` + Queue NullableString `json:"queue,omitempty"` + Retries *float32 `json:"retries,omitempty"` + RetryDelay NullableTimeDelta `json:"retry_delay,omitempty"` + RetryExponentialBackoff *bool `json:"retry_exponential_backoff,omitempty"` + StartDate NullableTime `json:"start_date,omitempty"` + SubDag *DAG `json:"sub_dag,omitempty"` + TaskDisplayName *string `json:"task_display_name,omitempty"` + TaskId *string `json:"task_id,omitempty"` + TemplateFields []string `json:"template_fields,omitempty"` + TriggerRule *TriggerRule `json:"trigger_rule,omitempty"` // Color in hexadecimal notation. - UiColor *string `json:"ui_color,omitempty"` + UiColor *string `json:"ui_color,omitempty" validate:"regexp=^#[a-fA-F0-9]{3,6}$"` // Color in hexadecimal notation. - UiFgcolor *string `json:"ui_fgcolor,omitempty"` - TemplateFields *[]string `json:"template_fields,omitempty"` - SubDag *DAG `json:"sub_dag,omitempty"` - DownstreamTaskIds *[]string `json:"downstream_task_ids,omitempty"` + UiFgcolor *string `json:"ui_fgcolor,omitempty" validate:"regexp=^#[a-fA-F0-9]{3,6}$"` + WaitForDownstream *bool `json:"wait_for_downstream,omitempty"` + WeightRule *WeightRule `json:"weight_rule,omitempty"` } // NewTask instantiates a new Task object @@ -82,7 +72,7 @@ func NewTaskWithDefaults() *Task { // GetClassRef returns the ClassRef field value if set, zero value otherwise. func (o *Task) GetClassRef() ClassReference { - if o == nil || o.ClassRef == nil { + if o == nil || IsNil(o.ClassRef) { var ret ClassReference return ret } @@ -92,7 +82,7 @@ func (o *Task) GetClassRef() ClassReference { // GetClassRefOk returns a tuple with the ClassRef field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Task) GetClassRefOk() (*ClassReference, bool) { - if o == nil || o.ClassRef == nil { + if o == nil || IsNil(o.ClassRef) { return nil, false } return o.ClassRef, true @@ -100,7 +90,7 @@ func (o *Task) GetClassRefOk() (*ClassReference, bool) { // HasClassRef returns a boolean if a field has been set. func (o *Task) HasClassRef() bool { - if o != nil && o.ClassRef != nil { + if o != nil && !IsNil(o.ClassRef) { return true } @@ -112,105 +102,115 @@ func (o *Task) SetClassRef(v ClassReference) { o.ClassRef = &v } -// GetTaskId returns the TaskId field value if set, zero value otherwise. -func (o *Task) GetTaskId() string { - if o == nil || o.TaskId == nil { - var ret string +// GetDependsOnPast returns the DependsOnPast field value if set, zero value otherwise. +func (o *Task) GetDependsOnPast() bool { + if o == nil || IsNil(o.DependsOnPast) { + var ret bool return ret } - return *o.TaskId + return *o.DependsOnPast } -// GetTaskIdOk returns a tuple with the TaskId field value if set, nil otherwise +// GetDependsOnPastOk returns a tuple with the DependsOnPast field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Task) GetTaskIdOk() (*string, bool) { - if o == nil || o.TaskId == nil { +func (o *Task) GetDependsOnPastOk() (*bool, bool) { + if o == nil || IsNil(o.DependsOnPast) { return nil, false } - return o.TaskId, true + return o.DependsOnPast, true } -// HasTaskId returns a boolean if a field has been set. -func (o *Task) HasTaskId() bool { - if o != nil && o.TaskId != nil { +// HasDependsOnPast returns a boolean if a field has been set. +func (o *Task) HasDependsOnPast() bool { + if o != nil && !IsNil(o.DependsOnPast) { return true } return false } -// SetTaskId gets a reference to the given string and assigns it to the TaskId field. -func (o *Task) SetTaskId(v string) { - o.TaskId = &v +// SetDependsOnPast gets a reference to the given bool and assigns it to the DependsOnPast field. +func (o *Task) SetDependsOnPast(v bool) { + o.DependsOnPast = &v } -// GetOwner returns the Owner field value if set, zero value otherwise. -func (o *Task) GetOwner() string { - if o == nil || o.Owner == nil { +// GetDocMd returns the DocMd field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Task) GetDocMd() string { + if o == nil || IsNil(o.DocMd.Get()) { var ret string return ret } - return *o.Owner + return *o.DocMd.Get() } -// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise +// GetDocMdOk returns a tuple with the DocMd field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Task) GetOwnerOk() (*string, bool) { - if o == nil || o.Owner == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Task) GetDocMdOk() (*string, bool) { + if o == nil { return nil, false } - return o.Owner, true + return o.DocMd.Get(), o.DocMd.IsSet() } -// HasOwner returns a boolean if a field has been set. -func (o *Task) HasOwner() bool { - if o != nil && o.Owner != nil { +// HasDocMd returns a boolean if a field has been set. +func (o *Task) HasDocMd() bool { + if o != nil && o.DocMd.IsSet() { return true } return false } -// SetOwner gets a reference to the given string and assigns it to the Owner field. -func (o *Task) SetOwner(v string) { - o.Owner = &v +// SetDocMd gets a reference to the given NullableString and assigns it to the DocMd field. +func (o *Task) SetDocMd(v string) { + o.DocMd.Set(&v) +} +// SetDocMdNil sets the value for DocMd to be an explicit nil +func (o *Task) SetDocMdNil() { + o.DocMd.Set(nil) } -// GetStartDate returns the StartDate field value if set, zero value otherwise. -func (o *Task) GetStartDate() time.Time { - if o == nil || o.StartDate == nil { - var ret time.Time +// UnsetDocMd ensures that no value is present for DocMd, not even an explicit nil +func (o *Task) UnsetDocMd() { + o.DocMd.Unset() +} + +// GetDownstreamTaskIds returns the DownstreamTaskIds field value if set, zero value otherwise. +func (o *Task) GetDownstreamTaskIds() []string { + if o == nil || IsNil(o.DownstreamTaskIds) { + var ret []string return ret } - return *o.StartDate + return o.DownstreamTaskIds } -// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise +// GetDownstreamTaskIdsOk returns a tuple with the DownstreamTaskIds field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Task) GetStartDateOk() (*time.Time, bool) { - if o == nil || o.StartDate == nil { +func (o *Task) GetDownstreamTaskIdsOk() ([]string, bool) { + if o == nil || IsNil(o.DownstreamTaskIds) { return nil, false } - return o.StartDate, true + return o.DownstreamTaskIds, true } -// HasStartDate returns a boolean if a field has been set. -func (o *Task) HasStartDate() bool { - if o != nil && o.StartDate != nil { +// HasDownstreamTaskIds returns a boolean if a field has been set. +func (o *Task) HasDownstreamTaskIds() bool { + if o != nil && !IsNil(o.DownstreamTaskIds) { return true } return false } -// SetStartDate gets a reference to the given time.Time and assigns it to the StartDate field. -func (o *Task) SetStartDate(v time.Time) { - o.StartDate = &v +// SetDownstreamTaskIds gets a reference to the given []string and assigns it to the DownstreamTaskIds field. +func (o *Task) SetDownstreamTaskIds(v []string) { + o.DownstreamTaskIds = v } // GetEndDate returns the EndDate field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Task) GetEndDate() time.Time { - if o == nil || o.EndDate.Get() == nil { + if o == nil || IsNil(o.EndDate.Get()) { var ret time.Time return ret } @@ -221,7 +221,7 @@ func (o *Task) GetEndDate() time.Time { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Task) GetEndDateOk() (*time.Time, bool) { - if o == nil { + if o == nil { return nil, false } return o.EndDate.Get(), o.EndDate.IsSet() @@ -250,105 +250,125 @@ func (o *Task) UnsetEndDate() { o.EndDate.Unset() } -// GetTriggerRule returns the TriggerRule field value if set, zero value otherwise. -func (o *Task) GetTriggerRule() TriggerRule { - if o == nil || o.TriggerRule == nil { - var ret TriggerRule +// GetExecutionTimeout returns the ExecutionTimeout field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Task) GetExecutionTimeout() TimeDelta { + if o == nil || IsNil(o.ExecutionTimeout.Get()) { + var ret TimeDelta return ret } - return *o.TriggerRule + return *o.ExecutionTimeout.Get() } -// GetTriggerRuleOk returns a tuple with the TriggerRule field value if set, nil otherwise +// GetExecutionTimeoutOk returns a tuple with the ExecutionTimeout field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Task) GetTriggerRuleOk() (*TriggerRule, bool) { - if o == nil || o.TriggerRule == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Task) GetExecutionTimeoutOk() (*TimeDelta, bool) { + if o == nil { return nil, false } - return o.TriggerRule, true + return o.ExecutionTimeout.Get(), o.ExecutionTimeout.IsSet() } -// HasTriggerRule returns a boolean if a field has been set. -func (o *Task) HasTriggerRule() bool { - if o != nil && o.TriggerRule != nil { +// HasExecutionTimeout returns a boolean if a field has been set. +func (o *Task) HasExecutionTimeout() bool { + if o != nil && o.ExecutionTimeout.IsSet() { return true } return false } -// SetTriggerRule gets a reference to the given TriggerRule and assigns it to the TriggerRule field. -func (o *Task) SetTriggerRule(v TriggerRule) { - o.TriggerRule = &v +// SetExecutionTimeout gets a reference to the given NullableTimeDelta and assigns it to the ExecutionTimeout field. +func (o *Task) SetExecutionTimeout(v TimeDelta) { + o.ExecutionTimeout.Set(&v) +} +// SetExecutionTimeoutNil sets the value for ExecutionTimeout to be an explicit nil +func (o *Task) SetExecutionTimeoutNil() { + o.ExecutionTimeout.Set(nil) } -// GetExtraLinks returns the ExtraLinks field value if set, zero value otherwise. -func (o *Task) GetExtraLinks() []TaskExtraLinks { - if o == nil || o.ExtraLinks == nil { - var ret []TaskExtraLinks +// UnsetExecutionTimeout ensures that no value is present for ExecutionTimeout, not even an explicit nil +func (o *Task) UnsetExecutionTimeout() { + o.ExecutionTimeout.Unset() +} + +// GetExecutor returns the Executor field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Task) GetExecutor() string { + if o == nil || IsNil(o.Executor.Get()) { + var ret string return ret } - return *o.ExtraLinks + return *o.Executor.Get() } -// GetExtraLinksOk returns a tuple with the ExtraLinks field value if set, nil otherwise +// GetExecutorOk returns a tuple with the Executor field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Task) GetExtraLinksOk() (*[]TaskExtraLinks, bool) { - if o == nil || o.ExtraLinks == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Task) GetExecutorOk() (*string, bool) { + if o == nil { return nil, false } - return o.ExtraLinks, true + return o.Executor.Get(), o.Executor.IsSet() } -// HasExtraLinks returns a boolean if a field has been set. -func (o *Task) HasExtraLinks() bool { - if o != nil && o.ExtraLinks != nil { +// HasExecutor returns a boolean if a field has been set. +func (o *Task) HasExecutor() bool { + if o != nil && o.Executor.IsSet() { return true } return false } -// SetExtraLinks gets a reference to the given []TaskExtraLinks and assigns it to the ExtraLinks field. -func (o *Task) SetExtraLinks(v []TaskExtraLinks) { - o.ExtraLinks = &v +// SetExecutor gets a reference to the given NullableString and assigns it to the Executor field. +func (o *Task) SetExecutor(v string) { + o.Executor.Set(&v) +} +// SetExecutorNil sets the value for Executor to be an explicit nil +func (o *Task) SetExecutorNil() { + o.Executor.Set(nil) } -// GetDependsOnPast returns the DependsOnPast field value if set, zero value otherwise. -func (o *Task) GetDependsOnPast() bool { - if o == nil || o.DependsOnPast == nil { - var ret bool +// UnsetExecutor ensures that no value is present for Executor, not even an explicit nil +func (o *Task) UnsetExecutor() { + o.Executor.Unset() +} + +// GetExtraLinks returns the ExtraLinks field value if set, zero value otherwise. +func (o *Task) GetExtraLinks() []TaskExtraLinksInner { + if o == nil || IsNil(o.ExtraLinks) { + var ret []TaskExtraLinksInner return ret } - return *o.DependsOnPast + return o.ExtraLinks } -// GetDependsOnPastOk returns a tuple with the DependsOnPast field value if set, nil otherwise +// GetExtraLinksOk returns a tuple with the ExtraLinks field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Task) GetDependsOnPastOk() (*bool, bool) { - if o == nil || o.DependsOnPast == nil { +func (o *Task) GetExtraLinksOk() ([]TaskExtraLinksInner, bool) { + if o == nil || IsNil(o.ExtraLinks) { return nil, false } - return o.DependsOnPast, true + return o.ExtraLinks, true } -// HasDependsOnPast returns a boolean if a field has been set. -func (o *Task) HasDependsOnPast() bool { - if o != nil && o.DependsOnPast != nil { +// HasExtraLinks returns a boolean if a field has been set. +func (o *Task) HasExtraLinks() bool { + if o != nil && !IsNil(o.ExtraLinks) { return true } return false } -// SetDependsOnPast gets a reference to the given bool and assigns it to the DependsOnPast field. -func (o *Task) SetDependsOnPast(v bool) { - o.DependsOnPast = &v +// SetExtraLinks gets a reference to the given []TaskExtraLinksInner and assigns it to the ExtraLinks field. +func (o *Task) SetExtraLinks(v []TaskExtraLinksInner) { + o.ExtraLinks = v } // GetIsMapped returns the IsMapped field value if set, zero value otherwise. func (o *Task) GetIsMapped() bool { - if o == nil || o.IsMapped == nil { + if o == nil || IsNil(o.IsMapped) { var ret bool return ret } @@ -358,7 +378,7 @@ func (o *Task) GetIsMapped() bool { // GetIsMappedOk returns a tuple with the IsMapped field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Task) GetIsMappedOk() (*bool, bool) { - if o == nil || o.IsMapped == nil { + if o == nil || IsNil(o.IsMapped) { return nil, false } return o.IsMapped, true @@ -366,7 +386,7 @@ func (o *Task) GetIsMappedOk() (*bool, bool) { // HasIsMapped returns a boolean if a field has been set. func (o *Task) HasIsMapped() bool { - if o != nil && o.IsMapped != nil { + if o != nil && !IsNil(o.IsMapped) { return true } @@ -378,115 +398,41 @@ func (o *Task) SetIsMapped(v bool) { o.IsMapped = &v } -// GetWaitForDownstream returns the WaitForDownstream field value if set, zero value otherwise. -func (o *Task) GetWaitForDownstream() bool { - if o == nil || o.WaitForDownstream == nil { - var ret bool - return ret - } - return *o.WaitForDownstream -} - -// GetWaitForDownstreamOk returns a tuple with the WaitForDownstream field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Task) GetWaitForDownstreamOk() (*bool, bool) { - if o == nil || o.WaitForDownstream == nil { - return nil, false - } - return o.WaitForDownstream, true -} - -// HasWaitForDownstream returns a boolean if a field has been set. -func (o *Task) HasWaitForDownstream() bool { - if o != nil && o.WaitForDownstream != nil { - return true - } - - return false -} - -// SetWaitForDownstream gets a reference to the given bool and assigns it to the WaitForDownstream field. -func (o *Task) SetWaitForDownstream(v bool) { - o.WaitForDownstream = &v -} - -// GetRetries returns the Retries field value if set, zero value otherwise. -func (o *Task) GetRetries() float32 { - if o == nil || o.Retries == nil { - var ret float32 - return ret - } - return *o.Retries -} - -// GetRetriesOk returns a tuple with the Retries field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Task) GetRetriesOk() (*float32, bool) { - if o == nil || o.Retries == nil { - return nil, false - } - return o.Retries, true -} - -// HasRetries returns a boolean if a field has been set. -func (o *Task) HasRetries() bool { - if o != nil && o.Retries != nil { - return true - } - - return false -} - -// SetRetries gets a reference to the given float32 and assigns it to the Retries field. -func (o *Task) SetRetries(v float32) { - o.Retries = &v -} - -// GetQueue returns the Queue field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *Task) GetQueue() string { - if o == nil || o.Queue.Get() == nil { +// GetOwner returns the Owner field value if set, zero value otherwise. +func (o *Task) GetOwner() string { + if o == nil || IsNil(o.Owner) { var ret string return ret } - return *o.Queue.Get() + return *o.Owner } -// GetQueueOk returns a tuple with the Queue field value if set, nil otherwise +// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *Task) GetQueueOk() (*string, bool) { - if o == nil { +func (o *Task) GetOwnerOk() (*string, bool) { + if o == nil || IsNil(o.Owner) { return nil, false } - return o.Queue.Get(), o.Queue.IsSet() + return o.Owner, true } -// HasQueue returns a boolean if a field has been set. -func (o *Task) HasQueue() bool { - if o != nil && o.Queue.IsSet() { +// HasOwner returns a boolean if a field has been set. +func (o *Task) HasOwner() bool { + if o != nil && !IsNil(o.Owner) { return true } return false } -// SetQueue gets a reference to the given NullableString and assigns it to the Queue field. -func (o *Task) SetQueue(v string) { - o.Queue.Set(&v) -} -// SetQueueNil sets the value for Queue to be an explicit nil -func (o *Task) SetQueueNil() { - o.Queue.Set(nil) -} - -// UnsetQueue ensures that no value is present for Queue, not even an explicit nil -func (o *Task) UnsetQueue() { - o.Queue.Unset() +// SetOwner gets a reference to the given string and assigns it to the Owner field. +func (o *Task) SetOwner(v string) { + o.Owner = &v } // GetPool returns the Pool field value if set, zero value otherwise. func (o *Task) GetPool() string { - if o == nil || o.Pool == nil { + if o == nil || IsNil(o.Pool) { var ret string return ret } @@ -496,7 +442,7 @@ func (o *Task) GetPool() string { // GetPoolOk returns a tuple with the Pool field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Task) GetPoolOk() (*string, bool) { - if o == nil || o.Pool == nil { + if o == nil || IsNil(o.Pool) { return nil, false } return o.Pool, true @@ -504,7 +450,7 @@ func (o *Task) GetPoolOk() (*string, bool) { // HasPool returns a boolean if a field has been set. func (o *Task) HasPool() bool { - if o != nil && o.Pool != nil { + if o != nil && !IsNil(o.Pool) { return true } @@ -518,7 +464,7 @@ func (o *Task) SetPool(v string) { // GetPoolSlots returns the PoolSlots field value if set, zero value otherwise. func (o *Task) GetPoolSlots() float32 { - if o == nil || o.PoolSlots == nil { + if o == nil || IsNil(o.PoolSlots) { var ret float32 return ret } @@ -528,7 +474,7 @@ func (o *Task) GetPoolSlots() float32 { // GetPoolSlotsOk returns a tuple with the PoolSlots field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Task) GetPoolSlotsOk() (*float32, bool) { - if o == nil || o.PoolSlots == nil { + if o == nil || IsNil(o.PoolSlots) { return nil, false } return o.PoolSlots, true @@ -536,7 +482,7 @@ func (o *Task) GetPoolSlotsOk() (*float32, bool) { // HasPoolSlots returns a boolean if a field has been set. func (o *Task) HasPoolSlots() bool { - if o != nil && o.PoolSlots != nil { + if o != nil && !IsNil(o.PoolSlots) { return true } @@ -548,73 +494,157 @@ func (o *Task) SetPoolSlots(v float32) { o.PoolSlots = &v } -// GetExecutionTimeout returns the ExecutionTimeout field value if set, zero value otherwise. -func (o *Task) GetExecutionTimeout() TimeDelta { - if o == nil || o.ExecutionTimeout == nil { - var ret TimeDelta +// GetPriorityWeight returns the PriorityWeight field value if set, zero value otherwise. +func (o *Task) GetPriorityWeight() float32 { + if o == nil || IsNil(o.PriorityWeight) { + var ret float32 return ret } - return *o.ExecutionTimeout + return *o.PriorityWeight } -// GetExecutionTimeoutOk returns a tuple with the ExecutionTimeout field value if set, nil otherwise +// GetPriorityWeightOk returns a tuple with the PriorityWeight field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Task) GetExecutionTimeoutOk() (*TimeDelta, bool) { - if o == nil || o.ExecutionTimeout == nil { +func (o *Task) GetPriorityWeightOk() (*float32, bool) { + if o == nil || IsNil(o.PriorityWeight) { return nil, false } - return o.ExecutionTimeout, true + return o.PriorityWeight, true } -// HasExecutionTimeout returns a boolean if a field has been set. -func (o *Task) HasExecutionTimeout() bool { - if o != nil && o.ExecutionTimeout != nil { +// HasPriorityWeight returns a boolean if a field has been set. +func (o *Task) HasPriorityWeight() bool { + if o != nil && !IsNil(o.PriorityWeight) { return true } return false } -// SetExecutionTimeout gets a reference to the given TimeDelta and assigns it to the ExecutionTimeout field. -func (o *Task) SetExecutionTimeout(v TimeDelta) { - o.ExecutionTimeout = &v +// SetPriorityWeight gets a reference to the given float32 and assigns it to the PriorityWeight field. +func (o *Task) SetPriorityWeight(v float32) { + o.PriorityWeight = &v } -// GetRetryDelay returns the RetryDelay field value if set, zero value otherwise. -func (o *Task) GetRetryDelay() TimeDelta { - if o == nil || o.RetryDelay == nil { - var ret TimeDelta +// GetQueue returns the Queue field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Task) GetQueue() string { + if o == nil || IsNil(o.Queue.Get()) { + var ret string return ret } - return *o.RetryDelay + return *o.Queue.Get() } -// GetRetryDelayOk returns a tuple with the RetryDelay field value if set, nil otherwise +// GetQueueOk returns a tuple with the Queue field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Task) GetRetryDelayOk() (*TimeDelta, bool) { - if o == nil || o.RetryDelay == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Task) GetQueueOk() (*string, bool) { + if o == nil { return nil, false } - return o.RetryDelay, true + return o.Queue.Get(), o.Queue.IsSet() } -// HasRetryDelay returns a boolean if a field has been set. -func (o *Task) HasRetryDelay() bool { - if o != nil && o.RetryDelay != nil { +// HasQueue returns a boolean if a field has been set. +func (o *Task) HasQueue() bool { + if o != nil && o.Queue.IsSet() { return true } return false } -// SetRetryDelay gets a reference to the given TimeDelta and assigns it to the RetryDelay field. -func (o *Task) SetRetryDelay(v TimeDelta) { - o.RetryDelay = &v -} +// SetQueue gets a reference to the given NullableString and assigns it to the Queue field. +func (o *Task) SetQueue(v string) { + o.Queue.Set(&v) +} +// SetQueueNil sets the value for Queue to be an explicit nil +func (o *Task) SetQueueNil() { + o.Queue.Set(nil) +} + +// UnsetQueue ensures that no value is present for Queue, not even an explicit nil +func (o *Task) UnsetQueue() { + o.Queue.Unset() +} + +// GetRetries returns the Retries field value if set, zero value otherwise. +func (o *Task) GetRetries() float32 { + if o == nil || IsNil(o.Retries) { + var ret float32 + return ret + } + return *o.Retries +} + +// GetRetriesOk returns a tuple with the Retries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Task) GetRetriesOk() (*float32, bool) { + if o == nil || IsNil(o.Retries) { + return nil, false + } + return o.Retries, true +} + +// HasRetries returns a boolean if a field has been set. +func (o *Task) HasRetries() bool { + if o != nil && !IsNil(o.Retries) { + return true + } + + return false +} + +// SetRetries gets a reference to the given float32 and assigns it to the Retries field. +func (o *Task) SetRetries(v float32) { + o.Retries = &v +} + +// GetRetryDelay returns the RetryDelay field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Task) GetRetryDelay() TimeDelta { + if o == nil || IsNil(o.RetryDelay.Get()) { + var ret TimeDelta + return ret + } + return *o.RetryDelay.Get() +} + +// GetRetryDelayOk returns a tuple with the RetryDelay field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Task) GetRetryDelayOk() (*TimeDelta, bool) { + if o == nil { + return nil, false + } + return o.RetryDelay.Get(), o.RetryDelay.IsSet() +} + +// HasRetryDelay returns a boolean if a field has been set. +func (o *Task) HasRetryDelay() bool { + if o != nil && o.RetryDelay.IsSet() { + return true + } + + return false +} + +// SetRetryDelay gets a reference to the given NullableTimeDelta and assigns it to the RetryDelay field. +func (o *Task) SetRetryDelay(v TimeDelta) { + o.RetryDelay.Set(&v) +} +// SetRetryDelayNil sets the value for RetryDelay to be an explicit nil +func (o *Task) SetRetryDelayNil() { + o.RetryDelay.Set(nil) +} + +// UnsetRetryDelay ensures that no value is present for RetryDelay, not even an explicit nil +func (o *Task) UnsetRetryDelay() { + o.RetryDelay.Unset() +} // GetRetryExponentialBackoff returns the RetryExponentialBackoff field value if set, zero value otherwise. func (o *Task) GetRetryExponentialBackoff() bool { - if o == nil || o.RetryExponentialBackoff == nil { + if o == nil || IsNil(o.RetryExponentialBackoff) { var ret bool return ret } @@ -624,7 +654,7 @@ func (o *Task) GetRetryExponentialBackoff() bool { // GetRetryExponentialBackoffOk returns a tuple with the RetryExponentialBackoff field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Task) GetRetryExponentialBackoffOk() (*bool, bool) { - if o == nil || o.RetryExponentialBackoff == nil { + if o == nil || IsNil(o.RetryExponentialBackoff) { return nil, false } return o.RetryExponentialBackoff, true @@ -632,7 +662,7 @@ func (o *Task) GetRetryExponentialBackoffOk() (*bool, bool) { // HasRetryExponentialBackoff returns a boolean if a field has been set. func (o *Task) HasRetryExponentialBackoff() bool { - if o != nil && o.RetryExponentialBackoff != nil { + if o != nil && !IsNil(o.RetryExponentialBackoff) { return true } @@ -644,147 +674,157 @@ func (o *Task) SetRetryExponentialBackoff(v bool) { o.RetryExponentialBackoff = &v } -// GetPriorityWeight returns the PriorityWeight field value if set, zero value otherwise. -func (o *Task) GetPriorityWeight() float32 { - if o == nil || o.PriorityWeight == nil { - var ret float32 +// GetStartDate returns the StartDate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Task) GetStartDate() time.Time { + if o == nil || IsNil(o.StartDate.Get()) { + var ret time.Time return ret } - return *o.PriorityWeight + return *o.StartDate.Get() } -// GetPriorityWeightOk returns a tuple with the PriorityWeight field value if set, nil otherwise +// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Task) GetPriorityWeightOk() (*float32, bool) { - if o == nil || o.PriorityWeight == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Task) GetStartDateOk() (*time.Time, bool) { + if o == nil { return nil, false } - return o.PriorityWeight, true + return o.StartDate.Get(), o.StartDate.IsSet() } -// HasPriorityWeight returns a boolean if a field has been set. -func (o *Task) HasPriorityWeight() bool { - if o != nil && o.PriorityWeight != nil { +// HasStartDate returns a boolean if a field has been set. +func (o *Task) HasStartDate() bool { + if o != nil && o.StartDate.IsSet() { return true } return false } -// SetPriorityWeight gets a reference to the given float32 and assigns it to the PriorityWeight field. -func (o *Task) SetPriorityWeight(v float32) { - o.PriorityWeight = &v +// SetStartDate gets a reference to the given NullableTime and assigns it to the StartDate field. +func (o *Task) SetStartDate(v time.Time) { + o.StartDate.Set(&v) +} +// SetStartDateNil sets the value for StartDate to be an explicit nil +func (o *Task) SetStartDateNil() { + o.StartDate.Set(nil) } -// GetWeightRule returns the WeightRule field value if set, zero value otherwise. -func (o *Task) GetWeightRule() WeightRule { - if o == nil || o.WeightRule == nil { - var ret WeightRule +// UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil +func (o *Task) UnsetStartDate() { + o.StartDate.Unset() +} + +// GetSubDag returns the SubDag field value if set, zero value otherwise. +func (o *Task) GetSubDag() DAG { + if o == nil || IsNil(o.SubDag) { + var ret DAG return ret } - return *o.WeightRule + return *o.SubDag } -// GetWeightRuleOk returns a tuple with the WeightRule field value if set, nil otherwise +// GetSubDagOk returns a tuple with the SubDag field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Task) GetWeightRuleOk() (*WeightRule, bool) { - if o == nil || o.WeightRule == nil { +func (o *Task) GetSubDagOk() (*DAG, bool) { + if o == nil || IsNil(o.SubDag) { return nil, false } - return o.WeightRule, true + return o.SubDag, true } -// HasWeightRule returns a boolean if a field has been set. -func (o *Task) HasWeightRule() bool { - if o != nil && o.WeightRule != nil { +// HasSubDag returns a boolean if a field has been set. +func (o *Task) HasSubDag() bool { + if o != nil && !IsNil(o.SubDag) { return true } return false } -// SetWeightRule gets a reference to the given WeightRule and assigns it to the WeightRule field. -func (o *Task) SetWeightRule(v WeightRule) { - o.WeightRule = &v +// SetSubDag gets a reference to the given DAG and assigns it to the SubDag field. +func (o *Task) SetSubDag(v DAG) { + o.SubDag = &v } -// GetUiColor returns the UiColor field value if set, zero value otherwise. -func (o *Task) GetUiColor() string { - if o == nil || o.UiColor == nil { +// GetTaskDisplayName returns the TaskDisplayName field value if set, zero value otherwise. +func (o *Task) GetTaskDisplayName() string { + if o == nil || IsNil(o.TaskDisplayName) { var ret string return ret } - return *o.UiColor + return *o.TaskDisplayName } -// GetUiColorOk returns a tuple with the UiColor field value if set, nil otherwise +// GetTaskDisplayNameOk returns a tuple with the TaskDisplayName field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Task) GetUiColorOk() (*string, bool) { - if o == nil || o.UiColor == nil { +func (o *Task) GetTaskDisplayNameOk() (*string, bool) { + if o == nil || IsNil(o.TaskDisplayName) { return nil, false } - return o.UiColor, true + return o.TaskDisplayName, true } -// HasUiColor returns a boolean if a field has been set. -func (o *Task) HasUiColor() bool { - if o != nil && o.UiColor != nil { +// HasTaskDisplayName returns a boolean if a field has been set. +func (o *Task) HasTaskDisplayName() bool { + if o != nil && !IsNil(o.TaskDisplayName) { return true } return false } -// SetUiColor gets a reference to the given string and assigns it to the UiColor field. -func (o *Task) SetUiColor(v string) { - o.UiColor = &v +// SetTaskDisplayName gets a reference to the given string and assigns it to the TaskDisplayName field. +func (o *Task) SetTaskDisplayName(v string) { + o.TaskDisplayName = &v } -// GetUiFgcolor returns the UiFgcolor field value if set, zero value otherwise. -func (o *Task) GetUiFgcolor() string { - if o == nil || o.UiFgcolor == nil { +// GetTaskId returns the TaskId field value if set, zero value otherwise. +func (o *Task) GetTaskId() string { + if o == nil || IsNil(o.TaskId) { var ret string return ret } - return *o.UiFgcolor + return *o.TaskId } -// GetUiFgcolorOk returns a tuple with the UiFgcolor field value if set, nil otherwise +// GetTaskIdOk returns a tuple with the TaskId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Task) GetUiFgcolorOk() (*string, bool) { - if o == nil || o.UiFgcolor == nil { +func (o *Task) GetTaskIdOk() (*string, bool) { + if o == nil || IsNil(o.TaskId) { return nil, false } - return o.UiFgcolor, true + return o.TaskId, true } -// HasUiFgcolor returns a boolean if a field has been set. -func (o *Task) HasUiFgcolor() bool { - if o != nil && o.UiFgcolor != nil { +// HasTaskId returns a boolean if a field has been set. +func (o *Task) HasTaskId() bool { + if o != nil && !IsNil(o.TaskId) { return true } return false } -// SetUiFgcolor gets a reference to the given string and assigns it to the UiFgcolor field. -func (o *Task) SetUiFgcolor(v string) { - o.UiFgcolor = &v +// SetTaskId gets a reference to the given string and assigns it to the TaskId field. +func (o *Task) SetTaskId(v string) { + o.TaskId = &v } // GetTemplateFields returns the TemplateFields field value if set, zero value otherwise. func (o *Task) GetTemplateFields() []string { - if o == nil || o.TemplateFields == nil { + if o == nil || IsNil(o.TemplateFields) { var ret []string return ret } - return *o.TemplateFields + return o.TemplateFields } // GetTemplateFieldsOk returns a tuple with the TemplateFields field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Task) GetTemplateFieldsOk() (*[]string, bool) { - if o == nil || o.TemplateFields == nil { +func (o *Task) GetTemplateFieldsOk() ([]string, bool) { + if o == nil || IsNil(o.TemplateFields) { return nil, false } return o.TemplateFields, true @@ -792,7 +832,7 @@ func (o *Task) GetTemplateFieldsOk() (*[]string, bool) { // HasTemplateFields returns a boolean if a field has been set. func (o *Task) HasTemplateFields() bool { - if o != nil && o.TemplateFields != nil { + if o != nil && !IsNil(o.TemplateFields) { return true } @@ -801,148 +841,261 @@ func (o *Task) HasTemplateFields() bool { // SetTemplateFields gets a reference to the given []string and assigns it to the TemplateFields field. func (o *Task) SetTemplateFields(v []string) { - o.TemplateFields = &v + o.TemplateFields = v } -// GetSubDag returns the SubDag field value if set, zero value otherwise. -func (o *Task) GetSubDag() DAG { - if o == nil || o.SubDag == nil { - var ret DAG +// GetTriggerRule returns the TriggerRule field value if set, zero value otherwise. +func (o *Task) GetTriggerRule() TriggerRule { + if o == nil || IsNil(o.TriggerRule) { + var ret TriggerRule return ret } - return *o.SubDag + return *o.TriggerRule } -// GetSubDagOk returns a tuple with the SubDag field value if set, nil otherwise +// GetTriggerRuleOk returns a tuple with the TriggerRule field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Task) GetSubDagOk() (*DAG, bool) { - if o == nil || o.SubDag == nil { +func (o *Task) GetTriggerRuleOk() (*TriggerRule, bool) { + if o == nil || IsNil(o.TriggerRule) { return nil, false } - return o.SubDag, true + return o.TriggerRule, true } -// HasSubDag returns a boolean if a field has been set. -func (o *Task) HasSubDag() bool { - if o != nil && o.SubDag != nil { +// HasTriggerRule returns a boolean if a field has been set. +func (o *Task) HasTriggerRule() bool { + if o != nil && !IsNil(o.TriggerRule) { return true } return false } -// SetSubDag gets a reference to the given DAG and assigns it to the SubDag field. -func (o *Task) SetSubDag(v DAG) { - o.SubDag = &v +// SetTriggerRule gets a reference to the given TriggerRule and assigns it to the TriggerRule field. +func (o *Task) SetTriggerRule(v TriggerRule) { + o.TriggerRule = &v } -// GetDownstreamTaskIds returns the DownstreamTaskIds field value if set, zero value otherwise. -func (o *Task) GetDownstreamTaskIds() []string { - if o == nil || o.DownstreamTaskIds == nil { - var ret []string +// GetUiColor returns the UiColor field value if set, zero value otherwise. +func (o *Task) GetUiColor() string { + if o == nil || IsNil(o.UiColor) { + var ret string return ret } - return *o.DownstreamTaskIds + return *o.UiColor } -// GetDownstreamTaskIdsOk returns a tuple with the DownstreamTaskIds field value if set, nil otherwise +// GetUiColorOk returns a tuple with the UiColor field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Task) GetDownstreamTaskIdsOk() (*[]string, bool) { - if o == nil || o.DownstreamTaskIds == nil { +func (o *Task) GetUiColorOk() (*string, bool) { + if o == nil || IsNil(o.UiColor) { return nil, false } - return o.DownstreamTaskIds, true + return o.UiColor, true } -// HasDownstreamTaskIds returns a boolean if a field has been set. -func (o *Task) HasDownstreamTaskIds() bool { - if o != nil && o.DownstreamTaskIds != nil { +// HasUiColor returns a boolean if a field has been set. +func (o *Task) HasUiColor() bool { + if o != nil && !IsNil(o.UiColor) { return true } return false } -// SetDownstreamTaskIds gets a reference to the given []string and assigns it to the DownstreamTaskIds field. -func (o *Task) SetDownstreamTaskIds(v []string) { - o.DownstreamTaskIds = &v +// SetUiColor gets a reference to the given string and assigns it to the UiColor field. +func (o *Task) SetUiColor(v string) { + o.UiColor = &v +} + +// GetUiFgcolor returns the UiFgcolor field value if set, zero value otherwise. +func (o *Task) GetUiFgcolor() string { + if o == nil || IsNil(o.UiFgcolor) { + var ret string + return ret + } + return *o.UiFgcolor +} + +// GetUiFgcolorOk returns a tuple with the UiFgcolor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Task) GetUiFgcolorOk() (*string, bool) { + if o == nil || IsNil(o.UiFgcolor) { + return nil, false + } + return o.UiFgcolor, true +} + +// HasUiFgcolor returns a boolean if a field has been set. +func (o *Task) HasUiFgcolor() bool { + if o != nil && !IsNil(o.UiFgcolor) { + return true + } + + return false +} + +// SetUiFgcolor gets a reference to the given string and assigns it to the UiFgcolor field. +func (o *Task) SetUiFgcolor(v string) { + o.UiFgcolor = &v +} + +// GetWaitForDownstream returns the WaitForDownstream field value if set, zero value otherwise. +func (o *Task) GetWaitForDownstream() bool { + if o == nil || IsNil(o.WaitForDownstream) { + var ret bool + return ret + } + return *o.WaitForDownstream +} + +// GetWaitForDownstreamOk returns a tuple with the WaitForDownstream field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Task) GetWaitForDownstreamOk() (*bool, bool) { + if o == nil || IsNil(o.WaitForDownstream) { + return nil, false + } + return o.WaitForDownstream, true +} + +// HasWaitForDownstream returns a boolean if a field has been set. +func (o *Task) HasWaitForDownstream() bool { + if o != nil && !IsNil(o.WaitForDownstream) { + return true + } + + return false +} + +// SetWaitForDownstream gets a reference to the given bool and assigns it to the WaitForDownstream field. +func (o *Task) SetWaitForDownstream(v bool) { + o.WaitForDownstream = &v +} + +// GetWeightRule returns the WeightRule field value if set, zero value otherwise. +func (o *Task) GetWeightRule() WeightRule { + if o == nil || IsNil(o.WeightRule) { + var ret WeightRule + return ret + } + return *o.WeightRule +} + +// GetWeightRuleOk returns a tuple with the WeightRule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Task) GetWeightRuleOk() (*WeightRule, bool) { + if o == nil || IsNil(o.WeightRule) { + return nil, false + } + return o.WeightRule, true +} + +// HasWeightRule returns a boolean if a field has been set. +func (o *Task) HasWeightRule() bool { + if o != nil && !IsNil(o.WeightRule) { + return true + } + + return false +} + +// SetWeightRule gets a reference to the given WeightRule and assigns it to the WeightRule field. +func (o *Task) SetWeightRule(v WeightRule) { + o.WeightRule = &v } func (o Task) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Task) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.ClassRef != nil { + if !IsNil(o.ClassRef) { toSerialize["class_ref"] = o.ClassRef } - if o.TaskId != nil { - toSerialize["task_id"] = o.TaskId + if !IsNil(o.DependsOnPast) { + toSerialize["depends_on_past"] = o.DependsOnPast } - if o.Owner != nil { - toSerialize["owner"] = o.Owner + if o.DocMd.IsSet() { + toSerialize["doc_md"] = o.DocMd.Get() } - if o.StartDate != nil { - toSerialize["start_date"] = o.StartDate + if !IsNil(o.DownstreamTaskIds) { + toSerialize["downstream_task_ids"] = o.DownstreamTaskIds } if o.EndDate.IsSet() { toSerialize["end_date"] = o.EndDate.Get() } - if o.TriggerRule != nil { - toSerialize["trigger_rule"] = o.TriggerRule + if o.ExecutionTimeout.IsSet() { + toSerialize["execution_timeout"] = o.ExecutionTimeout.Get() } - if o.ExtraLinks != nil { - toSerialize["extra_links"] = o.ExtraLinks + if o.Executor.IsSet() { + toSerialize["executor"] = o.Executor.Get() } - if o.DependsOnPast != nil { - toSerialize["depends_on_past"] = o.DependsOnPast + if !IsNil(o.ExtraLinks) { + toSerialize["extra_links"] = o.ExtraLinks } - if o.IsMapped != nil { + if !IsNil(o.IsMapped) { toSerialize["is_mapped"] = o.IsMapped } - if o.WaitForDownstream != nil { - toSerialize["wait_for_downstream"] = o.WaitForDownstream + if !IsNil(o.Owner) { + toSerialize["owner"] = o.Owner } - if o.Retries != nil { - toSerialize["retries"] = o.Retries + if !IsNil(o.Pool) { + toSerialize["pool"] = o.Pool + } + if !IsNil(o.PoolSlots) { + toSerialize["pool_slots"] = o.PoolSlots + } + if !IsNil(o.PriorityWeight) { + toSerialize["priority_weight"] = o.PriorityWeight } if o.Queue.IsSet() { toSerialize["queue"] = o.Queue.Get() } - if o.Pool != nil { - toSerialize["pool"] = o.Pool + if !IsNil(o.Retries) { + toSerialize["retries"] = o.Retries } - if o.PoolSlots != nil { - toSerialize["pool_slots"] = o.PoolSlots + if o.RetryDelay.IsSet() { + toSerialize["retry_delay"] = o.RetryDelay.Get() } - if o.ExecutionTimeout != nil { - toSerialize["execution_timeout"] = o.ExecutionTimeout + if !IsNil(o.RetryExponentialBackoff) { + toSerialize["retry_exponential_backoff"] = o.RetryExponentialBackoff } - if o.RetryDelay != nil { - toSerialize["retry_delay"] = o.RetryDelay + if o.StartDate.IsSet() { + toSerialize["start_date"] = o.StartDate.Get() } - if o.RetryExponentialBackoff != nil { - toSerialize["retry_exponential_backoff"] = o.RetryExponentialBackoff + if !IsNil(o.SubDag) { + toSerialize["sub_dag"] = o.SubDag } - if o.PriorityWeight != nil { - toSerialize["priority_weight"] = o.PriorityWeight + if !IsNil(o.TaskDisplayName) { + toSerialize["task_display_name"] = o.TaskDisplayName } - if o.WeightRule != nil { - toSerialize["weight_rule"] = o.WeightRule + if !IsNil(o.TaskId) { + toSerialize["task_id"] = o.TaskId + } + if !IsNil(o.TemplateFields) { + toSerialize["template_fields"] = o.TemplateFields + } + if !IsNil(o.TriggerRule) { + toSerialize["trigger_rule"] = o.TriggerRule } - if o.UiColor != nil { + if !IsNil(o.UiColor) { toSerialize["ui_color"] = o.UiColor } - if o.UiFgcolor != nil { + if !IsNil(o.UiFgcolor) { toSerialize["ui_fgcolor"] = o.UiFgcolor } - if o.TemplateFields != nil { - toSerialize["template_fields"] = o.TemplateFields - } - if o.SubDag != nil { - toSerialize["sub_dag"] = o.SubDag + if !IsNil(o.WaitForDownstream) { + toSerialize["wait_for_downstream"] = o.WaitForDownstream } - if o.DownstreamTaskIds != nil { - toSerialize["downstream_task_ids"] = o.DownstreamTaskIds + if !IsNil(o.WeightRule) { + toSerialize["weight_rule"] = o.WeightRule } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableTask struct { diff --git a/airflow/model_task_collection.go b/airflow/model_task_collection.go index 78e81a9..7ba79fb 100644 --- a/airflow/model_task_collection.go +++ b/airflow/model_task_collection.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,9 +15,12 @@ import ( "encoding/json" ) +// checks if the TaskCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TaskCollection{} + // TaskCollection Collection of tasks. type TaskCollection struct { - Tasks *[]Task `json:"tasks,omitempty"` + Tasks []Task `json:"tasks,omitempty"` } // NewTaskCollection instantiates a new TaskCollection object @@ -56,17 +42,17 @@ func NewTaskCollectionWithDefaults() *TaskCollection { // GetTasks returns the Tasks field value if set, zero value otherwise. func (o *TaskCollection) GetTasks() []Task { - if o == nil || o.Tasks == nil { + if o == nil || IsNil(o.Tasks) { var ret []Task return ret } - return *o.Tasks + return o.Tasks } // GetTasksOk returns a tuple with the Tasks field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskCollection) GetTasksOk() (*[]Task, bool) { - if o == nil || o.Tasks == nil { +func (o *TaskCollection) GetTasksOk() ([]Task, bool) { + if o == nil || IsNil(o.Tasks) { return nil, false } return o.Tasks, true @@ -74,7 +60,7 @@ func (o *TaskCollection) GetTasksOk() (*[]Task, bool) { // HasTasks returns a boolean if a field has been set. func (o *TaskCollection) HasTasks() bool { - if o != nil && o.Tasks != nil { + if o != nil && !IsNil(o.Tasks) { return true } @@ -83,15 +69,23 @@ func (o *TaskCollection) HasTasks() bool { // SetTasks gets a reference to the given []Task and assigns it to the Tasks field. func (o *TaskCollection) SetTasks(v []Task) { - o.Tasks = &v + o.Tasks = v } func (o TaskCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TaskCollection) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.Tasks != nil { + if !IsNil(o.Tasks) { toSerialize["tasks"] = o.Tasks } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableTaskCollection struct { diff --git a/airflow/model_task_extra_links_inner.go b/airflow/model_task_extra_links_inner.go new file mode 100644 index 0000000..14b046b --- /dev/null +++ b/airflow/model_task_extra_links_inner.go @@ -0,0 +1,127 @@ +/* +Airflow API (Stable) + +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. + +API version: 2.10.5 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package airflow + +import ( + "encoding/json" +) + +// checks if the TaskExtraLinksInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TaskExtraLinksInner{} + +// TaskExtraLinksInner struct for TaskExtraLinksInner +type TaskExtraLinksInner struct { + ClassRef *ClassReference `json:"class_ref,omitempty"` +} + +// NewTaskExtraLinksInner instantiates a new TaskExtraLinksInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTaskExtraLinksInner() *TaskExtraLinksInner { + this := TaskExtraLinksInner{} + return &this +} + +// NewTaskExtraLinksInnerWithDefaults instantiates a new TaskExtraLinksInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTaskExtraLinksInnerWithDefaults() *TaskExtraLinksInner { + this := TaskExtraLinksInner{} + return &this +} + +// GetClassRef returns the ClassRef field value if set, zero value otherwise. +func (o *TaskExtraLinksInner) GetClassRef() ClassReference { + if o == nil || IsNil(o.ClassRef) { + var ret ClassReference + return ret + } + return *o.ClassRef +} + +// GetClassRefOk returns a tuple with the ClassRef field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskExtraLinksInner) GetClassRefOk() (*ClassReference, bool) { + if o == nil || IsNil(o.ClassRef) { + return nil, false + } + return o.ClassRef, true +} + +// HasClassRef returns a boolean if a field has been set. +func (o *TaskExtraLinksInner) HasClassRef() bool { + if o != nil && !IsNil(o.ClassRef) { + return true + } + + return false +} + +// SetClassRef gets a reference to the given ClassReference and assigns it to the ClassRef field. +func (o *TaskExtraLinksInner) SetClassRef(v ClassReference) { + o.ClassRef = &v +} + +func (o TaskExtraLinksInner) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TaskExtraLinksInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ClassRef) { + toSerialize["class_ref"] = o.ClassRef + } + return toSerialize, nil +} + +type NullableTaskExtraLinksInner struct { + value *TaskExtraLinksInner + isSet bool +} + +func (v NullableTaskExtraLinksInner) Get() *TaskExtraLinksInner { + return v.value +} + +func (v *NullableTaskExtraLinksInner) Set(val *TaskExtraLinksInner) { + v.value = val + v.isSet = true +} + +func (v NullableTaskExtraLinksInner) IsSet() bool { + return v.isSet +} + +func (v *NullableTaskExtraLinksInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTaskExtraLinksInner(val *TaskExtraLinksInner) *NullableTaskExtraLinksInner { + return &NullableTaskExtraLinksInner{value: val, isSet: true} +} + +func (v NullableTaskExtraLinksInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTaskExtraLinksInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/model_task_failed_dependency.go b/airflow/model_task_failed_dependency.go new file mode 100644 index 0000000..04022fc --- /dev/null +++ b/airflow/model_task_failed_dependency.go @@ -0,0 +1,163 @@ +/* +Airflow API (Stable) + +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. + +API version: 2.10.5 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package airflow + +import ( + "encoding/json" +) + +// checks if the TaskFailedDependency type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TaskFailedDependency{} + +// TaskFailedDependency struct for TaskFailedDependency +type TaskFailedDependency struct { + Name *string `json:"name,omitempty"` + Reason *string `json:"reason,omitempty"` +} + +// NewTaskFailedDependency instantiates a new TaskFailedDependency object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTaskFailedDependency() *TaskFailedDependency { + this := TaskFailedDependency{} + return &this +} + +// NewTaskFailedDependencyWithDefaults instantiates a new TaskFailedDependency object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTaskFailedDependencyWithDefaults() *TaskFailedDependency { + this := TaskFailedDependency{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *TaskFailedDependency) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskFailedDependency) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *TaskFailedDependency) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *TaskFailedDependency) SetName(v string) { + o.Name = &v +} + +// GetReason returns the Reason field value if set, zero value otherwise. +func (o *TaskFailedDependency) GetReason() string { + if o == nil || IsNil(o.Reason) { + var ret string + return ret + } + return *o.Reason +} + +// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskFailedDependency) GetReasonOk() (*string, bool) { + if o == nil || IsNil(o.Reason) { + return nil, false + } + return o.Reason, true +} + +// HasReason returns a boolean if a field has been set. +func (o *TaskFailedDependency) HasReason() bool { + if o != nil && !IsNil(o.Reason) { + return true + } + + return false +} + +// SetReason gets a reference to the given string and assigns it to the Reason field. +func (o *TaskFailedDependency) SetReason(v string) { + o.Reason = &v +} + +func (o TaskFailedDependency) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TaskFailedDependency) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Reason) { + toSerialize["reason"] = o.Reason + } + return toSerialize, nil +} + +type NullableTaskFailedDependency struct { + value *TaskFailedDependency + isSet bool +} + +func (v NullableTaskFailedDependency) Get() *TaskFailedDependency { + return v.value +} + +func (v *NullableTaskFailedDependency) Set(val *TaskFailedDependency) { + v.value = val + v.isSet = true +} + +func (v NullableTaskFailedDependency) IsSet() bool { + return v.isSet +} + +func (v *NullableTaskFailedDependency) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTaskFailedDependency(val *TaskFailedDependency) *NullableTaskFailedDependency { + return &NullableTaskFailedDependency{value: val, isSet: true} +} + +func (v NullableTaskFailedDependency) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTaskFailedDependency) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/model_task_instance.go b/airflow/model_task_instance.go index c8d1037..0d924c2 100644 --- a/airflow/model_task_instance.go +++ b/airflow/model_task_instance.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,38 +15,48 @@ import ( "encoding/json" ) +// checks if the TaskInstance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TaskInstance{} + // TaskInstance struct for TaskInstance type TaskInstance struct { - TaskId *string `json:"task_id,omitempty"` DagId *string `json:"dag_id,omitempty"` // The DagRun ID for this task instance *New in version 2.3.0* DagRunId *string `json:"dag_run_id,omitempty"` - ExecutionDate *string `json:"execution_date,omitempty"` - StartDate NullableString `json:"start_date,omitempty"` - EndDate NullableString `json:"end_date,omitempty"` Duration NullableFloat32 `json:"duration,omitempty"` - State *TaskState `json:"state,omitempty"` - TryNumber *int32 `json:"try_number,omitempty"` + EndDate NullableString `json:"end_date,omitempty"` + ExecutionDate *string `json:"execution_date,omitempty"` + // Executor the task is configured to run on or None (which indicates the default executor) *New in version 2.10.0* + Executor NullableString `json:"executor,omitempty"` + ExecutorConfig *string `json:"executor_config,omitempty"` + Hostname *string `json:"hostname,omitempty"` MapIndex *int32 `json:"map_index,omitempty"` MaxTries *int32 `json:"max_tries,omitempty"` - Hostname *string `json:"hostname,omitempty"` - Unixname *string `json:"unixname,omitempty"` + // Contains manually entered notes by the user about the TaskInstance. *New in version 2.5.0* + Note NullableString `json:"note,omitempty"` + // *Changed in version 2.1.1*: Field becomes nullable. + Operator NullableString `json:"operator,omitempty"` + Pid NullableInt32 `json:"pid,omitempty"` Pool *string `json:"pool,omitempty"` PoolSlots *int32 `json:"pool_slots,omitempty"` - Queue NullableString `json:"queue,omitempty"` PriorityWeight NullableInt32 `json:"priority_weight,omitempty"` - // *Changed in version 2.1.1*: Field becomes nullable. - Operator NullableString `json:"operator,omitempty"` + Queue NullableString `json:"queue,omitempty"` + // The datetime that the task enter the state QUEUE, also known as queue_at QueuedWhen NullableString `json:"queued_when,omitempty"` - Pid NullableInt32 `json:"pid,omitempty"` - ExecutorConfig *string `json:"executor_config,omitempty"` - SlaMiss NullableSLAMiss `json:"sla_miss,omitempty"` // JSON object describing rendered fields. *New in version 2.3.0* - RenderedFields *map[string]interface{} `json:"rendered_fields,omitempty"` - Trigger *Trigger `json:"trigger,omitempty"` - TriggererJob *Job `json:"triggerer_job,omitempty"` - // Contains manually entered notes by the user about the TaskInstance. *New in version 2.5.0* - Note NullableString `json:"note,omitempty"` + RenderedFields map[string]interface{} `json:"rendered_fields,omitempty"` + // Rendered name of an expanded task instance, if the task is mapped. *New in version 2.9.0* + RenderedMapIndex NullableString `json:"rendered_map_index,omitempty"` + SlaMiss NullableSLAMiss `json:"sla_miss,omitempty"` + StartDate NullableString `json:"start_date,omitempty"` + State NullableTaskState `json:"state,omitempty"` + // Human centric display text for the task. *New in version 2.9.0* + TaskDisplayName *string `json:"task_display_name,omitempty"` + TaskId *string `json:"task_id,omitempty"` + Trigger NullableTrigger `json:"trigger,omitempty"` + TriggererJob NullableJob `json:"triggerer_job,omitempty"` + TryNumber *int32 `json:"try_number,omitempty"` + Unixname *string `json:"unixname,omitempty"` } // NewTaskInstance instantiates a new TaskInstance object @@ -83,41 +76,9 @@ func NewTaskInstanceWithDefaults() *TaskInstance { return &this } -// GetTaskId returns the TaskId field value if set, zero value otherwise. -func (o *TaskInstance) GetTaskId() string { - if o == nil || o.TaskId == nil { - var ret string - return ret - } - return *o.TaskId -} - -// GetTaskIdOk returns a tuple with the TaskId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TaskInstance) GetTaskIdOk() (*string, bool) { - if o == nil || o.TaskId == nil { - return nil, false - } - return o.TaskId, true -} - -// HasTaskId returns a boolean if a field has been set. -func (o *TaskInstance) HasTaskId() bool { - if o != nil && o.TaskId != nil { - return true - } - - return false -} - -// SetTaskId gets a reference to the given string and assigns it to the TaskId field. -func (o *TaskInstance) SetTaskId(v string) { - o.TaskId = &v -} - // GetDagId returns the DagId field value if set, zero value otherwise. func (o *TaskInstance) GetDagId() string { - if o == nil || o.DagId == nil { + if o == nil || IsNil(o.DagId) { var ret string return ret } @@ -127,7 +88,7 @@ func (o *TaskInstance) GetDagId() string { // GetDagIdOk returns a tuple with the DagId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TaskInstance) GetDagIdOk() (*string, bool) { - if o == nil || o.DagId == nil { + if o == nil || IsNil(o.DagId) { return nil, false } return o.DagId, true @@ -135,7 +96,7 @@ func (o *TaskInstance) GetDagIdOk() (*string, bool) { // HasDagId returns a boolean if a field has been set. func (o *TaskInstance) HasDagId() bool { - if o != nil && o.DagId != nil { + if o != nil && !IsNil(o.DagId) { return true } @@ -149,7 +110,7 @@ func (o *TaskInstance) SetDagId(v string) { // GetDagRunId returns the DagRunId field value if set, zero value otherwise. func (o *TaskInstance) GetDagRunId() string { - if o == nil || o.DagRunId == nil { + if o == nil || IsNil(o.DagRunId) { var ret string return ret } @@ -159,7 +120,7 @@ func (o *TaskInstance) GetDagRunId() string { // GetDagRunIdOk returns a tuple with the DagRunId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TaskInstance) GetDagRunIdOk() (*string, bool) { - if o == nil || o.DagRunId == nil { + if o == nil || IsNil(o.DagRunId) { return nil, false } return o.DagRunId, true @@ -167,7 +128,7 @@ func (o *TaskInstance) GetDagRunIdOk() (*string, bool) { // HasDagRunId returns a boolean if a field has been set. func (o *TaskInstance) HasDagRunId() bool { - if o != nil && o.DagRunId != nil { + if o != nil && !IsNil(o.DagRunId) { return true } @@ -179,83 +140,51 @@ func (o *TaskInstance) SetDagRunId(v string) { o.DagRunId = &v } -// GetExecutionDate returns the ExecutionDate field value if set, zero value otherwise. -func (o *TaskInstance) GetExecutionDate() string { - if o == nil || o.ExecutionDate == nil { - var ret string - return ret - } - return *o.ExecutionDate -} - -// GetExecutionDateOk returns a tuple with the ExecutionDate field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TaskInstance) GetExecutionDateOk() (*string, bool) { - if o == nil || o.ExecutionDate == nil { - return nil, false - } - return o.ExecutionDate, true -} - -// HasExecutionDate returns a boolean if a field has been set. -func (o *TaskInstance) HasExecutionDate() bool { - if o != nil && o.ExecutionDate != nil { - return true - } - - return false -} - -// SetExecutionDate gets a reference to the given string and assigns it to the ExecutionDate field. -func (o *TaskInstance) SetExecutionDate(v string) { - o.ExecutionDate = &v -} - -// GetStartDate returns the StartDate field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *TaskInstance) GetStartDate() string { - if o == nil || o.StartDate.Get() == nil { - var ret string +// GetDuration returns the Duration field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskInstance) GetDuration() float32 { + if o == nil || IsNil(o.Duration.Get()) { + var ret float32 return ret } - return *o.StartDate.Get() + return *o.Duration.Get() } -// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise +// GetDurationOk returns a tuple with the Duration field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *TaskInstance) GetStartDateOk() (*string, bool) { - if o == nil { +func (o *TaskInstance) GetDurationOk() (*float32, bool) { + if o == nil { return nil, false } - return o.StartDate.Get(), o.StartDate.IsSet() + return o.Duration.Get(), o.Duration.IsSet() } -// HasStartDate returns a boolean if a field has been set. -func (o *TaskInstance) HasStartDate() bool { - if o != nil && o.StartDate.IsSet() { +// HasDuration returns a boolean if a field has been set. +func (o *TaskInstance) HasDuration() bool { + if o != nil && o.Duration.IsSet() { return true } return false } -// SetStartDate gets a reference to the given NullableString and assigns it to the StartDate field. -func (o *TaskInstance) SetStartDate(v string) { - o.StartDate.Set(&v) +// SetDuration gets a reference to the given NullableFloat32 and assigns it to the Duration field. +func (o *TaskInstance) SetDuration(v float32) { + o.Duration.Set(&v) } -// SetStartDateNil sets the value for StartDate to be an explicit nil -func (o *TaskInstance) SetStartDateNil() { - o.StartDate.Set(nil) +// SetDurationNil sets the value for Duration to be an explicit nil +func (o *TaskInstance) SetDurationNil() { + o.Duration.Set(nil) } -// UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil -func (o *TaskInstance) UnsetStartDate() { - o.StartDate.Unset() +// UnsetDuration ensures that no value is present for Duration, not even an explicit nil +func (o *TaskInstance) UnsetDuration() { + o.Duration.Unset() } // GetEndDate returns the EndDate field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TaskInstance) GetEndDate() string { - if o == nil || o.EndDate.Get() == nil { + if o == nil || IsNil(o.EndDate.Get()) { var ret string return ret } @@ -266,7 +195,7 @@ func (o *TaskInstance) GetEndDate() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *TaskInstance) GetEndDateOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.EndDate.Get(), o.EndDate.IsSet() @@ -295,115 +224,147 @@ func (o *TaskInstance) UnsetEndDate() { o.EndDate.Unset() } -// GetDuration returns the Duration field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *TaskInstance) GetDuration() float32 { - if o == nil || o.Duration.Get() == nil { - var ret float32 +// GetExecutionDate returns the ExecutionDate field value if set, zero value otherwise. +func (o *TaskInstance) GetExecutionDate() string { + if o == nil || IsNil(o.ExecutionDate) { + var ret string return ret } - return *o.Duration.Get() + return *o.ExecutionDate } -// GetDurationOk returns a tuple with the Duration field value if set, nil otherwise +// GetExecutionDateOk returns a tuple with the ExecutionDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskInstance) GetExecutionDateOk() (*string, bool) { + if o == nil || IsNil(o.ExecutionDate) { + return nil, false + } + return o.ExecutionDate, true +} + +// HasExecutionDate returns a boolean if a field has been set. +func (o *TaskInstance) HasExecutionDate() bool { + if o != nil && !IsNil(o.ExecutionDate) { + return true + } + + return false +} + +// SetExecutionDate gets a reference to the given string and assigns it to the ExecutionDate field. +func (o *TaskInstance) SetExecutionDate(v string) { + o.ExecutionDate = &v +} + +// GetExecutor returns the Executor field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskInstance) GetExecutor() string { + if o == nil || IsNil(o.Executor.Get()) { + var ret string + return ret + } + return *o.Executor.Get() +} + +// GetExecutorOk returns a tuple with the Executor field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *TaskInstance) GetDurationOk() (*float32, bool) { - if o == nil { +func (o *TaskInstance) GetExecutorOk() (*string, bool) { + if o == nil { return nil, false } - return o.Duration.Get(), o.Duration.IsSet() + return o.Executor.Get(), o.Executor.IsSet() } -// HasDuration returns a boolean if a field has been set. -func (o *TaskInstance) HasDuration() bool { - if o != nil && o.Duration.IsSet() { +// HasExecutor returns a boolean if a field has been set. +func (o *TaskInstance) HasExecutor() bool { + if o != nil && o.Executor.IsSet() { return true } return false } -// SetDuration gets a reference to the given NullableFloat32 and assigns it to the Duration field. -func (o *TaskInstance) SetDuration(v float32) { - o.Duration.Set(&v) +// SetExecutor gets a reference to the given NullableString and assigns it to the Executor field. +func (o *TaskInstance) SetExecutor(v string) { + o.Executor.Set(&v) } -// SetDurationNil sets the value for Duration to be an explicit nil -func (o *TaskInstance) SetDurationNil() { - o.Duration.Set(nil) +// SetExecutorNil sets the value for Executor to be an explicit nil +func (o *TaskInstance) SetExecutorNil() { + o.Executor.Set(nil) } -// UnsetDuration ensures that no value is present for Duration, not even an explicit nil -func (o *TaskInstance) UnsetDuration() { - o.Duration.Unset() +// UnsetExecutor ensures that no value is present for Executor, not even an explicit nil +func (o *TaskInstance) UnsetExecutor() { + o.Executor.Unset() } -// GetState returns the State field value if set, zero value otherwise. -func (o *TaskInstance) GetState() TaskState { - if o == nil || o.State == nil { - var ret TaskState +// GetExecutorConfig returns the ExecutorConfig field value if set, zero value otherwise. +func (o *TaskInstance) GetExecutorConfig() string { + if o == nil || IsNil(o.ExecutorConfig) { + var ret string return ret } - return *o.State + return *o.ExecutorConfig } -// GetStateOk returns a tuple with the State field value if set, nil otherwise +// GetExecutorConfigOk returns a tuple with the ExecutorConfig field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskInstance) GetStateOk() (*TaskState, bool) { - if o == nil || o.State == nil { +func (o *TaskInstance) GetExecutorConfigOk() (*string, bool) { + if o == nil || IsNil(o.ExecutorConfig) { return nil, false } - return o.State, true + return o.ExecutorConfig, true } -// HasState returns a boolean if a field has been set. -func (o *TaskInstance) HasState() bool { - if o != nil && o.State != nil { +// HasExecutorConfig returns a boolean if a field has been set. +func (o *TaskInstance) HasExecutorConfig() bool { + if o != nil && !IsNil(o.ExecutorConfig) { return true } return false } -// SetState gets a reference to the given TaskState and assigns it to the State field. -func (o *TaskInstance) SetState(v TaskState) { - o.State = &v +// SetExecutorConfig gets a reference to the given string and assigns it to the ExecutorConfig field. +func (o *TaskInstance) SetExecutorConfig(v string) { + o.ExecutorConfig = &v } -// GetTryNumber returns the TryNumber field value if set, zero value otherwise. -func (o *TaskInstance) GetTryNumber() int32 { - if o == nil || o.TryNumber == nil { - var ret int32 +// GetHostname returns the Hostname field value if set, zero value otherwise. +func (o *TaskInstance) GetHostname() string { + if o == nil || IsNil(o.Hostname) { + var ret string return ret } - return *o.TryNumber + return *o.Hostname } -// GetTryNumberOk returns a tuple with the TryNumber field value if set, nil otherwise +// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskInstance) GetTryNumberOk() (*int32, bool) { - if o == nil || o.TryNumber == nil { +func (o *TaskInstance) GetHostnameOk() (*string, bool) { + if o == nil || IsNil(o.Hostname) { return nil, false } - return o.TryNumber, true + return o.Hostname, true } -// HasTryNumber returns a boolean if a field has been set. -func (o *TaskInstance) HasTryNumber() bool { - if o != nil && o.TryNumber != nil { +// HasHostname returns a boolean if a field has been set. +func (o *TaskInstance) HasHostname() bool { + if o != nil && !IsNil(o.Hostname) { return true } return false } -// SetTryNumber gets a reference to the given int32 and assigns it to the TryNumber field. -func (o *TaskInstance) SetTryNumber(v int32) { - o.TryNumber = &v +// SetHostname gets a reference to the given string and assigns it to the Hostname field. +func (o *TaskInstance) SetHostname(v string) { + o.Hostname = &v } // GetMapIndex returns the MapIndex field value if set, zero value otherwise. func (o *TaskInstance) GetMapIndex() int32 { - if o == nil || o.MapIndex == nil { + if o == nil || IsNil(o.MapIndex) { var ret int32 return ret } @@ -413,7 +374,7 @@ func (o *TaskInstance) GetMapIndex() int32 { // GetMapIndexOk returns a tuple with the MapIndex field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TaskInstance) GetMapIndexOk() (*int32, bool) { - if o == nil || o.MapIndex == nil { + if o == nil || IsNil(o.MapIndex) { return nil, false } return o.MapIndex, true @@ -421,7 +382,7 @@ func (o *TaskInstance) GetMapIndexOk() (*int32, bool) { // HasMapIndex returns a boolean if a field has been set. func (o *TaskInstance) HasMapIndex() bool { - if o != nil && o.MapIndex != nil { + if o != nil && !IsNil(o.MapIndex) { return true } @@ -435,7 +396,7 @@ func (o *TaskInstance) SetMapIndex(v int32) { // GetMaxTries returns the MaxTries field value if set, zero value otherwise. func (o *TaskInstance) GetMaxTries() int32 { - if o == nil || o.MaxTries == nil { + if o == nil || IsNil(o.MaxTries) { var ret int32 return ret } @@ -445,7 +406,7 @@ func (o *TaskInstance) GetMaxTries() int32 { // GetMaxTriesOk returns a tuple with the MaxTries field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TaskInstance) GetMaxTriesOk() (*int32, bool) { - if o == nil || o.MaxTries == nil { + if o == nil || IsNil(o.MaxTries) { return nil, false } return o.MaxTries, true @@ -453,7 +414,7 @@ func (o *TaskInstance) GetMaxTriesOk() (*int32, bool) { // HasMaxTries returns a boolean if a field has been set. func (o *TaskInstance) HasMaxTries() bool { - if o != nil && o.MaxTries != nil { + if o != nil && !IsNil(o.MaxTries) { return true } @@ -465,73 +426,135 @@ func (o *TaskInstance) SetMaxTries(v int32) { o.MaxTries = &v } -// GetHostname returns the Hostname field value if set, zero value otherwise. -func (o *TaskInstance) GetHostname() string { - if o == nil || o.Hostname == nil { +// GetNote returns the Note field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskInstance) GetNote() string { + if o == nil || IsNil(o.Note.Get()) { var ret string return ret } - return *o.Hostname + return *o.Note.Get() } -// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise +// GetNoteOk returns a tuple with the Note field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskInstance) GetHostnameOk() (*string, bool) { - if o == nil || o.Hostname == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskInstance) GetNoteOk() (*string, bool) { + if o == nil { return nil, false } - return o.Hostname, true + return o.Note.Get(), o.Note.IsSet() } -// HasHostname returns a boolean if a field has been set. -func (o *TaskInstance) HasHostname() bool { - if o != nil && o.Hostname != nil { +// HasNote returns a boolean if a field has been set. +func (o *TaskInstance) HasNote() bool { + if o != nil && o.Note.IsSet() { return true } return false } -// SetHostname gets a reference to the given string and assigns it to the Hostname field. -func (o *TaskInstance) SetHostname(v string) { - o.Hostname = &v +// SetNote gets a reference to the given NullableString and assigns it to the Note field. +func (o *TaskInstance) SetNote(v string) { + o.Note.Set(&v) } - -// GetUnixname returns the Unixname field value if set, zero value otherwise. -func (o *TaskInstance) GetUnixname() string { - if o == nil || o.Unixname == nil { - var ret string - return ret - } - return *o.Unixname +// SetNoteNil sets the value for Note to be an explicit nil +func (o *TaskInstance) SetNoteNil() { + o.Note.Set(nil) } -// GetUnixnameOk returns a tuple with the Unixname field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TaskInstance) GetUnixnameOk() (*string, bool) { - if o == nil || o.Unixname == nil { +// UnsetNote ensures that no value is present for Note, not even an explicit nil +func (o *TaskInstance) UnsetNote() { + o.Note.Unset() +} + +// GetOperator returns the Operator field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskInstance) GetOperator() string { + if o == nil || IsNil(o.Operator.Get()) { + var ret string + return ret + } + return *o.Operator.Get() +} + +// GetOperatorOk returns a tuple with the Operator field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskInstance) GetOperatorOk() (*string, bool) { + if o == nil { return nil, false } - return o.Unixname, true + return o.Operator.Get(), o.Operator.IsSet() } -// HasUnixname returns a boolean if a field has been set. -func (o *TaskInstance) HasUnixname() bool { - if o != nil && o.Unixname != nil { +// HasOperator returns a boolean if a field has been set. +func (o *TaskInstance) HasOperator() bool { + if o != nil && o.Operator.IsSet() { return true } return false } -// SetUnixname gets a reference to the given string and assigns it to the Unixname field. -func (o *TaskInstance) SetUnixname(v string) { - o.Unixname = &v +// SetOperator gets a reference to the given NullableString and assigns it to the Operator field. +func (o *TaskInstance) SetOperator(v string) { + o.Operator.Set(&v) +} +// SetOperatorNil sets the value for Operator to be an explicit nil +func (o *TaskInstance) SetOperatorNil() { + o.Operator.Set(nil) +} + +// UnsetOperator ensures that no value is present for Operator, not even an explicit nil +func (o *TaskInstance) UnsetOperator() { + o.Operator.Unset() +} + +// GetPid returns the Pid field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskInstance) GetPid() int32 { + if o == nil || IsNil(o.Pid.Get()) { + var ret int32 + return ret + } + return *o.Pid.Get() +} + +// GetPidOk returns a tuple with the Pid field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskInstance) GetPidOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Pid.Get(), o.Pid.IsSet() +} + +// HasPid returns a boolean if a field has been set. +func (o *TaskInstance) HasPid() bool { + if o != nil && o.Pid.IsSet() { + return true + } + + return false +} + +// SetPid gets a reference to the given NullableInt32 and assigns it to the Pid field. +func (o *TaskInstance) SetPid(v int32) { + o.Pid.Set(&v) +} +// SetPidNil sets the value for Pid to be an explicit nil +func (o *TaskInstance) SetPidNil() { + o.Pid.Set(nil) +} + +// UnsetPid ensures that no value is present for Pid, not even an explicit nil +func (o *TaskInstance) UnsetPid() { + o.Pid.Unset() } // GetPool returns the Pool field value if set, zero value otherwise. func (o *TaskInstance) GetPool() string { - if o == nil || o.Pool == nil { + if o == nil || IsNil(o.Pool) { var ret string return ret } @@ -541,7 +564,7 @@ func (o *TaskInstance) GetPool() string { // GetPoolOk returns a tuple with the Pool field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TaskInstance) GetPoolOk() (*string, bool) { - if o == nil || o.Pool == nil { + if o == nil || IsNil(o.Pool) { return nil, false } return o.Pool, true @@ -549,7 +572,7 @@ func (o *TaskInstance) GetPoolOk() (*string, bool) { // HasPool returns a boolean if a field has been set. func (o *TaskInstance) HasPool() bool { - if o != nil && o.Pool != nil { + if o != nil && !IsNil(o.Pool) { return true } @@ -563,7 +586,7 @@ func (o *TaskInstance) SetPool(v string) { // GetPoolSlots returns the PoolSlots field value if set, zero value otherwise. func (o *TaskInstance) GetPoolSlots() int32 { - if o == nil || o.PoolSlots == nil { + if o == nil || IsNil(o.PoolSlots) { var ret int32 return ret } @@ -573,7 +596,7 @@ func (o *TaskInstance) GetPoolSlots() int32 { // GetPoolSlotsOk returns a tuple with the PoolSlots field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TaskInstance) GetPoolSlotsOk() (*int32, bool) { - if o == nil || o.PoolSlots == nil { + if o == nil || IsNil(o.PoolSlots) { return nil, false } return o.PoolSlots, true @@ -581,7 +604,7 @@ func (o *TaskInstance) GetPoolSlotsOk() (*int32, bool) { // HasPoolSlots returns a boolean if a field has been set. func (o *TaskInstance) HasPoolSlots() bool { - if o != nil && o.PoolSlots != nil { + if o != nil && !IsNil(o.PoolSlots) { return true } @@ -593,51 +616,9 @@ func (o *TaskInstance) SetPoolSlots(v int32) { o.PoolSlots = &v } -// GetQueue returns the Queue field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *TaskInstance) GetQueue() string { - if o == nil || o.Queue.Get() == nil { - var ret string - return ret - } - return *o.Queue.Get() -} - -// GetQueueOk returns a tuple with the Queue field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *TaskInstance) GetQueueOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.Queue.Get(), o.Queue.IsSet() -} - -// HasQueue returns a boolean if a field has been set. -func (o *TaskInstance) HasQueue() bool { - if o != nil && o.Queue.IsSet() { - return true - } - - return false -} - -// SetQueue gets a reference to the given NullableString and assigns it to the Queue field. -func (o *TaskInstance) SetQueue(v string) { - o.Queue.Set(&v) -} -// SetQueueNil sets the value for Queue to be an explicit nil -func (o *TaskInstance) SetQueueNil() { - o.Queue.Set(nil) -} - -// UnsetQueue ensures that no value is present for Queue, not even an explicit nil -func (o *TaskInstance) UnsetQueue() { - o.Queue.Unset() -} - // GetPriorityWeight returns the PriorityWeight field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TaskInstance) GetPriorityWeight() int32 { - if o == nil || o.PriorityWeight.Get() == nil { + if o == nil || IsNil(o.PriorityWeight.Get()) { var ret int32 return ret } @@ -648,7 +629,7 @@ func (o *TaskInstance) GetPriorityWeight() int32 { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *TaskInstance) GetPriorityWeightOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return o.PriorityWeight.Get(), o.PriorityWeight.IsSet() @@ -677,51 +658,51 @@ func (o *TaskInstance) UnsetPriorityWeight() { o.PriorityWeight.Unset() } -// GetOperator returns the Operator field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *TaskInstance) GetOperator() string { - if o == nil || o.Operator.Get() == nil { +// GetQueue returns the Queue field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskInstance) GetQueue() string { + if o == nil || IsNil(o.Queue.Get()) { var ret string return ret } - return *o.Operator.Get() + return *o.Queue.Get() } -// GetOperatorOk returns a tuple with the Operator field value if set, nil otherwise +// GetQueueOk returns a tuple with the Queue field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *TaskInstance) GetOperatorOk() (*string, bool) { - if o == nil { +func (o *TaskInstance) GetQueueOk() (*string, bool) { + if o == nil { return nil, false } - return o.Operator.Get(), o.Operator.IsSet() + return o.Queue.Get(), o.Queue.IsSet() } -// HasOperator returns a boolean if a field has been set. -func (o *TaskInstance) HasOperator() bool { - if o != nil && o.Operator.IsSet() { +// HasQueue returns a boolean if a field has been set. +func (o *TaskInstance) HasQueue() bool { + if o != nil && o.Queue.IsSet() { return true } return false } -// SetOperator gets a reference to the given NullableString and assigns it to the Operator field. -func (o *TaskInstance) SetOperator(v string) { - o.Operator.Set(&v) +// SetQueue gets a reference to the given NullableString and assigns it to the Queue field. +func (o *TaskInstance) SetQueue(v string) { + o.Queue.Set(&v) } -// SetOperatorNil sets the value for Operator to be an explicit nil -func (o *TaskInstance) SetOperatorNil() { - o.Operator.Set(nil) +// SetQueueNil sets the value for Queue to be an explicit nil +func (o *TaskInstance) SetQueueNil() { + o.Queue.Set(nil) } -// UnsetOperator ensures that no value is present for Operator, not even an explicit nil -func (o *TaskInstance) UnsetOperator() { - o.Operator.Unset() +// UnsetQueue ensures that no value is present for Queue, not even an explicit nil +func (o *TaskInstance) UnsetQueue() { + o.Queue.Unset() } // GetQueuedWhen returns the QueuedWhen field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TaskInstance) GetQueuedWhen() string { - if o == nil || o.QueuedWhen.Get() == nil { + if o == nil || IsNil(o.QueuedWhen.Get()) { var ret string return ret } @@ -732,7 +713,7 @@ func (o *TaskInstance) GetQueuedWhen() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *TaskInstance) GetQueuedWhenOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.QueuedWhen.Get(), o.QueuedWhen.IsSet() @@ -761,83 +742,83 @@ func (o *TaskInstance) UnsetQueuedWhen() { o.QueuedWhen.Unset() } -// GetPid returns the Pid field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *TaskInstance) GetPid() int32 { - if o == nil || o.Pid.Get() == nil { - var ret int32 +// GetRenderedFields returns the RenderedFields field value if set, zero value otherwise. +func (o *TaskInstance) GetRenderedFields() map[string]interface{} { + if o == nil || IsNil(o.RenderedFields) { + var ret map[string]interface{} return ret } - return *o.Pid.Get() + return o.RenderedFields } -// GetPidOk returns a tuple with the Pid field value if set, nil otherwise +// GetRenderedFieldsOk returns a tuple with the RenderedFields field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *TaskInstance) GetPidOk() (*int32, bool) { - if o == nil { - return nil, false +func (o *TaskInstance) GetRenderedFieldsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.RenderedFields) { + return map[string]interface{}{}, false } - return o.Pid.Get(), o.Pid.IsSet() + return o.RenderedFields, true } -// HasPid returns a boolean if a field has been set. -func (o *TaskInstance) HasPid() bool { - if o != nil && o.Pid.IsSet() { +// HasRenderedFields returns a boolean if a field has been set. +func (o *TaskInstance) HasRenderedFields() bool { + if o != nil && !IsNil(o.RenderedFields) { return true } return false } -// SetPid gets a reference to the given NullableInt32 and assigns it to the Pid field. -func (o *TaskInstance) SetPid(v int32) { - o.Pid.Set(&v) -} -// SetPidNil sets the value for Pid to be an explicit nil -func (o *TaskInstance) SetPidNil() { - o.Pid.Set(nil) -} - -// UnsetPid ensures that no value is present for Pid, not even an explicit nil -func (o *TaskInstance) UnsetPid() { - o.Pid.Unset() +// SetRenderedFields gets a reference to the given map[string]interface{} and assigns it to the RenderedFields field. +func (o *TaskInstance) SetRenderedFields(v map[string]interface{}) { + o.RenderedFields = v } -// GetExecutorConfig returns the ExecutorConfig field value if set, zero value otherwise. -func (o *TaskInstance) GetExecutorConfig() string { - if o == nil || o.ExecutorConfig == nil { +// GetRenderedMapIndex returns the RenderedMapIndex field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskInstance) GetRenderedMapIndex() string { + if o == nil || IsNil(o.RenderedMapIndex.Get()) { var ret string return ret } - return *o.ExecutorConfig + return *o.RenderedMapIndex.Get() } -// GetExecutorConfigOk returns a tuple with the ExecutorConfig field value if set, nil otherwise +// GetRenderedMapIndexOk returns a tuple with the RenderedMapIndex field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskInstance) GetExecutorConfigOk() (*string, bool) { - if o == nil || o.ExecutorConfig == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskInstance) GetRenderedMapIndexOk() (*string, bool) { + if o == nil { return nil, false } - return o.ExecutorConfig, true + return o.RenderedMapIndex.Get(), o.RenderedMapIndex.IsSet() } -// HasExecutorConfig returns a boolean if a field has been set. -func (o *TaskInstance) HasExecutorConfig() bool { - if o != nil && o.ExecutorConfig != nil { +// HasRenderedMapIndex returns a boolean if a field has been set. +func (o *TaskInstance) HasRenderedMapIndex() bool { + if o != nil && o.RenderedMapIndex.IsSet() { return true } return false } -// SetExecutorConfig gets a reference to the given string and assigns it to the ExecutorConfig field. -func (o *TaskInstance) SetExecutorConfig(v string) { - o.ExecutorConfig = &v +// SetRenderedMapIndex gets a reference to the given NullableString and assigns it to the RenderedMapIndex field. +func (o *TaskInstance) SetRenderedMapIndex(v string) { + o.RenderedMapIndex.Set(&v) +} +// SetRenderedMapIndexNil sets the value for RenderedMapIndex to be an explicit nil +func (o *TaskInstance) SetRenderedMapIndexNil() { + o.RenderedMapIndex.Set(nil) +} + +// UnsetRenderedMapIndex ensures that no value is present for RenderedMapIndex, not even an explicit nil +func (o *TaskInstance) UnsetRenderedMapIndex() { + o.RenderedMapIndex.Unset() } // GetSlaMiss returns the SlaMiss field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TaskInstance) GetSlaMiss() SLAMiss { - if o == nil || o.SlaMiss.Get() == nil { + if o == nil || IsNil(o.SlaMiss.Get()) { var ret SLAMiss return ret } @@ -848,7 +829,7 @@ func (o *TaskInstance) GetSlaMiss() SLAMiss { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *TaskInstance) GetSlaMissOk() (*SLAMiss, bool) { - if o == nil { + if o == nil { return nil, false } return o.SlaMiss.Get(), o.SlaMiss.IsSet() @@ -877,225 +858,400 @@ func (o *TaskInstance) UnsetSlaMiss() { o.SlaMiss.Unset() } -// GetRenderedFields returns the RenderedFields field value if set, zero value otherwise. -func (o *TaskInstance) GetRenderedFields() map[string]interface{} { - if o == nil || o.RenderedFields == nil { - var ret map[string]interface{} +// GetStartDate returns the StartDate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskInstance) GetStartDate() string { + if o == nil || IsNil(o.StartDate.Get()) { + var ret string return ret } - return *o.RenderedFields + return *o.StartDate.Get() } -// GetRenderedFieldsOk returns a tuple with the RenderedFields field value if set, nil otherwise +// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskInstance) GetRenderedFieldsOk() (*map[string]interface{}, bool) { - if o == nil || o.RenderedFields == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskInstance) GetStartDateOk() (*string, bool) { + if o == nil { return nil, false } - return o.RenderedFields, true + return o.StartDate.Get(), o.StartDate.IsSet() } -// HasRenderedFields returns a boolean if a field has been set. -func (o *TaskInstance) HasRenderedFields() bool { - if o != nil && o.RenderedFields != nil { +// HasStartDate returns a boolean if a field has been set. +func (o *TaskInstance) HasStartDate() bool { + if o != nil && o.StartDate.IsSet() { return true } return false } -// SetRenderedFields gets a reference to the given map[string]interface{} and assigns it to the RenderedFields field. -func (o *TaskInstance) SetRenderedFields(v map[string]interface{}) { - o.RenderedFields = &v +// SetStartDate gets a reference to the given NullableString and assigns it to the StartDate field. +func (o *TaskInstance) SetStartDate(v string) { + o.StartDate.Set(&v) +} +// SetStartDateNil sets the value for StartDate to be an explicit nil +func (o *TaskInstance) SetStartDateNil() { + o.StartDate.Set(nil) +} + +// UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil +func (o *TaskInstance) UnsetStartDate() { + o.StartDate.Unset() +} + +// GetState returns the State field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskInstance) GetState() TaskState { + if o == nil || IsNil(o.State.Get()) { + var ret TaskState + return ret + } + return *o.State.Get() +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskInstance) GetStateOk() (*TaskState, bool) { + if o == nil { + return nil, false + } + return o.State.Get(), o.State.IsSet() +} + +// HasState returns a boolean if a field has been set. +func (o *TaskInstance) HasState() bool { + if o != nil && o.State.IsSet() { + return true + } + + return false +} + +// SetState gets a reference to the given NullableTaskState and assigns it to the State field. +func (o *TaskInstance) SetState(v TaskState) { + o.State.Set(&v) +} +// SetStateNil sets the value for State to be an explicit nil +func (o *TaskInstance) SetStateNil() { + o.State.Set(nil) +} + +// UnsetState ensures that no value is present for State, not even an explicit nil +func (o *TaskInstance) UnsetState() { + o.State.Unset() +} + +// GetTaskDisplayName returns the TaskDisplayName field value if set, zero value otherwise. +func (o *TaskInstance) GetTaskDisplayName() string { + if o == nil || IsNil(o.TaskDisplayName) { + var ret string + return ret + } + return *o.TaskDisplayName } -// GetTrigger returns the Trigger field value if set, zero value otherwise. +// GetTaskDisplayNameOk returns a tuple with the TaskDisplayName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskInstance) GetTaskDisplayNameOk() (*string, bool) { + if o == nil || IsNil(o.TaskDisplayName) { + return nil, false + } + return o.TaskDisplayName, true +} + +// HasTaskDisplayName returns a boolean if a field has been set. +func (o *TaskInstance) HasTaskDisplayName() bool { + if o != nil && !IsNil(o.TaskDisplayName) { + return true + } + + return false +} + +// SetTaskDisplayName gets a reference to the given string and assigns it to the TaskDisplayName field. +func (o *TaskInstance) SetTaskDisplayName(v string) { + o.TaskDisplayName = &v +} + +// GetTaskId returns the TaskId field value if set, zero value otherwise. +func (o *TaskInstance) GetTaskId() string { + if o == nil || IsNil(o.TaskId) { + var ret string + return ret + } + return *o.TaskId +} + +// GetTaskIdOk returns a tuple with the TaskId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskInstance) GetTaskIdOk() (*string, bool) { + if o == nil || IsNil(o.TaskId) { + return nil, false + } + return o.TaskId, true +} + +// HasTaskId returns a boolean if a field has been set. +func (o *TaskInstance) HasTaskId() bool { + if o != nil && !IsNil(o.TaskId) { + return true + } + + return false +} + +// SetTaskId gets a reference to the given string and assigns it to the TaskId field. +func (o *TaskInstance) SetTaskId(v string) { + o.TaskId = &v +} + +// GetTrigger returns the Trigger field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TaskInstance) GetTrigger() Trigger { - if o == nil || o.Trigger == nil { + if o == nil || IsNil(o.Trigger.Get()) { var ret Trigger return ret } - return *o.Trigger + return *o.Trigger.Get() } // GetTriggerOk returns a tuple with the Trigger field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *TaskInstance) GetTriggerOk() (*Trigger, bool) { - if o == nil || o.Trigger == nil { + if o == nil { return nil, false } - return o.Trigger, true + return o.Trigger.Get(), o.Trigger.IsSet() } // HasTrigger returns a boolean if a field has been set. func (o *TaskInstance) HasTrigger() bool { - if o != nil && o.Trigger != nil { + if o != nil && o.Trigger.IsSet() { return true } return false } -// SetTrigger gets a reference to the given Trigger and assigns it to the Trigger field. +// SetTrigger gets a reference to the given NullableTrigger and assigns it to the Trigger field. func (o *TaskInstance) SetTrigger(v Trigger) { - o.Trigger = &v + o.Trigger.Set(&v) +} +// SetTriggerNil sets the value for Trigger to be an explicit nil +func (o *TaskInstance) SetTriggerNil() { + o.Trigger.Set(nil) } -// GetTriggererJob returns the TriggererJob field value if set, zero value otherwise. +// UnsetTrigger ensures that no value is present for Trigger, not even an explicit nil +func (o *TaskInstance) UnsetTrigger() { + o.Trigger.Unset() +} + +// GetTriggererJob returns the TriggererJob field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TaskInstance) GetTriggererJob() Job { - if o == nil || o.TriggererJob == nil { + if o == nil || IsNil(o.TriggererJob.Get()) { var ret Job return ret } - return *o.TriggererJob + return *o.TriggererJob.Get() } // GetTriggererJobOk returns a tuple with the TriggererJob field value if set, nil otherwise // and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *TaskInstance) GetTriggererJobOk() (*Job, bool) { - if o == nil || o.TriggererJob == nil { + if o == nil { return nil, false } - return o.TriggererJob, true + return o.TriggererJob.Get(), o.TriggererJob.IsSet() } // HasTriggererJob returns a boolean if a field has been set. func (o *TaskInstance) HasTriggererJob() bool { - if o != nil && o.TriggererJob != nil { + if o != nil && o.TriggererJob.IsSet() { return true } return false } -// SetTriggererJob gets a reference to the given Job and assigns it to the TriggererJob field. +// SetTriggererJob gets a reference to the given NullableJob and assigns it to the TriggererJob field. func (o *TaskInstance) SetTriggererJob(v Job) { - o.TriggererJob = &v + o.TriggererJob.Set(&v) +} +// SetTriggererJobNil sets the value for TriggererJob to be an explicit nil +func (o *TaskInstance) SetTriggererJobNil() { + o.TriggererJob.Set(nil) } -// GetNote returns the Note field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *TaskInstance) GetNote() string { - if o == nil || o.Note.Get() == nil { - var ret string +// UnsetTriggererJob ensures that no value is present for TriggererJob, not even an explicit nil +func (o *TaskInstance) UnsetTriggererJob() { + o.TriggererJob.Unset() +} + +// GetTryNumber returns the TryNumber field value if set, zero value otherwise. +func (o *TaskInstance) GetTryNumber() int32 { + if o == nil || IsNil(o.TryNumber) { + var ret int32 return ret } - return *o.Note.Get() + return *o.TryNumber } -// GetNoteOk returns a tuple with the Note field value if set, nil otherwise +// GetTryNumberOk returns a tuple with the TryNumber field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *TaskInstance) GetNoteOk() (*string, bool) { - if o == nil { +func (o *TaskInstance) GetTryNumberOk() (*int32, bool) { + if o == nil || IsNil(o.TryNumber) { return nil, false } - return o.Note.Get(), o.Note.IsSet() + return o.TryNumber, true } -// HasNote returns a boolean if a field has been set. -func (o *TaskInstance) HasNote() bool { - if o != nil && o.Note.IsSet() { +// HasTryNumber returns a boolean if a field has been set. +func (o *TaskInstance) HasTryNumber() bool { + if o != nil && !IsNil(o.TryNumber) { return true } return false } -// SetNote gets a reference to the given NullableString and assigns it to the Note field. -func (o *TaskInstance) SetNote(v string) { - o.Note.Set(&v) +// SetTryNumber gets a reference to the given int32 and assigns it to the TryNumber field. +func (o *TaskInstance) SetTryNumber(v int32) { + o.TryNumber = &v } -// SetNoteNil sets the value for Note to be an explicit nil -func (o *TaskInstance) SetNoteNil() { - o.Note.Set(nil) + +// GetUnixname returns the Unixname field value if set, zero value otherwise. +func (o *TaskInstance) GetUnixname() string { + if o == nil || IsNil(o.Unixname) { + var ret string + return ret + } + return *o.Unixname } -// UnsetNote ensures that no value is present for Note, not even an explicit nil -func (o *TaskInstance) UnsetNote() { - o.Note.Unset() +// GetUnixnameOk returns a tuple with the Unixname field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskInstance) GetUnixnameOk() (*string, bool) { + if o == nil || IsNil(o.Unixname) { + return nil, false + } + return o.Unixname, true +} + +// HasUnixname returns a boolean if a field has been set. +func (o *TaskInstance) HasUnixname() bool { + if o != nil && !IsNil(o.Unixname) { + return true + } + + return false +} + +// SetUnixname gets a reference to the given string and assigns it to the Unixname field. +func (o *TaskInstance) SetUnixname(v string) { + o.Unixname = &v } func (o TaskInstance) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.TaskId != nil { - toSerialize["task_id"] = o.TaskId + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.DagId != nil { + return json.Marshal(toSerialize) +} + +func (o TaskInstance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DagId) { toSerialize["dag_id"] = o.DagId } - if o.DagRunId != nil { + if !IsNil(o.DagRunId) { toSerialize["dag_run_id"] = o.DagRunId } - if o.ExecutionDate != nil { - toSerialize["execution_date"] = o.ExecutionDate - } - if o.StartDate.IsSet() { - toSerialize["start_date"] = o.StartDate.Get() + if o.Duration.IsSet() { + toSerialize["duration"] = o.Duration.Get() } if o.EndDate.IsSet() { toSerialize["end_date"] = o.EndDate.Get() } - if o.Duration.IsSet() { - toSerialize["duration"] = o.Duration.Get() + if !IsNil(o.ExecutionDate) { + toSerialize["execution_date"] = o.ExecutionDate } - if o.State != nil { - toSerialize["state"] = o.State + if o.Executor.IsSet() { + toSerialize["executor"] = o.Executor.Get() } - if o.TryNumber != nil { - toSerialize["try_number"] = o.TryNumber + if !IsNil(o.ExecutorConfig) { + toSerialize["executor_config"] = o.ExecutorConfig } - if o.MapIndex != nil { + if !IsNil(o.Hostname) { + toSerialize["hostname"] = o.Hostname + } + if !IsNil(o.MapIndex) { toSerialize["map_index"] = o.MapIndex } - if o.MaxTries != nil { + if !IsNil(o.MaxTries) { toSerialize["max_tries"] = o.MaxTries } - if o.Hostname != nil { - toSerialize["hostname"] = o.Hostname + if o.Note.IsSet() { + toSerialize["note"] = o.Note.Get() } - if o.Unixname != nil { - toSerialize["unixname"] = o.Unixname + if o.Operator.IsSet() { + toSerialize["operator"] = o.Operator.Get() } - if o.Pool != nil { + if o.Pid.IsSet() { + toSerialize["pid"] = o.Pid.Get() + } + if !IsNil(o.Pool) { toSerialize["pool"] = o.Pool } - if o.PoolSlots != nil { + if !IsNil(o.PoolSlots) { toSerialize["pool_slots"] = o.PoolSlots } - if o.Queue.IsSet() { - toSerialize["queue"] = o.Queue.Get() - } if o.PriorityWeight.IsSet() { toSerialize["priority_weight"] = o.PriorityWeight.Get() } - if o.Operator.IsSet() { - toSerialize["operator"] = o.Operator.Get() + if o.Queue.IsSet() { + toSerialize["queue"] = o.Queue.Get() } if o.QueuedWhen.IsSet() { toSerialize["queued_when"] = o.QueuedWhen.Get() } - if o.Pid.IsSet() { - toSerialize["pid"] = o.Pid.Get() + if !IsNil(o.RenderedFields) { + toSerialize["rendered_fields"] = o.RenderedFields } - if o.ExecutorConfig != nil { - toSerialize["executor_config"] = o.ExecutorConfig + if o.RenderedMapIndex.IsSet() { + toSerialize["rendered_map_index"] = o.RenderedMapIndex.Get() } if o.SlaMiss.IsSet() { toSerialize["sla_miss"] = o.SlaMiss.Get() } - if o.RenderedFields != nil { - toSerialize["rendered_fields"] = o.RenderedFields + if o.StartDate.IsSet() { + toSerialize["start_date"] = o.StartDate.Get() } - if o.Trigger != nil { - toSerialize["trigger"] = o.Trigger + if o.State.IsSet() { + toSerialize["state"] = o.State.Get() } - if o.TriggererJob != nil { - toSerialize["triggerer_job"] = o.TriggererJob + if !IsNil(o.TaskDisplayName) { + toSerialize["task_display_name"] = o.TaskDisplayName } - if o.Note.IsSet() { - toSerialize["note"] = o.Note.Get() + if !IsNil(o.TaskId) { + toSerialize["task_id"] = o.TaskId } - return json.Marshal(toSerialize) + if o.Trigger.IsSet() { + toSerialize["trigger"] = o.Trigger.Get() + } + if o.TriggererJob.IsSet() { + toSerialize["triggerer_job"] = o.TriggererJob.Get() + } + if !IsNil(o.TryNumber) { + toSerialize["try_number"] = o.TryNumber + } + if !IsNil(o.Unixname) { + toSerialize["unixname"] = o.Unixname + } + return toSerialize, nil } type NullableTaskInstance struct { diff --git a/airflow/model_task_instance_collection.go b/airflow/model_task_instance_collection.go index da08fd6..850d1e3 100644 --- a/airflow/model_task_instance_collection.go +++ b/airflow/model_task_instance_collection.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,11 +15,14 @@ import ( "encoding/json" ) +// checks if the TaskInstanceCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TaskInstanceCollection{} + // TaskInstanceCollection Collection of task instances. *Changed in version 2.1.0*: 'total_entries' field is added. type TaskInstanceCollection struct { - TaskInstances *[]TaskInstance `json:"task_instances,omitempty"` - // Count of objects in the current result set. + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. TotalEntries *int32 `json:"total_entries,omitempty"` + TaskInstances []TaskInstance `json:"task_instances,omitempty"` } // NewTaskInstanceCollection instantiates a new TaskInstanceCollection object @@ -56,79 +42,87 @@ func NewTaskInstanceCollectionWithDefaults() *TaskInstanceCollection { return &this } -// GetTaskInstances returns the TaskInstances field value if set, zero value otherwise. -func (o *TaskInstanceCollection) GetTaskInstances() []TaskInstance { - if o == nil || o.TaskInstances == nil { - var ret []TaskInstance +// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. +func (o *TaskInstanceCollection) GetTotalEntries() int32 { + if o == nil || IsNil(o.TotalEntries) { + var ret int32 return ret } - return *o.TaskInstances + return *o.TotalEntries } -// GetTaskInstancesOk returns a tuple with the TaskInstances field value if set, nil otherwise +// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskInstanceCollection) GetTaskInstancesOk() (*[]TaskInstance, bool) { - if o == nil || o.TaskInstances == nil { +func (o *TaskInstanceCollection) GetTotalEntriesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalEntries) { return nil, false } - return o.TaskInstances, true + return o.TotalEntries, true } -// HasTaskInstances returns a boolean if a field has been set. -func (o *TaskInstanceCollection) HasTaskInstances() bool { - if o != nil && o.TaskInstances != nil { +// HasTotalEntries returns a boolean if a field has been set. +func (o *TaskInstanceCollection) HasTotalEntries() bool { + if o != nil && !IsNil(o.TotalEntries) { return true } return false } -// SetTaskInstances gets a reference to the given []TaskInstance and assigns it to the TaskInstances field. -func (o *TaskInstanceCollection) SetTaskInstances(v []TaskInstance) { - o.TaskInstances = &v +// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. +func (o *TaskInstanceCollection) SetTotalEntries(v int32) { + o.TotalEntries = &v } -// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. -func (o *TaskInstanceCollection) GetTotalEntries() int32 { - if o == nil || o.TotalEntries == nil { - var ret int32 +// GetTaskInstances returns the TaskInstances field value if set, zero value otherwise. +func (o *TaskInstanceCollection) GetTaskInstances() []TaskInstance { + if o == nil || IsNil(o.TaskInstances) { + var ret []TaskInstance return ret } - return *o.TotalEntries + return o.TaskInstances } -// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise +// GetTaskInstancesOk returns a tuple with the TaskInstances field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskInstanceCollection) GetTotalEntriesOk() (*int32, bool) { - if o == nil || o.TotalEntries == nil { +func (o *TaskInstanceCollection) GetTaskInstancesOk() ([]TaskInstance, bool) { + if o == nil || IsNil(o.TaskInstances) { return nil, false } - return o.TotalEntries, true + return o.TaskInstances, true } -// HasTotalEntries returns a boolean if a field has been set. -func (o *TaskInstanceCollection) HasTotalEntries() bool { - if o != nil && o.TotalEntries != nil { +// HasTaskInstances returns a boolean if a field has been set. +func (o *TaskInstanceCollection) HasTaskInstances() bool { + if o != nil && !IsNil(o.TaskInstances) { return true } return false } -// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. -func (o *TaskInstanceCollection) SetTotalEntries(v int32) { - o.TotalEntries = &v +// SetTaskInstances gets a reference to the given []TaskInstance and assigns it to the TaskInstances field. +func (o *TaskInstanceCollection) SetTaskInstances(v []TaskInstance) { + o.TaskInstances = v } func (o TaskInstanceCollection) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.TaskInstances != nil { - toSerialize["task_instances"] = o.TaskInstances + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.TotalEntries != nil { + return json.Marshal(toSerialize) +} + +func (o TaskInstanceCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalEntries) { toSerialize["total_entries"] = o.TotalEntries } - return json.Marshal(toSerialize) + if !IsNil(o.TaskInstances) { + toSerialize["task_instances"] = o.TaskInstances + } + return toSerialize, nil } type NullableTaskInstanceCollection struct { diff --git a/airflow/model_task_instance_dependency_collection.go b/airflow/model_task_instance_dependency_collection.go new file mode 100644 index 0000000..c09ba00 --- /dev/null +++ b/airflow/model_task_instance_dependency_collection.go @@ -0,0 +1,127 @@ +/* +Airflow API (Stable) + +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. + +API version: 2.10.5 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package airflow + +import ( + "encoding/json" +) + +// checks if the TaskInstanceDependencyCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TaskInstanceDependencyCollection{} + +// TaskInstanceDependencyCollection struct for TaskInstanceDependencyCollection +type TaskInstanceDependencyCollection struct { + Dependencies []TaskFailedDependency `json:"dependencies,omitempty"` +} + +// NewTaskInstanceDependencyCollection instantiates a new TaskInstanceDependencyCollection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTaskInstanceDependencyCollection() *TaskInstanceDependencyCollection { + this := TaskInstanceDependencyCollection{} + return &this +} + +// NewTaskInstanceDependencyCollectionWithDefaults instantiates a new TaskInstanceDependencyCollection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTaskInstanceDependencyCollectionWithDefaults() *TaskInstanceDependencyCollection { + this := TaskInstanceDependencyCollection{} + return &this +} + +// GetDependencies returns the Dependencies field value if set, zero value otherwise. +func (o *TaskInstanceDependencyCollection) GetDependencies() []TaskFailedDependency { + if o == nil || IsNil(o.Dependencies) { + var ret []TaskFailedDependency + return ret + } + return o.Dependencies +} + +// GetDependenciesOk returns a tuple with the Dependencies field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskInstanceDependencyCollection) GetDependenciesOk() ([]TaskFailedDependency, bool) { + if o == nil || IsNil(o.Dependencies) { + return nil, false + } + return o.Dependencies, true +} + +// HasDependencies returns a boolean if a field has been set. +func (o *TaskInstanceDependencyCollection) HasDependencies() bool { + if o != nil && !IsNil(o.Dependencies) { + return true + } + + return false +} + +// SetDependencies gets a reference to the given []TaskFailedDependency and assigns it to the Dependencies field. +func (o *TaskInstanceDependencyCollection) SetDependencies(v []TaskFailedDependency) { + o.Dependencies = v +} + +func (o TaskInstanceDependencyCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TaskInstanceDependencyCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Dependencies) { + toSerialize["dependencies"] = o.Dependencies + } + return toSerialize, nil +} + +type NullableTaskInstanceDependencyCollection struct { + value *TaskInstanceDependencyCollection + isSet bool +} + +func (v NullableTaskInstanceDependencyCollection) Get() *TaskInstanceDependencyCollection { + return v.value +} + +func (v *NullableTaskInstanceDependencyCollection) Set(val *TaskInstanceDependencyCollection) { + v.value = val + v.isSet = true +} + +func (v NullableTaskInstanceDependencyCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableTaskInstanceDependencyCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTaskInstanceDependencyCollection(val *TaskInstanceDependencyCollection) *NullableTaskInstanceDependencyCollection { + return &NullableTaskInstanceDependencyCollection{value: val, isSet: true} +} + +func (v NullableTaskInstanceDependencyCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTaskInstanceDependencyCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/model_task_instance_history.go b/airflow/model_task_instance_history.go new file mode 100644 index 0000000..9334049 --- /dev/null +++ b/airflow/model_task_instance_history.go @@ -0,0 +1,988 @@ +/* +Airflow API (Stable) + +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. + +API version: 2.10.5 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package airflow + +import ( + "encoding/json" +) + +// checks if the TaskInstanceHistory type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TaskInstanceHistory{} + +// TaskInstanceHistory struct for TaskInstanceHistory +type TaskInstanceHistory struct { + DagId *string `json:"dag_id,omitempty"` + // The DagRun ID for this task instance *New in version 2.3.0* + DagRunId *string `json:"dag_run_id,omitempty"` + Duration NullableFloat32 `json:"duration,omitempty"` + EndDate NullableString `json:"end_date,omitempty"` + // Executor the task is configured to run on or None (which indicates the default executor) *New in version 2.10.0* + Executor NullableString `json:"executor,omitempty"` + ExecutorConfig *string `json:"executor_config,omitempty"` + Hostname *string `json:"hostname,omitempty"` + MapIndex *int32 `json:"map_index,omitempty"` + MaxTries *int32 `json:"max_tries,omitempty"` + // *Changed in version 2.1.1*: Field becomes nullable. + Operator NullableString `json:"operator,omitempty"` + Pid NullableInt32 `json:"pid,omitempty"` + Pool *string `json:"pool,omitempty"` + PoolSlots *int32 `json:"pool_slots,omitempty"` + PriorityWeight NullableInt32 `json:"priority_weight,omitempty"` + Queue NullableString `json:"queue,omitempty"` + // The datetime that the task enter the state QUEUE, also known as queue_at + QueuedWhen NullableString `json:"queued_when,omitempty"` + StartDate NullableString `json:"start_date,omitempty"` + State NullableTaskState `json:"state,omitempty"` + // Human centric display text for the task. *New in version 2.9.0* + TaskDisplayName *string `json:"task_display_name,omitempty"` + TaskId *string `json:"task_id,omitempty"` + TryNumber *int32 `json:"try_number,omitempty"` + Unixname *string `json:"unixname,omitempty"` +} + +// NewTaskInstanceHistory instantiates a new TaskInstanceHistory object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTaskInstanceHistory() *TaskInstanceHistory { + this := TaskInstanceHistory{} + return &this +} + +// NewTaskInstanceHistoryWithDefaults instantiates a new TaskInstanceHistory object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTaskInstanceHistoryWithDefaults() *TaskInstanceHistory { + this := TaskInstanceHistory{} + return &this +} + +// GetDagId returns the DagId field value if set, zero value otherwise. +func (o *TaskInstanceHistory) GetDagId() string { + if o == nil || IsNil(o.DagId) { + var ret string + return ret + } + return *o.DagId +} + +// GetDagIdOk returns a tuple with the DagId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskInstanceHistory) GetDagIdOk() (*string, bool) { + if o == nil || IsNil(o.DagId) { + return nil, false + } + return o.DagId, true +} + +// HasDagId returns a boolean if a field has been set. +func (o *TaskInstanceHistory) HasDagId() bool { + if o != nil && !IsNil(o.DagId) { + return true + } + + return false +} + +// SetDagId gets a reference to the given string and assigns it to the DagId field. +func (o *TaskInstanceHistory) SetDagId(v string) { + o.DagId = &v +} + +// GetDagRunId returns the DagRunId field value if set, zero value otherwise. +func (o *TaskInstanceHistory) GetDagRunId() string { + if o == nil || IsNil(o.DagRunId) { + var ret string + return ret + } + return *o.DagRunId +} + +// GetDagRunIdOk returns a tuple with the DagRunId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskInstanceHistory) GetDagRunIdOk() (*string, bool) { + if o == nil || IsNil(o.DagRunId) { + return nil, false + } + return o.DagRunId, true +} + +// HasDagRunId returns a boolean if a field has been set. +func (o *TaskInstanceHistory) HasDagRunId() bool { + if o != nil && !IsNil(o.DagRunId) { + return true + } + + return false +} + +// SetDagRunId gets a reference to the given string and assigns it to the DagRunId field. +func (o *TaskInstanceHistory) SetDagRunId(v string) { + o.DagRunId = &v +} + +// GetDuration returns the Duration field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskInstanceHistory) GetDuration() float32 { + if o == nil || IsNil(o.Duration.Get()) { + var ret float32 + return ret + } + return *o.Duration.Get() +} + +// GetDurationOk returns a tuple with the Duration field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskInstanceHistory) GetDurationOk() (*float32, bool) { + if o == nil { + return nil, false + } + return o.Duration.Get(), o.Duration.IsSet() +} + +// HasDuration returns a boolean if a field has been set. +func (o *TaskInstanceHistory) HasDuration() bool { + if o != nil && o.Duration.IsSet() { + return true + } + + return false +} + +// SetDuration gets a reference to the given NullableFloat32 and assigns it to the Duration field. +func (o *TaskInstanceHistory) SetDuration(v float32) { + o.Duration.Set(&v) +} +// SetDurationNil sets the value for Duration to be an explicit nil +func (o *TaskInstanceHistory) SetDurationNil() { + o.Duration.Set(nil) +} + +// UnsetDuration ensures that no value is present for Duration, not even an explicit nil +func (o *TaskInstanceHistory) UnsetDuration() { + o.Duration.Unset() +} + +// GetEndDate returns the EndDate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskInstanceHistory) GetEndDate() string { + if o == nil || IsNil(o.EndDate.Get()) { + var ret string + return ret + } + return *o.EndDate.Get() +} + +// GetEndDateOk returns a tuple with the EndDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskInstanceHistory) GetEndDateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EndDate.Get(), o.EndDate.IsSet() +} + +// HasEndDate returns a boolean if a field has been set. +func (o *TaskInstanceHistory) HasEndDate() bool { + if o != nil && o.EndDate.IsSet() { + return true + } + + return false +} + +// SetEndDate gets a reference to the given NullableString and assigns it to the EndDate field. +func (o *TaskInstanceHistory) SetEndDate(v string) { + o.EndDate.Set(&v) +} +// SetEndDateNil sets the value for EndDate to be an explicit nil +func (o *TaskInstanceHistory) SetEndDateNil() { + o.EndDate.Set(nil) +} + +// UnsetEndDate ensures that no value is present for EndDate, not even an explicit nil +func (o *TaskInstanceHistory) UnsetEndDate() { + o.EndDate.Unset() +} + +// GetExecutor returns the Executor field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskInstanceHistory) GetExecutor() string { + if o == nil || IsNil(o.Executor.Get()) { + var ret string + return ret + } + return *o.Executor.Get() +} + +// GetExecutorOk returns a tuple with the Executor field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskInstanceHistory) GetExecutorOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Executor.Get(), o.Executor.IsSet() +} + +// HasExecutor returns a boolean if a field has been set. +func (o *TaskInstanceHistory) HasExecutor() bool { + if o != nil && o.Executor.IsSet() { + return true + } + + return false +} + +// SetExecutor gets a reference to the given NullableString and assigns it to the Executor field. +func (o *TaskInstanceHistory) SetExecutor(v string) { + o.Executor.Set(&v) +} +// SetExecutorNil sets the value for Executor to be an explicit nil +func (o *TaskInstanceHistory) SetExecutorNil() { + o.Executor.Set(nil) +} + +// UnsetExecutor ensures that no value is present for Executor, not even an explicit nil +func (o *TaskInstanceHistory) UnsetExecutor() { + o.Executor.Unset() +} + +// GetExecutorConfig returns the ExecutorConfig field value if set, zero value otherwise. +func (o *TaskInstanceHistory) GetExecutorConfig() string { + if o == nil || IsNil(o.ExecutorConfig) { + var ret string + return ret + } + return *o.ExecutorConfig +} + +// GetExecutorConfigOk returns a tuple with the ExecutorConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskInstanceHistory) GetExecutorConfigOk() (*string, bool) { + if o == nil || IsNil(o.ExecutorConfig) { + return nil, false + } + return o.ExecutorConfig, true +} + +// HasExecutorConfig returns a boolean if a field has been set. +func (o *TaskInstanceHistory) HasExecutorConfig() bool { + if o != nil && !IsNil(o.ExecutorConfig) { + return true + } + + return false +} + +// SetExecutorConfig gets a reference to the given string and assigns it to the ExecutorConfig field. +func (o *TaskInstanceHistory) SetExecutorConfig(v string) { + o.ExecutorConfig = &v +} + +// GetHostname returns the Hostname field value if set, zero value otherwise. +func (o *TaskInstanceHistory) GetHostname() string { + if o == nil || IsNil(o.Hostname) { + var ret string + return ret + } + return *o.Hostname +} + +// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskInstanceHistory) GetHostnameOk() (*string, bool) { + if o == nil || IsNil(o.Hostname) { + return nil, false + } + return o.Hostname, true +} + +// HasHostname returns a boolean if a field has been set. +func (o *TaskInstanceHistory) HasHostname() bool { + if o != nil && !IsNil(o.Hostname) { + return true + } + + return false +} + +// SetHostname gets a reference to the given string and assigns it to the Hostname field. +func (o *TaskInstanceHistory) SetHostname(v string) { + o.Hostname = &v +} + +// GetMapIndex returns the MapIndex field value if set, zero value otherwise. +func (o *TaskInstanceHistory) GetMapIndex() int32 { + if o == nil || IsNil(o.MapIndex) { + var ret int32 + return ret + } + return *o.MapIndex +} + +// GetMapIndexOk returns a tuple with the MapIndex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskInstanceHistory) GetMapIndexOk() (*int32, bool) { + if o == nil || IsNil(o.MapIndex) { + return nil, false + } + return o.MapIndex, true +} + +// HasMapIndex returns a boolean if a field has been set. +func (o *TaskInstanceHistory) HasMapIndex() bool { + if o != nil && !IsNil(o.MapIndex) { + return true + } + + return false +} + +// SetMapIndex gets a reference to the given int32 and assigns it to the MapIndex field. +func (o *TaskInstanceHistory) SetMapIndex(v int32) { + o.MapIndex = &v +} + +// GetMaxTries returns the MaxTries field value if set, zero value otherwise. +func (o *TaskInstanceHistory) GetMaxTries() int32 { + if o == nil || IsNil(o.MaxTries) { + var ret int32 + return ret + } + return *o.MaxTries +} + +// GetMaxTriesOk returns a tuple with the MaxTries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskInstanceHistory) GetMaxTriesOk() (*int32, bool) { + if o == nil || IsNil(o.MaxTries) { + return nil, false + } + return o.MaxTries, true +} + +// HasMaxTries returns a boolean if a field has been set. +func (o *TaskInstanceHistory) HasMaxTries() bool { + if o != nil && !IsNil(o.MaxTries) { + return true + } + + return false +} + +// SetMaxTries gets a reference to the given int32 and assigns it to the MaxTries field. +func (o *TaskInstanceHistory) SetMaxTries(v int32) { + o.MaxTries = &v +} + +// GetOperator returns the Operator field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskInstanceHistory) GetOperator() string { + if o == nil || IsNil(o.Operator.Get()) { + var ret string + return ret + } + return *o.Operator.Get() +} + +// GetOperatorOk returns a tuple with the Operator field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskInstanceHistory) GetOperatorOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Operator.Get(), o.Operator.IsSet() +} + +// HasOperator returns a boolean if a field has been set. +func (o *TaskInstanceHistory) HasOperator() bool { + if o != nil && o.Operator.IsSet() { + return true + } + + return false +} + +// SetOperator gets a reference to the given NullableString and assigns it to the Operator field. +func (o *TaskInstanceHistory) SetOperator(v string) { + o.Operator.Set(&v) +} +// SetOperatorNil sets the value for Operator to be an explicit nil +func (o *TaskInstanceHistory) SetOperatorNil() { + o.Operator.Set(nil) +} + +// UnsetOperator ensures that no value is present for Operator, not even an explicit nil +func (o *TaskInstanceHistory) UnsetOperator() { + o.Operator.Unset() +} + +// GetPid returns the Pid field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskInstanceHistory) GetPid() int32 { + if o == nil || IsNil(o.Pid.Get()) { + var ret int32 + return ret + } + return *o.Pid.Get() +} + +// GetPidOk returns a tuple with the Pid field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskInstanceHistory) GetPidOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Pid.Get(), o.Pid.IsSet() +} + +// HasPid returns a boolean if a field has been set. +func (o *TaskInstanceHistory) HasPid() bool { + if o != nil && o.Pid.IsSet() { + return true + } + + return false +} + +// SetPid gets a reference to the given NullableInt32 and assigns it to the Pid field. +func (o *TaskInstanceHistory) SetPid(v int32) { + o.Pid.Set(&v) +} +// SetPidNil sets the value for Pid to be an explicit nil +func (o *TaskInstanceHistory) SetPidNil() { + o.Pid.Set(nil) +} + +// UnsetPid ensures that no value is present for Pid, not even an explicit nil +func (o *TaskInstanceHistory) UnsetPid() { + o.Pid.Unset() +} + +// GetPool returns the Pool field value if set, zero value otherwise. +func (o *TaskInstanceHistory) GetPool() string { + if o == nil || IsNil(o.Pool) { + var ret string + return ret + } + return *o.Pool +} + +// GetPoolOk returns a tuple with the Pool field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskInstanceHistory) GetPoolOk() (*string, bool) { + if o == nil || IsNil(o.Pool) { + return nil, false + } + return o.Pool, true +} + +// HasPool returns a boolean if a field has been set. +func (o *TaskInstanceHistory) HasPool() bool { + if o != nil && !IsNil(o.Pool) { + return true + } + + return false +} + +// SetPool gets a reference to the given string and assigns it to the Pool field. +func (o *TaskInstanceHistory) SetPool(v string) { + o.Pool = &v +} + +// GetPoolSlots returns the PoolSlots field value if set, zero value otherwise. +func (o *TaskInstanceHistory) GetPoolSlots() int32 { + if o == nil || IsNil(o.PoolSlots) { + var ret int32 + return ret + } + return *o.PoolSlots +} + +// GetPoolSlotsOk returns a tuple with the PoolSlots field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskInstanceHistory) GetPoolSlotsOk() (*int32, bool) { + if o == nil || IsNil(o.PoolSlots) { + return nil, false + } + return o.PoolSlots, true +} + +// HasPoolSlots returns a boolean if a field has been set. +func (o *TaskInstanceHistory) HasPoolSlots() bool { + if o != nil && !IsNil(o.PoolSlots) { + return true + } + + return false +} + +// SetPoolSlots gets a reference to the given int32 and assigns it to the PoolSlots field. +func (o *TaskInstanceHistory) SetPoolSlots(v int32) { + o.PoolSlots = &v +} + +// GetPriorityWeight returns the PriorityWeight field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskInstanceHistory) GetPriorityWeight() int32 { + if o == nil || IsNil(o.PriorityWeight.Get()) { + var ret int32 + return ret + } + return *o.PriorityWeight.Get() +} + +// GetPriorityWeightOk returns a tuple with the PriorityWeight field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskInstanceHistory) GetPriorityWeightOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.PriorityWeight.Get(), o.PriorityWeight.IsSet() +} + +// HasPriorityWeight returns a boolean if a field has been set. +func (o *TaskInstanceHistory) HasPriorityWeight() bool { + if o != nil && o.PriorityWeight.IsSet() { + return true + } + + return false +} + +// SetPriorityWeight gets a reference to the given NullableInt32 and assigns it to the PriorityWeight field. +func (o *TaskInstanceHistory) SetPriorityWeight(v int32) { + o.PriorityWeight.Set(&v) +} +// SetPriorityWeightNil sets the value for PriorityWeight to be an explicit nil +func (o *TaskInstanceHistory) SetPriorityWeightNil() { + o.PriorityWeight.Set(nil) +} + +// UnsetPriorityWeight ensures that no value is present for PriorityWeight, not even an explicit nil +func (o *TaskInstanceHistory) UnsetPriorityWeight() { + o.PriorityWeight.Unset() +} + +// GetQueue returns the Queue field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskInstanceHistory) GetQueue() string { + if o == nil || IsNil(o.Queue.Get()) { + var ret string + return ret + } + return *o.Queue.Get() +} + +// GetQueueOk returns a tuple with the Queue field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskInstanceHistory) GetQueueOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Queue.Get(), o.Queue.IsSet() +} + +// HasQueue returns a boolean if a field has been set. +func (o *TaskInstanceHistory) HasQueue() bool { + if o != nil && o.Queue.IsSet() { + return true + } + + return false +} + +// SetQueue gets a reference to the given NullableString and assigns it to the Queue field. +func (o *TaskInstanceHistory) SetQueue(v string) { + o.Queue.Set(&v) +} +// SetQueueNil sets the value for Queue to be an explicit nil +func (o *TaskInstanceHistory) SetQueueNil() { + o.Queue.Set(nil) +} + +// UnsetQueue ensures that no value is present for Queue, not even an explicit nil +func (o *TaskInstanceHistory) UnsetQueue() { + o.Queue.Unset() +} + +// GetQueuedWhen returns the QueuedWhen field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskInstanceHistory) GetQueuedWhen() string { + if o == nil || IsNil(o.QueuedWhen.Get()) { + var ret string + return ret + } + return *o.QueuedWhen.Get() +} + +// GetQueuedWhenOk returns a tuple with the QueuedWhen field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskInstanceHistory) GetQueuedWhenOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.QueuedWhen.Get(), o.QueuedWhen.IsSet() +} + +// HasQueuedWhen returns a boolean if a field has been set. +func (o *TaskInstanceHistory) HasQueuedWhen() bool { + if o != nil && o.QueuedWhen.IsSet() { + return true + } + + return false +} + +// SetQueuedWhen gets a reference to the given NullableString and assigns it to the QueuedWhen field. +func (o *TaskInstanceHistory) SetQueuedWhen(v string) { + o.QueuedWhen.Set(&v) +} +// SetQueuedWhenNil sets the value for QueuedWhen to be an explicit nil +func (o *TaskInstanceHistory) SetQueuedWhenNil() { + o.QueuedWhen.Set(nil) +} + +// UnsetQueuedWhen ensures that no value is present for QueuedWhen, not even an explicit nil +func (o *TaskInstanceHistory) UnsetQueuedWhen() { + o.QueuedWhen.Unset() +} + +// GetStartDate returns the StartDate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskInstanceHistory) GetStartDate() string { + if o == nil || IsNil(o.StartDate.Get()) { + var ret string + return ret + } + return *o.StartDate.Get() +} + +// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskInstanceHistory) GetStartDateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.StartDate.Get(), o.StartDate.IsSet() +} + +// HasStartDate returns a boolean if a field has been set. +func (o *TaskInstanceHistory) HasStartDate() bool { + if o != nil && o.StartDate.IsSet() { + return true + } + + return false +} + +// SetStartDate gets a reference to the given NullableString and assigns it to the StartDate field. +func (o *TaskInstanceHistory) SetStartDate(v string) { + o.StartDate.Set(&v) +} +// SetStartDateNil sets the value for StartDate to be an explicit nil +func (o *TaskInstanceHistory) SetStartDateNil() { + o.StartDate.Set(nil) +} + +// UnsetStartDate ensures that no value is present for StartDate, not even an explicit nil +func (o *TaskInstanceHistory) UnsetStartDate() { + o.StartDate.Unset() +} + +// GetState returns the State field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TaskInstanceHistory) GetState() TaskState { + if o == nil || IsNil(o.State.Get()) { + var ret TaskState + return ret + } + return *o.State.Get() +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TaskInstanceHistory) GetStateOk() (*TaskState, bool) { + if o == nil { + return nil, false + } + return o.State.Get(), o.State.IsSet() +} + +// HasState returns a boolean if a field has been set. +func (o *TaskInstanceHistory) HasState() bool { + if o != nil && o.State.IsSet() { + return true + } + + return false +} + +// SetState gets a reference to the given NullableTaskState and assigns it to the State field. +func (o *TaskInstanceHistory) SetState(v TaskState) { + o.State.Set(&v) +} +// SetStateNil sets the value for State to be an explicit nil +func (o *TaskInstanceHistory) SetStateNil() { + o.State.Set(nil) +} + +// UnsetState ensures that no value is present for State, not even an explicit nil +func (o *TaskInstanceHistory) UnsetState() { + o.State.Unset() +} + +// GetTaskDisplayName returns the TaskDisplayName field value if set, zero value otherwise. +func (o *TaskInstanceHistory) GetTaskDisplayName() string { + if o == nil || IsNil(o.TaskDisplayName) { + var ret string + return ret + } + return *o.TaskDisplayName +} + +// GetTaskDisplayNameOk returns a tuple with the TaskDisplayName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskInstanceHistory) GetTaskDisplayNameOk() (*string, bool) { + if o == nil || IsNil(o.TaskDisplayName) { + return nil, false + } + return o.TaskDisplayName, true +} + +// HasTaskDisplayName returns a boolean if a field has been set. +func (o *TaskInstanceHistory) HasTaskDisplayName() bool { + if o != nil && !IsNil(o.TaskDisplayName) { + return true + } + + return false +} + +// SetTaskDisplayName gets a reference to the given string and assigns it to the TaskDisplayName field. +func (o *TaskInstanceHistory) SetTaskDisplayName(v string) { + o.TaskDisplayName = &v +} + +// GetTaskId returns the TaskId field value if set, zero value otherwise. +func (o *TaskInstanceHistory) GetTaskId() string { + if o == nil || IsNil(o.TaskId) { + var ret string + return ret + } + return *o.TaskId +} + +// GetTaskIdOk returns a tuple with the TaskId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskInstanceHistory) GetTaskIdOk() (*string, bool) { + if o == nil || IsNil(o.TaskId) { + return nil, false + } + return o.TaskId, true +} + +// HasTaskId returns a boolean if a field has been set. +func (o *TaskInstanceHistory) HasTaskId() bool { + if o != nil && !IsNil(o.TaskId) { + return true + } + + return false +} + +// SetTaskId gets a reference to the given string and assigns it to the TaskId field. +func (o *TaskInstanceHistory) SetTaskId(v string) { + o.TaskId = &v +} + +// GetTryNumber returns the TryNumber field value if set, zero value otherwise. +func (o *TaskInstanceHistory) GetTryNumber() int32 { + if o == nil || IsNil(o.TryNumber) { + var ret int32 + return ret + } + return *o.TryNumber +} + +// GetTryNumberOk returns a tuple with the TryNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskInstanceHistory) GetTryNumberOk() (*int32, bool) { + if o == nil || IsNil(o.TryNumber) { + return nil, false + } + return o.TryNumber, true +} + +// HasTryNumber returns a boolean if a field has been set. +func (o *TaskInstanceHistory) HasTryNumber() bool { + if o != nil && !IsNil(o.TryNumber) { + return true + } + + return false +} + +// SetTryNumber gets a reference to the given int32 and assigns it to the TryNumber field. +func (o *TaskInstanceHistory) SetTryNumber(v int32) { + o.TryNumber = &v +} + +// GetUnixname returns the Unixname field value if set, zero value otherwise. +func (o *TaskInstanceHistory) GetUnixname() string { + if o == nil || IsNil(o.Unixname) { + var ret string + return ret + } + return *o.Unixname +} + +// GetUnixnameOk returns a tuple with the Unixname field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskInstanceHistory) GetUnixnameOk() (*string, bool) { + if o == nil || IsNil(o.Unixname) { + return nil, false + } + return o.Unixname, true +} + +// HasUnixname returns a boolean if a field has been set. +func (o *TaskInstanceHistory) HasUnixname() bool { + if o != nil && !IsNil(o.Unixname) { + return true + } + + return false +} + +// SetUnixname gets a reference to the given string and assigns it to the Unixname field. +func (o *TaskInstanceHistory) SetUnixname(v string) { + o.Unixname = &v +} + +func (o TaskInstanceHistory) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TaskInstanceHistory) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DagId) { + toSerialize["dag_id"] = o.DagId + } + if !IsNil(o.DagRunId) { + toSerialize["dag_run_id"] = o.DagRunId + } + if o.Duration.IsSet() { + toSerialize["duration"] = o.Duration.Get() + } + if o.EndDate.IsSet() { + toSerialize["end_date"] = o.EndDate.Get() + } + if o.Executor.IsSet() { + toSerialize["executor"] = o.Executor.Get() + } + if !IsNil(o.ExecutorConfig) { + toSerialize["executor_config"] = o.ExecutorConfig + } + if !IsNil(o.Hostname) { + toSerialize["hostname"] = o.Hostname + } + if !IsNil(o.MapIndex) { + toSerialize["map_index"] = o.MapIndex + } + if !IsNil(o.MaxTries) { + toSerialize["max_tries"] = o.MaxTries + } + if o.Operator.IsSet() { + toSerialize["operator"] = o.Operator.Get() + } + if o.Pid.IsSet() { + toSerialize["pid"] = o.Pid.Get() + } + if !IsNil(o.Pool) { + toSerialize["pool"] = o.Pool + } + if !IsNil(o.PoolSlots) { + toSerialize["pool_slots"] = o.PoolSlots + } + if o.PriorityWeight.IsSet() { + toSerialize["priority_weight"] = o.PriorityWeight.Get() + } + if o.Queue.IsSet() { + toSerialize["queue"] = o.Queue.Get() + } + if o.QueuedWhen.IsSet() { + toSerialize["queued_when"] = o.QueuedWhen.Get() + } + if o.StartDate.IsSet() { + toSerialize["start_date"] = o.StartDate.Get() + } + if o.State.IsSet() { + toSerialize["state"] = o.State.Get() + } + if !IsNil(o.TaskDisplayName) { + toSerialize["task_display_name"] = o.TaskDisplayName + } + if !IsNil(o.TaskId) { + toSerialize["task_id"] = o.TaskId + } + if !IsNil(o.TryNumber) { + toSerialize["try_number"] = o.TryNumber + } + if !IsNil(o.Unixname) { + toSerialize["unixname"] = o.Unixname + } + return toSerialize, nil +} + +type NullableTaskInstanceHistory struct { + value *TaskInstanceHistory + isSet bool +} + +func (v NullableTaskInstanceHistory) Get() *TaskInstanceHistory { + return v.value +} + +func (v *NullableTaskInstanceHistory) Set(val *TaskInstanceHistory) { + v.value = val + v.isSet = true +} + +func (v NullableTaskInstanceHistory) IsSet() bool { + return v.isSet +} + +func (v *NullableTaskInstanceHistory) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTaskInstanceHistory(val *TaskInstanceHistory) *NullableTaskInstanceHistory { + return &NullableTaskInstanceHistory{value: val, isSet: true} +} + +func (v NullableTaskInstanceHistory) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTaskInstanceHistory) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/model_task_instance_history_collection.go b/airflow/model_task_instance_history_collection.go new file mode 100644 index 0000000..78e789b --- /dev/null +++ b/airflow/model_task_instance_history_collection.go @@ -0,0 +1,164 @@ +/* +Airflow API (Stable) + +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. + +API version: 2.10.5 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package airflow + +import ( + "encoding/json" +) + +// checks if the TaskInstanceHistoryCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TaskInstanceHistoryCollection{} + +// TaskInstanceHistoryCollection Collection of task instances . *Changed in version 2.1.0*: 'total_entries' field is added. +type TaskInstanceHistoryCollection struct { + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. + TotalEntries *int32 `json:"total_entries,omitempty"` + TaskInstancesHistory []TaskInstanceHistory `json:"task_instances_history,omitempty"` +} + +// NewTaskInstanceHistoryCollection instantiates a new TaskInstanceHistoryCollection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTaskInstanceHistoryCollection() *TaskInstanceHistoryCollection { + this := TaskInstanceHistoryCollection{} + return &this +} + +// NewTaskInstanceHistoryCollectionWithDefaults instantiates a new TaskInstanceHistoryCollection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTaskInstanceHistoryCollectionWithDefaults() *TaskInstanceHistoryCollection { + this := TaskInstanceHistoryCollection{} + return &this +} + +// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. +func (o *TaskInstanceHistoryCollection) GetTotalEntries() int32 { + if o == nil || IsNil(o.TotalEntries) { + var ret int32 + return ret + } + return *o.TotalEntries +} + +// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskInstanceHistoryCollection) GetTotalEntriesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalEntries) { + return nil, false + } + return o.TotalEntries, true +} + +// HasTotalEntries returns a boolean if a field has been set. +func (o *TaskInstanceHistoryCollection) HasTotalEntries() bool { + if o != nil && !IsNil(o.TotalEntries) { + return true + } + + return false +} + +// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. +func (o *TaskInstanceHistoryCollection) SetTotalEntries(v int32) { + o.TotalEntries = &v +} + +// GetTaskInstancesHistory returns the TaskInstancesHistory field value if set, zero value otherwise. +func (o *TaskInstanceHistoryCollection) GetTaskInstancesHistory() []TaskInstanceHistory { + if o == nil || IsNil(o.TaskInstancesHistory) { + var ret []TaskInstanceHistory + return ret + } + return o.TaskInstancesHistory +} + +// GetTaskInstancesHistoryOk returns a tuple with the TaskInstancesHistory field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskInstanceHistoryCollection) GetTaskInstancesHistoryOk() ([]TaskInstanceHistory, bool) { + if o == nil || IsNil(o.TaskInstancesHistory) { + return nil, false + } + return o.TaskInstancesHistory, true +} + +// HasTaskInstancesHistory returns a boolean if a field has been set. +func (o *TaskInstanceHistoryCollection) HasTaskInstancesHistory() bool { + if o != nil && !IsNil(o.TaskInstancesHistory) { + return true + } + + return false +} + +// SetTaskInstancesHistory gets a reference to the given []TaskInstanceHistory and assigns it to the TaskInstancesHistory field. +func (o *TaskInstanceHistoryCollection) SetTaskInstancesHistory(v []TaskInstanceHistory) { + o.TaskInstancesHistory = v +} + +func (o TaskInstanceHistoryCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TaskInstanceHistoryCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalEntries) { + toSerialize["total_entries"] = o.TotalEntries + } + if !IsNil(o.TaskInstancesHistory) { + toSerialize["task_instances_history"] = o.TaskInstancesHistory + } + return toSerialize, nil +} + +type NullableTaskInstanceHistoryCollection struct { + value *TaskInstanceHistoryCollection + isSet bool +} + +func (v NullableTaskInstanceHistoryCollection) Get() *TaskInstanceHistoryCollection { + return v.value +} + +func (v *NullableTaskInstanceHistoryCollection) Set(val *TaskInstanceHistoryCollection) { + v.value = val + v.isSet = true +} + +func (v NullableTaskInstanceHistoryCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableTaskInstanceHistoryCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTaskInstanceHistoryCollection(val *TaskInstanceHistoryCollection) *NullableTaskInstanceHistoryCollection { + return &NullableTaskInstanceHistoryCollection{value: val, isSet: true} +} + +func (v NullableTaskInstanceHistoryCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTaskInstanceHistoryCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/model_task_instance_reference.go b/airflow/model_task_instance_reference.go index 025b5ef..f0b5b14 100644 --- a/airflow/model_task_instance_reference.go +++ b/airflow/model_task_instance_reference.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,15 +15,18 @@ import ( "encoding/json" ) +// checks if the TaskInstanceReference type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TaskInstanceReference{} + // TaskInstanceReference struct for TaskInstanceReference type TaskInstanceReference struct { - // The task ID. - TaskId *string `json:"task_id,omitempty"` // The DAG ID. DagId *string `json:"dag_id,omitempty"` - ExecutionDate *string `json:"execution_date,omitempty"` // The DAG run ID. DagRunId *string `json:"dag_run_id,omitempty"` + ExecutionDate *string `json:"execution_date,omitempty"` + // The task ID. + TaskId *string `json:"task_id,omitempty"` } // NewTaskInstanceReference instantiates a new TaskInstanceReference object @@ -60,73 +46,73 @@ func NewTaskInstanceReferenceWithDefaults() *TaskInstanceReference { return &this } -// GetTaskId returns the TaskId field value if set, zero value otherwise. -func (o *TaskInstanceReference) GetTaskId() string { - if o == nil || o.TaskId == nil { +// GetDagId returns the DagId field value if set, zero value otherwise. +func (o *TaskInstanceReference) GetDagId() string { + if o == nil || IsNil(o.DagId) { var ret string return ret } - return *o.TaskId + return *o.DagId } -// GetTaskIdOk returns a tuple with the TaskId field value if set, nil otherwise +// GetDagIdOk returns a tuple with the DagId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskInstanceReference) GetTaskIdOk() (*string, bool) { - if o == nil || o.TaskId == nil { +func (o *TaskInstanceReference) GetDagIdOk() (*string, bool) { + if o == nil || IsNil(o.DagId) { return nil, false } - return o.TaskId, true + return o.DagId, true } -// HasTaskId returns a boolean if a field has been set. -func (o *TaskInstanceReference) HasTaskId() bool { - if o != nil && o.TaskId != nil { +// HasDagId returns a boolean if a field has been set. +func (o *TaskInstanceReference) HasDagId() bool { + if o != nil && !IsNil(o.DagId) { return true } return false } -// SetTaskId gets a reference to the given string and assigns it to the TaskId field. -func (o *TaskInstanceReference) SetTaskId(v string) { - o.TaskId = &v +// SetDagId gets a reference to the given string and assigns it to the DagId field. +func (o *TaskInstanceReference) SetDagId(v string) { + o.DagId = &v } -// GetDagId returns the DagId field value if set, zero value otherwise. -func (o *TaskInstanceReference) GetDagId() string { - if o == nil || o.DagId == nil { +// GetDagRunId returns the DagRunId field value if set, zero value otherwise. +func (o *TaskInstanceReference) GetDagRunId() string { + if o == nil || IsNil(o.DagRunId) { var ret string return ret } - return *o.DagId + return *o.DagRunId } -// GetDagIdOk returns a tuple with the DagId field value if set, nil otherwise +// GetDagRunIdOk returns a tuple with the DagRunId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskInstanceReference) GetDagIdOk() (*string, bool) { - if o == nil || o.DagId == nil { +func (o *TaskInstanceReference) GetDagRunIdOk() (*string, bool) { + if o == nil || IsNil(o.DagRunId) { return nil, false } - return o.DagId, true + return o.DagRunId, true } -// HasDagId returns a boolean if a field has been set. -func (o *TaskInstanceReference) HasDagId() bool { - if o != nil && o.DagId != nil { +// HasDagRunId returns a boolean if a field has been set. +func (o *TaskInstanceReference) HasDagRunId() bool { + if o != nil && !IsNil(o.DagRunId) { return true } return false } -// SetDagId gets a reference to the given string and assigns it to the DagId field. -func (o *TaskInstanceReference) SetDagId(v string) { - o.DagId = &v +// SetDagRunId gets a reference to the given string and assigns it to the DagRunId field. +func (o *TaskInstanceReference) SetDagRunId(v string) { + o.DagRunId = &v } // GetExecutionDate returns the ExecutionDate field value if set, zero value otherwise. func (o *TaskInstanceReference) GetExecutionDate() string { - if o == nil || o.ExecutionDate == nil { + if o == nil || IsNil(o.ExecutionDate) { var ret string return ret } @@ -136,7 +122,7 @@ func (o *TaskInstanceReference) GetExecutionDate() string { // GetExecutionDateOk returns a tuple with the ExecutionDate field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TaskInstanceReference) GetExecutionDateOk() (*string, bool) { - if o == nil || o.ExecutionDate == nil { + if o == nil || IsNil(o.ExecutionDate) { return nil, false } return o.ExecutionDate, true @@ -144,7 +130,7 @@ func (o *TaskInstanceReference) GetExecutionDateOk() (*string, bool) { // HasExecutionDate returns a boolean if a field has been set. func (o *TaskInstanceReference) HasExecutionDate() bool { - if o != nil && o.ExecutionDate != nil { + if o != nil && !IsNil(o.ExecutionDate) { return true } @@ -156,53 +142,61 @@ func (o *TaskInstanceReference) SetExecutionDate(v string) { o.ExecutionDate = &v } -// GetDagRunId returns the DagRunId field value if set, zero value otherwise. -func (o *TaskInstanceReference) GetDagRunId() string { - if o == nil || o.DagRunId == nil { +// GetTaskId returns the TaskId field value if set, zero value otherwise. +func (o *TaskInstanceReference) GetTaskId() string { + if o == nil || IsNil(o.TaskId) { var ret string return ret } - return *o.DagRunId + return *o.TaskId } -// GetDagRunIdOk returns a tuple with the DagRunId field value if set, nil otherwise +// GetTaskIdOk returns a tuple with the TaskId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskInstanceReference) GetDagRunIdOk() (*string, bool) { - if o == nil || o.DagRunId == nil { +func (o *TaskInstanceReference) GetTaskIdOk() (*string, bool) { + if o == nil || IsNil(o.TaskId) { return nil, false } - return o.DagRunId, true + return o.TaskId, true } -// HasDagRunId returns a boolean if a field has been set. -func (o *TaskInstanceReference) HasDagRunId() bool { - if o != nil && o.DagRunId != nil { +// HasTaskId returns a boolean if a field has been set. +func (o *TaskInstanceReference) HasTaskId() bool { + if o != nil && !IsNil(o.TaskId) { return true } return false } -// SetDagRunId gets a reference to the given string and assigns it to the DagRunId field. -func (o *TaskInstanceReference) SetDagRunId(v string) { - o.DagRunId = &v +// SetTaskId gets a reference to the given string and assigns it to the TaskId field. +func (o *TaskInstanceReference) SetTaskId(v string) { + o.TaskId = &v } func (o TaskInstanceReference) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.TaskId != nil { - toSerialize["task_id"] = o.TaskId + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.DagId != nil { + return json.Marshal(toSerialize) +} + +func (o TaskInstanceReference) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DagId) { toSerialize["dag_id"] = o.DagId } - if o.ExecutionDate != nil { + if !IsNil(o.DagRunId) { + toSerialize["dag_run_id"] = o.DagRunId + } + if !IsNil(o.ExecutionDate) { toSerialize["execution_date"] = o.ExecutionDate } - if o.DagRunId != nil { - toSerialize["dag_run_id"] = o.DagRunId + if !IsNil(o.TaskId) { + toSerialize["task_id"] = o.TaskId } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableTaskInstanceReference struct { diff --git a/airflow/model_task_instance_reference_collection.go b/airflow/model_task_instance_reference_collection.go index 4f06a2d..dfba837 100644 --- a/airflow/model_task_instance_reference_collection.go +++ b/airflow/model_task_instance_reference_collection.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,9 +15,12 @@ import ( "encoding/json" ) +// checks if the TaskInstanceReferenceCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TaskInstanceReferenceCollection{} + // TaskInstanceReferenceCollection struct for TaskInstanceReferenceCollection type TaskInstanceReferenceCollection struct { - TaskInstances *[]TaskInstanceReference `json:"task_instances,omitempty"` + TaskInstances []TaskInstanceReference `json:"task_instances,omitempty"` } // NewTaskInstanceReferenceCollection instantiates a new TaskInstanceReferenceCollection object @@ -56,17 +42,17 @@ func NewTaskInstanceReferenceCollectionWithDefaults() *TaskInstanceReferenceColl // GetTaskInstances returns the TaskInstances field value if set, zero value otherwise. func (o *TaskInstanceReferenceCollection) GetTaskInstances() []TaskInstanceReference { - if o == nil || o.TaskInstances == nil { + if o == nil || IsNil(o.TaskInstances) { var ret []TaskInstanceReference return ret } - return *o.TaskInstances + return o.TaskInstances } // GetTaskInstancesOk returns a tuple with the TaskInstances field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *TaskInstanceReferenceCollection) GetTaskInstancesOk() (*[]TaskInstanceReference, bool) { - if o == nil || o.TaskInstances == nil { +func (o *TaskInstanceReferenceCollection) GetTaskInstancesOk() ([]TaskInstanceReference, bool) { + if o == nil || IsNil(o.TaskInstances) { return nil, false } return o.TaskInstances, true @@ -74,7 +60,7 @@ func (o *TaskInstanceReferenceCollection) GetTaskInstancesOk() (*[]TaskInstanceR // HasTaskInstances returns a boolean if a field has been set. func (o *TaskInstanceReferenceCollection) HasTaskInstances() bool { - if o != nil && o.TaskInstances != nil { + if o != nil && !IsNil(o.TaskInstances) { return true } @@ -83,15 +69,23 @@ func (o *TaskInstanceReferenceCollection) HasTaskInstances() bool { // SetTaskInstances gets a reference to the given []TaskInstanceReference and assigns it to the TaskInstances field. func (o *TaskInstanceReferenceCollection) SetTaskInstances(v []TaskInstanceReference) { - o.TaskInstances = &v + o.TaskInstances = v } func (o TaskInstanceReferenceCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TaskInstanceReferenceCollection) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.TaskInstances != nil { + if !IsNil(o.TaskInstances) { toSerialize["task_instances"] = o.TaskInstances } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableTaskInstanceReferenceCollection struct { diff --git a/airflow/model_task_outlet_dataset_reference.go b/airflow/model_task_outlet_dataset_reference.go index 1df492d..4472bc7 100644 --- a/airflow/model_task_outlet_dataset_reference.go +++ b/airflow/model_task_outlet_dataset_reference.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,14 +15,17 @@ import ( "encoding/json" ) +// checks if the TaskOutletDatasetReference type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TaskOutletDatasetReference{} + // TaskOutletDatasetReference A datasets reference to an upstream task. *New in version 2.4.0* type TaskOutletDatasetReference struct { + // The dataset creation time + CreatedAt *string `json:"created_at,omitempty"` // The DAG ID that updates the dataset. DagId NullableString `json:"dag_id,omitempty"` // The task ID that updates the dataset. TaskId NullableString `json:"task_id,omitempty"` - // The dataset creation time - CreatedAt *string `json:"created_at,omitempty"` // The dataset update time UpdatedAt *string `json:"updated_at,omitempty"` } @@ -61,9 +47,41 @@ func NewTaskOutletDatasetReferenceWithDefaults() *TaskOutletDatasetReference { return &this } +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *TaskOutletDatasetReference) GetCreatedAt() string { + if o == nil || IsNil(o.CreatedAt) { + var ret string + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TaskOutletDatasetReference) GetCreatedAtOk() (*string, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *TaskOutletDatasetReference) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field. +func (o *TaskOutletDatasetReference) SetCreatedAt(v string) { + o.CreatedAt = &v +} + // GetDagId returns the DagId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TaskOutletDatasetReference) GetDagId() string { - if o == nil || o.DagId.Get() == nil { + if o == nil || IsNil(o.DagId.Get()) { var ret string return ret } @@ -74,7 +92,7 @@ func (o *TaskOutletDatasetReference) GetDagId() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *TaskOutletDatasetReference) GetDagIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.DagId.Get(), o.DagId.IsSet() @@ -105,7 +123,7 @@ func (o *TaskOutletDatasetReference) UnsetDagId() { // GetTaskId returns the TaskId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *TaskOutletDatasetReference) GetTaskId() string { - if o == nil || o.TaskId.Get() == nil { + if o == nil || IsNil(o.TaskId.Get()) { var ret string return ret } @@ -116,7 +134,7 @@ func (o *TaskOutletDatasetReference) GetTaskId() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *TaskOutletDatasetReference) GetTaskIdOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.TaskId.Get(), o.TaskId.IsSet() @@ -145,41 +163,9 @@ func (o *TaskOutletDatasetReference) UnsetTaskId() { o.TaskId.Unset() } -// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. -func (o *TaskOutletDatasetReference) GetCreatedAt() string { - if o == nil || o.CreatedAt == nil { - var ret string - return ret - } - return *o.CreatedAt -} - -// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *TaskOutletDatasetReference) GetCreatedAtOk() (*string, bool) { - if o == nil || o.CreatedAt == nil { - return nil, false - } - return o.CreatedAt, true -} - -// HasCreatedAt returns a boolean if a field has been set. -func (o *TaskOutletDatasetReference) HasCreatedAt() bool { - if o != nil && o.CreatedAt != nil { - return true - } - - return false -} - -// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field. -func (o *TaskOutletDatasetReference) SetCreatedAt(v string) { - o.CreatedAt = &v -} - // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. func (o *TaskOutletDatasetReference) GetUpdatedAt() string { - if o == nil || o.UpdatedAt == nil { + if o == nil || IsNil(o.UpdatedAt) { var ret string return ret } @@ -189,7 +175,7 @@ func (o *TaskOutletDatasetReference) GetUpdatedAt() string { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *TaskOutletDatasetReference) GetUpdatedAtOk() (*string, bool) { - if o == nil || o.UpdatedAt == nil { + if o == nil || IsNil(o.UpdatedAt) { return nil, false } return o.UpdatedAt, true @@ -197,7 +183,7 @@ func (o *TaskOutletDatasetReference) GetUpdatedAtOk() (*string, bool) { // HasUpdatedAt returns a boolean if a field has been set. func (o *TaskOutletDatasetReference) HasUpdatedAt() bool { - if o != nil && o.UpdatedAt != nil { + if o != nil && !IsNil(o.UpdatedAt) { return true } @@ -210,20 +196,28 @@ func (o *TaskOutletDatasetReference) SetUpdatedAt(v string) { } func (o TaskOutletDatasetReference) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TaskOutletDatasetReference) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } if o.DagId.IsSet() { toSerialize["dag_id"] = o.DagId.Get() } if o.TaskId.IsSet() { toSerialize["task_id"] = o.TaskId.Get() } - if o.CreatedAt != nil { - toSerialize["created_at"] = o.CreatedAt - } - if o.UpdatedAt != nil { + if !IsNil(o.UpdatedAt) { toSerialize["updated_at"] = o.UpdatedAt } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableTaskOutletDatasetReference struct { diff --git a/airflow/model_task_state.go b/airflow/model_task_state.go index 7b59313..255b158 100644 --- a/airflow/model_task_state.go +++ b/airflow/model_task_state.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -33,24 +16,24 @@ import ( "fmt" ) -// TaskState Task state. *Changed in version 2.0.2*: 'removed' is added as a possible value. *Changed in version 2.2.0*: 'deferred' is added as a possible value. *Changed in version 2.4.0*: 'sensing' state has been removed. *Changed in version 2.4.2*: 'restarting' is added as a possible value +// TaskState Task state. *Changed in version 2.0.2*: 'removed' is added as a possible value. *Changed in version 2.2.0*: 'deferred' is added as a possible value. *Changed in version 2.4.0*: 'sensing' state has been removed. *Changed in version 2.4.2*: 'restarting' is added as a possible value *Changed in version 2.7.0*: Field becomes nullable and null primitive is added as a possible value. *Changed in version 2.7.0*: 'none' state is deprecated in favor of null. type TaskState string // List of TaskState const ( - TASKSTATE_SUCCESS TaskState = "success" - TASKSTATE_RUNNING TaskState = "running" - TASKSTATE_FAILED TaskState = "failed" - TASKSTATE_UPSTREAM_FAILED TaskState = "upstream_failed" - TASKSTATE_SKIPPED TaskState = "skipped" - TASKSTATE_UP_FOR_RETRY TaskState = "up_for_retry" - TASKSTATE_UP_FOR_RESCHEDULE TaskState = "up_for_reschedule" - TASKSTATE_QUEUED TaskState = "queued" - TASKSTATE_NONE TaskState = "none" - TASKSTATE_SCHEDULED TaskState = "scheduled" - TASKSTATE_DEFERRED TaskState = "deferred" - TASKSTATE_REMOVED TaskState = "removed" - TASKSTATE_RESTARTING TaskState = "restarting" + SUCCESS TaskState = "success" + RUNNING TaskState = "running" + FAILED TaskState = "failed" + UPSTREAM_FAILED TaskState = "upstream_failed" + SKIPPED TaskState = "skipped" + UP_FOR_RETRY TaskState = "up_for_retry" + UP_FOR_RESCHEDULE TaskState = "up_for_reschedule" + QUEUED TaskState = "queued" + NONE TaskState = "none" + SCHEDULED TaskState = "scheduled" + DEFERRED TaskState = "deferred" + REMOVED TaskState = "removed" + RESTARTING TaskState = "restarting" ) // All allowed values of TaskState enum diff --git a/airflow/model_time_delta.go b/airflow/model_time_delta.go index 08fb260..4bbe5af 100644 --- a/airflow/model_time_delta.go +++ b/airflow/model_time_delta.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -30,26 +13,33 @@ package airflow import ( "encoding/json" + "bytes" + "fmt" ) +// checks if the TimeDelta type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TimeDelta{} + // TimeDelta Time delta type TimeDelta struct { Type string `json:"__type"` Days int32 `json:"days"` - Seconds int32 `json:"seconds"` Microseconds int32 `json:"microseconds"` + Seconds int32 `json:"seconds"` } +type _TimeDelta TimeDelta + // NewTimeDelta instantiates a new TimeDelta object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewTimeDelta(type_ string, days int32, seconds int32, microseconds int32) *TimeDelta { +func NewTimeDelta(type_ string, days int32, microseconds int32, seconds int32) *TimeDelta { this := TimeDelta{} this.Type = type_ this.Days = days - this.Seconds = seconds this.Microseconds = microseconds + this.Seconds = seconds return &this } @@ -74,7 +64,7 @@ func (o *TimeDelta) GetType() string { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *TimeDelta) GetTypeOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Type, true @@ -98,7 +88,7 @@ func (o *TimeDelta) GetDays() int32 { // GetDaysOk returns a tuple with the Days field value // and a boolean to check if the value has been set. func (o *TimeDelta) GetDaysOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return &o.Days, true @@ -109,69 +99,109 @@ func (o *TimeDelta) SetDays(v int32) { o.Days = v } -// GetSeconds returns the Seconds field value -func (o *TimeDelta) GetSeconds() int32 { +// GetMicroseconds returns the Microseconds field value +func (o *TimeDelta) GetMicroseconds() int32 { if o == nil { var ret int32 return ret } - return o.Seconds + return o.Microseconds } -// GetSecondsOk returns a tuple with the Seconds field value +// GetMicrosecondsOk returns a tuple with the Microseconds field value // and a boolean to check if the value has been set. -func (o *TimeDelta) GetSecondsOk() (*int32, bool) { - if o == nil { +func (o *TimeDelta) GetMicrosecondsOk() (*int32, bool) { + if o == nil { return nil, false } - return &o.Seconds, true + return &o.Microseconds, true } -// SetSeconds sets field value -func (o *TimeDelta) SetSeconds(v int32) { - o.Seconds = v +// SetMicroseconds sets field value +func (o *TimeDelta) SetMicroseconds(v int32) { + o.Microseconds = v } -// GetMicroseconds returns the Microseconds field value -func (o *TimeDelta) GetMicroseconds() int32 { +// GetSeconds returns the Seconds field value +func (o *TimeDelta) GetSeconds() int32 { if o == nil { var ret int32 return ret } - return o.Microseconds + return o.Seconds } -// GetMicrosecondsOk returns a tuple with the Microseconds field value +// GetSecondsOk returns a tuple with the Seconds field value // and a boolean to check if the value has been set. -func (o *TimeDelta) GetMicrosecondsOk() (*int32, bool) { - if o == nil { +func (o *TimeDelta) GetSecondsOk() (*int32, bool) { + if o == nil { return nil, false } - return &o.Microseconds, true + return &o.Seconds, true } -// SetMicroseconds sets field value -func (o *TimeDelta) SetMicroseconds(v int32) { - o.Microseconds = v +// SetSeconds sets field value +func (o *TimeDelta) SetSeconds(v int32) { + o.Seconds = v } func (o TimeDelta) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TimeDelta) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if true { - toSerialize["__type"] = o.Type + toSerialize["__type"] = o.Type + toSerialize["days"] = o.Days + toSerialize["microseconds"] = o.Microseconds + toSerialize["seconds"] = o.Seconds + return toSerialize, nil +} + +func (o *TimeDelta) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "__type", + "days", + "microseconds", + "seconds", } - if true { - toSerialize["days"] = o.Days + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; } - if true { - toSerialize["seconds"] = o.Seconds + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } } - if true { - toSerialize["microseconds"] = o.Microseconds + + varTimeDelta := _TimeDelta{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varTimeDelta) + + if err != nil { + return err } - return json.Marshal(toSerialize) + + *o = TimeDelta(varTimeDelta) + + return err } type NullableTimeDelta struct { diff --git a/airflow/model_trigger.go b/airflow/model_trigger.go index f3d21a3..56935e9 100644 --- a/airflow/model_trigger.go +++ b/airflow/model_trigger.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,12 +15,15 @@ import ( "encoding/json" ) +// checks if the Trigger type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Trigger{} + // Trigger struct for Trigger type Trigger struct { - Id *int32 `json:"id,omitempty"` Classpath *string `json:"classpath,omitempty"` - Kwargs *string `json:"kwargs,omitempty"` CreatedDate *string `json:"created_date,omitempty"` + Id *int32 `json:"id,omitempty"` + Kwargs *string `json:"kwargs,omitempty"` TriggererId NullableInt32 `json:"triggerer_id,omitempty"` } @@ -58,137 +44,137 @@ func NewTriggerWithDefaults() *Trigger { return &this } -// GetId returns the Id field value if set, zero value otherwise. -func (o *Trigger) GetId() int32 { - if o == nil || o.Id == nil { - var ret int32 +// GetClasspath returns the Classpath field value if set, zero value otherwise. +func (o *Trigger) GetClasspath() string { + if o == nil || IsNil(o.Classpath) { + var ret string return ret } - return *o.Id + return *o.Classpath } -// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// GetClasspathOk returns a tuple with the Classpath field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Trigger) GetIdOk() (*int32, bool) { - if o == nil || o.Id == nil { +func (o *Trigger) GetClasspathOk() (*string, bool) { + if o == nil || IsNil(o.Classpath) { return nil, false } - return o.Id, true + return o.Classpath, true } -// HasId returns a boolean if a field has been set. -func (o *Trigger) HasId() bool { - if o != nil && o.Id != nil { +// HasClasspath returns a boolean if a field has been set. +func (o *Trigger) HasClasspath() bool { + if o != nil && !IsNil(o.Classpath) { return true } return false } -// SetId gets a reference to the given int32 and assigns it to the Id field. -func (o *Trigger) SetId(v int32) { - o.Id = &v +// SetClasspath gets a reference to the given string and assigns it to the Classpath field. +func (o *Trigger) SetClasspath(v string) { + o.Classpath = &v } -// GetClasspath returns the Classpath field value if set, zero value otherwise. -func (o *Trigger) GetClasspath() string { - if o == nil || o.Classpath == nil { +// GetCreatedDate returns the CreatedDate field value if set, zero value otherwise. +func (o *Trigger) GetCreatedDate() string { + if o == nil || IsNil(o.CreatedDate) { var ret string return ret } - return *o.Classpath + return *o.CreatedDate } -// GetClasspathOk returns a tuple with the Classpath field value if set, nil otherwise +// GetCreatedDateOk returns a tuple with the CreatedDate field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Trigger) GetClasspathOk() (*string, bool) { - if o == nil || o.Classpath == nil { +func (o *Trigger) GetCreatedDateOk() (*string, bool) { + if o == nil || IsNil(o.CreatedDate) { return nil, false } - return o.Classpath, true + return o.CreatedDate, true } -// HasClasspath returns a boolean if a field has been set. -func (o *Trigger) HasClasspath() bool { - if o != nil && o.Classpath != nil { +// HasCreatedDate returns a boolean if a field has been set. +func (o *Trigger) HasCreatedDate() bool { + if o != nil && !IsNil(o.CreatedDate) { return true } return false } -// SetClasspath gets a reference to the given string and assigns it to the Classpath field. -func (o *Trigger) SetClasspath(v string) { - o.Classpath = &v +// SetCreatedDate gets a reference to the given string and assigns it to the CreatedDate field. +func (o *Trigger) SetCreatedDate(v string) { + o.CreatedDate = &v } -// GetKwargs returns the Kwargs field value if set, zero value otherwise. -func (o *Trigger) GetKwargs() string { - if o == nil || o.Kwargs == nil { - var ret string +// GetId returns the Id field value if set, zero value otherwise. +func (o *Trigger) GetId() int32 { + if o == nil || IsNil(o.Id) { + var ret int32 return ret } - return *o.Kwargs + return *o.Id } -// GetKwargsOk returns a tuple with the Kwargs field value if set, nil otherwise +// GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Trigger) GetKwargsOk() (*string, bool) { - if o == nil || o.Kwargs == nil { +func (o *Trigger) GetIdOk() (*int32, bool) { + if o == nil || IsNil(o.Id) { return nil, false } - return o.Kwargs, true + return o.Id, true } -// HasKwargs returns a boolean if a field has been set. -func (o *Trigger) HasKwargs() bool { - if o != nil && o.Kwargs != nil { +// HasId returns a boolean if a field has been set. +func (o *Trigger) HasId() bool { + if o != nil && !IsNil(o.Id) { return true } return false } -// SetKwargs gets a reference to the given string and assigns it to the Kwargs field. -func (o *Trigger) SetKwargs(v string) { - o.Kwargs = &v +// SetId gets a reference to the given int32 and assigns it to the Id field. +func (o *Trigger) SetId(v int32) { + o.Id = &v } -// GetCreatedDate returns the CreatedDate field value if set, zero value otherwise. -func (o *Trigger) GetCreatedDate() string { - if o == nil || o.CreatedDate == nil { +// GetKwargs returns the Kwargs field value if set, zero value otherwise. +func (o *Trigger) GetKwargs() string { + if o == nil || IsNil(o.Kwargs) { var ret string return ret } - return *o.CreatedDate + return *o.Kwargs } -// GetCreatedDateOk returns a tuple with the CreatedDate field value if set, nil otherwise +// GetKwargsOk returns a tuple with the Kwargs field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *Trigger) GetCreatedDateOk() (*string, bool) { - if o == nil || o.CreatedDate == nil { +func (o *Trigger) GetKwargsOk() (*string, bool) { + if o == nil || IsNil(o.Kwargs) { return nil, false } - return o.CreatedDate, true + return o.Kwargs, true } -// HasCreatedDate returns a boolean if a field has been set. -func (o *Trigger) HasCreatedDate() bool { - if o != nil && o.CreatedDate != nil { +// HasKwargs returns a boolean if a field has been set. +func (o *Trigger) HasKwargs() bool { + if o != nil && !IsNil(o.Kwargs) { return true } return false } -// SetCreatedDate gets a reference to the given string and assigns it to the CreatedDate field. -func (o *Trigger) SetCreatedDate(v string) { - o.CreatedDate = &v +// SetKwargs gets a reference to the given string and assigns it to the Kwargs field. +func (o *Trigger) SetKwargs(v string) { + o.Kwargs = &v } // GetTriggererId returns the TriggererId field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Trigger) GetTriggererId() int32 { - if o == nil || o.TriggererId.Get() == nil { + if o == nil || IsNil(o.TriggererId.Get()) { var ret int32 return ret } @@ -199,7 +185,7 @@ func (o *Trigger) GetTriggererId() int32 { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Trigger) GetTriggererIdOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return o.TriggererId.Get(), o.TriggererId.IsSet() @@ -229,23 +215,31 @@ func (o *Trigger) UnsetTriggererId() { } func (o Trigger) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Id != nil { - toSerialize["id"] = o.Id + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.Classpath != nil { + return json.Marshal(toSerialize) +} + +func (o Trigger) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Classpath) { toSerialize["classpath"] = o.Classpath } - if o.Kwargs != nil { - toSerialize["kwargs"] = o.Kwargs - } - if o.CreatedDate != nil { + if !IsNil(o.CreatedDate) { toSerialize["created_date"] = o.CreatedDate } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Kwargs) { + toSerialize["kwargs"] = o.Kwargs + } if o.TriggererId.IsSet() { toSerialize["triggerer_id"] = o.TriggererId.Get() } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableTrigger struct { diff --git a/airflow/model_trigger_rule.go b/airflow/model_trigger_rule.go index bdad206..d71fd8d 100644 --- a/airflow/model_trigger_rule.go +++ b/airflow/model_trigger_rule.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -33,21 +16,25 @@ import ( "fmt" ) -// TriggerRule Trigger rule. *Changed in version 2.2.0*: 'none_failed_min_one_success' is added as a possible value. +// TriggerRule Trigger rule. *Changed in version 2.2.0*: 'none_failed_min_one_success' is added as a possible value. Deprecated 'dummy' and 'always' is added as a possible value *Changed in version 2.3.0*: 'all_skipped' is added as a possible value. *Changed in version 2.5.0*: 'one_done' is added as a possible value. *Changed in version 2.7.0*: 'all_done_setup_success' is added as a possible value. type TriggerRule string // List of TriggerRule const ( - TRIGGERRULE_ALL_SUCCESS TriggerRule = "all_success" - TRIGGERRULE_ALL_FAILED TriggerRule = "all_failed" - TRIGGERRULE_ALL_DONE TriggerRule = "all_done" - TRIGGERRULE_ONE_SUCCESS TriggerRule = "one_success" - TRIGGERRULE_ONE_FAILED TriggerRule = "one_failed" - TRIGGERRULE_NONE_FAILED TriggerRule = "none_failed" - TRIGGERRULE_NONE_SKIPPED TriggerRule = "none_skipped" - TRIGGERRULE_NONE_FAILED_OR_SKIPPED TriggerRule = "none_failed_or_skipped" - TRIGGERRULE_NONE_FAILED_MIN_ONE_SUCCESS TriggerRule = "none_failed_min_one_success" - TRIGGERRULE_DUMMY TriggerRule = "dummy" + ALL_SUCCESS TriggerRule = "all_success" + ALL_FAILED TriggerRule = "all_failed" + ALL_DONE TriggerRule = "all_done" + ALL_DONE_SETUP_SUCCESS TriggerRule = "all_done_setup_success" + ONE_SUCCESS TriggerRule = "one_success" + ONE_FAILED TriggerRule = "one_failed" + ONE_DONE TriggerRule = "one_done" + NONE_FAILED TriggerRule = "none_failed" + NONE_SKIPPED TriggerRule = "none_skipped" + NONE_FAILED_OR_SKIPPED TriggerRule = "none_failed_or_skipped" + NONE_FAILED_MIN_ONE_SUCCESS TriggerRule = "none_failed_min_one_success" + DUMMY TriggerRule = "dummy" + ALL_SKIPPED TriggerRule = "all_skipped" + ALWAYS TriggerRule = "always" ) // All allowed values of TriggerRule enum @@ -55,13 +42,17 @@ var AllowedTriggerRuleEnumValues = []TriggerRule{ "all_success", "all_failed", "all_done", + "all_done_setup_success", "one_success", "one_failed", + "one_done", "none_failed", "none_skipped", "none_failed_or_skipped", "none_failed_min_one_success", "dummy", + "all_skipped", + "always", } func (v *TriggerRule) UnmarshalJSON(src []byte) error { diff --git a/airflow/model_triggerer_status.go b/airflow/model_triggerer_status.go new file mode 100644 index 0000000..b918332 --- /dev/null +++ b/airflow/model_triggerer_status.go @@ -0,0 +1,184 @@ +/* +Airflow API (Stable) + +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. + +API version: 2.10.5 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package airflow + +import ( + "encoding/json" +) + +// checks if the TriggererStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TriggererStatus{} + +// TriggererStatus The status and the latest triggerer heartbeat. *New in version 2.6.2* +type TriggererStatus struct { + // The time the triggerer last did a heartbeat. + LatestTriggererHeartbeat NullableString `json:"latest_triggerer_heartbeat,omitempty"` + Status NullableHealthStatus `json:"status,omitempty"` +} + +// NewTriggererStatus instantiates a new TriggererStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTriggererStatus() *TriggererStatus { + this := TriggererStatus{} + return &this +} + +// NewTriggererStatusWithDefaults instantiates a new TriggererStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTriggererStatusWithDefaults() *TriggererStatus { + this := TriggererStatus{} + return &this +} + +// GetLatestTriggererHeartbeat returns the LatestTriggererHeartbeat field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TriggererStatus) GetLatestTriggererHeartbeat() string { + if o == nil || IsNil(o.LatestTriggererHeartbeat.Get()) { + var ret string + return ret + } + return *o.LatestTriggererHeartbeat.Get() +} + +// GetLatestTriggererHeartbeatOk returns a tuple with the LatestTriggererHeartbeat field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TriggererStatus) GetLatestTriggererHeartbeatOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.LatestTriggererHeartbeat.Get(), o.LatestTriggererHeartbeat.IsSet() +} + +// HasLatestTriggererHeartbeat returns a boolean if a field has been set. +func (o *TriggererStatus) HasLatestTriggererHeartbeat() bool { + if o != nil && o.LatestTriggererHeartbeat.IsSet() { + return true + } + + return false +} + +// SetLatestTriggererHeartbeat gets a reference to the given NullableString and assigns it to the LatestTriggererHeartbeat field. +func (o *TriggererStatus) SetLatestTriggererHeartbeat(v string) { + o.LatestTriggererHeartbeat.Set(&v) +} +// SetLatestTriggererHeartbeatNil sets the value for LatestTriggererHeartbeat to be an explicit nil +func (o *TriggererStatus) SetLatestTriggererHeartbeatNil() { + o.LatestTriggererHeartbeat.Set(nil) +} + +// UnsetLatestTriggererHeartbeat ensures that no value is present for LatestTriggererHeartbeat, not even an explicit nil +func (o *TriggererStatus) UnsetLatestTriggererHeartbeat() { + o.LatestTriggererHeartbeat.Unset() +} + +// GetStatus returns the Status field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TriggererStatus) GetStatus() HealthStatus { + if o == nil || IsNil(o.Status.Get()) { + var ret HealthStatus + return ret + } + return *o.Status.Get() +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TriggererStatus) GetStatusOk() (*HealthStatus, bool) { + if o == nil { + return nil, false + } + return o.Status.Get(), o.Status.IsSet() +} + +// HasStatus returns a boolean if a field has been set. +func (o *TriggererStatus) HasStatus() bool { + if o != nil && o.Status.IsSet() { + return true + } + + return false +} + +// SetStatus gets a reference to the given NullableHealthStatus and assigns it to the Status field. +func (o *TriggererStatus) SetStatus(v HealthStatus) { + o.Status.Set(&v) +} +// SetStatusNil sets the value for Status to be an explicit nil +func (o *TriggererStatus) SetStatusNil() { + o.Status.Set(nil) +} + +// UnsetStatus ensures that no value is present for Status, not even an explicit nil +func (o *TriggererStatus) UnsetStatus() { + o.Status.Unset() +} + +func (o TriggererStatus) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TriggererStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.LatestTriggererHeartbeat.IsSet() { + toSerialize["latest_triggerer_heartbeat"] = o.LatestTriggererHeartbeat.Get() + } + if o.Status.IsSet() { + toSerialize["status"] = o.Status.Get() + } + return toSerialize, nil +} + +type NullableTriggererStatus struct { + value *TriggererStatus + isSet bool +} + +func (v NullableTriggererStatus) Get() *TriggererStatus { + return v.value +} + +func (v *NullableTriggererStatus) Set(val *TriggererStatus) { + v.value = val + v.isSet = true +} + +func (v NullableTriggererStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableTriggererStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTriggererStatus(val *TriggererStatus) *NullableTriggererStatus { + return &NullableTriggererStatus{value: val, isSet: true} +} + +func (v NullableTriggererStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTriggererStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/model_update_dag_run_state.go b/airflow/model_update_dag_run_state.go index 413c155..6ba1586 100644 --- a/airflow/model_update_dag_run_state.go +++ b/airflow/model_update_dag_run_state.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,6 +15,9 @@ import ( "encoding/json" ) +// checks if the UpdateDagRunState type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateDagRunState{} + // UpdateDagRunState Modify the state of a DAG run. *New in version 2.2.0* type UpdateDagRunState struct { // The state to set this DagRun @@ -57,7 +43,7 @@ func NewUpdateDagRunStateWithDefaults() *UpdateDagRunState { // GetState returns the State field value if set, zero value otherwise. func (o *UpdateDagRunState) GetState() string { - if o == nil || o.State == nil { + if o == nil || IsNil(o.State) { var ret string return ret } @@ -67,7 +53,7 @@ func (o *UpdateDagRunState) GetState() string { // GetStateOk returns a tuple with the State field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *UpdateDagRunState) GetStateOk() (*string, bool) { - if o == nil || o.State == nil { + if o == nil || IsNil(o.State) { return nil, false } return o.State, true @@ -75,7 +61,7 @@ func (o *UpdateDagRunState) GetStateOk() (*string, bool) { // HasState returns a boolean if a field has been set. func (o *UpdateDagRunState) HasState() bool { - if o != nil && o.State != nil { + if o != nil && !IsNil(o.State) { return true } @@ -88,11 +74,19 @@ func (o *UpdateDagRunState) SetState(v string) { } func (o UpdateDagRunState) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateDagRunState) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.State != nil { + if !IsNil(o.State) { toSerialize["state"] = o.State } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableUpdateDagRunState struct { diff --git a/airflow/model_update_task_instance.go b/airflow/model_update_task_instance.go index 7d32a31..385a4b6 100644 --- a/airflow/model_update_task_instance.go +++ b/airflow/model_update_task_instance.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,12 +15,14 @@ import ( "encoding/json" ) +// checks if the UpdateTaskInstance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateTaskInstance{} + // UpdateTaskInstance struct for UpdateTaskInstance type UpdateTaskInstance struct { // If set, don't actually run this operation. The response will contain the task instance planned to be affected, but won't be modified in any way. DryRun *bool `json:"dry_run,omitempty"` - // Expected new state. - NewState *string `json:"new_state,omitempty"` + NewState *UpdateTaskState `json:"new_state,omitempty"` } // NewUpdateTaskInstance instantiates a new UpdateTaskInstance object @@ -46,7 +31,7 @@ type UpdateTaskInstance struct { // will change when the set of required properties is changed func NewUpdateTaskInstance() *UpdateTaskInstance { this := UpdateTaskInstance{} - var dryRun bool = false + var dryRun bool = true this.DryRun = &dryRun return &this } @@ -56,14 +41,14 @@ func NewUpdateTaskInstance() *UpdateTaskInstance { // but it doesn't guarantee that properties required by API are set func NewUpdateTaskInstanceWithDefaults() *UpdateTaskInstance { this := UpdateTaskInstance{} - var dryRun bool = false + var dryRun bool = true this.DryRun = &dryRun return &this } // GetDryRun returns the DryRun field value if set, zero value otherwise. func (o *UpdateTaskInstance) GetDryRun() bool { - if o == nil || o.DryRun == nil { + if o == nil || IsNil(o.DryRun) { var ret bool return ret } @@ -73,7 +58,7 @@ func (o *UpdateTaskInstance) GetDryRun() bool { // GetDryRunOk returns a tuple with the DryRun field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *UpdateTaskInstance) GetDryRunOk() (*bool, bool) { - if o == nil || o.DryRun == nil { + if o == nil || IsNil(o.DryRun) { return nil, false } return o.DryRun, true @@ -81,7 +66,7 @@ func (o *UpdateTaskInstance) GetDryRunOk() (*bool, bool) { // HasDryRun returns a boolean if a field has been set. func (o *UpdateTaskInstance) HasDryRun() bool { - if o != nil && o.DryRun != nil { + if o != nil && !IsNil(o.DryRun) { return true } @@ -94,9 +79,9 @@ func (o *UpdateTaskInstance) SetDryRun(v bool) { } // GetNewState returns the NewState field value if set, zero value otherwise. -func (o *UpdateTaskInstance) GetNewState() string { - if o == nil || o.NewState == nil { - var ret string +func (o *UpdateTaskInstance) GetNewState() UpdateTaskState { + if o == nil || IsNil(o.NewState) { + var ret UpdateTaskState return ret } return *o.NewState @@ -104,8 +89,8 @@ func (o *UpdateTaskInstance) GetNewState() string { // GetNewStateOk returns a tuple with the NewState field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateTaskInstance) GetNewStateOk() (*string, bool) { - if o == nil || o.NewState == nil { +func (o *UpdateTaskInstance) GetNewStateOk() (*UpdateTaskState, bool) { + if o == nil || IsNil(o.NewState) { return nil, false } return o.NewState, true @@ -113,27 +98,35 @@ func (o *UpdateTaskInstance) GetNewStateOk() (*string, bool) { // HasNewState returns a boolean if a field has been set. func (o *UpdateTaskInstance) HasNewState() bool { - if o != nil && o.NewState != nil { + if o != nil && !IsNil(o.NewState) { return true } return false } -// SetNewState gets a reference to the given string and assigns it to the NewState field. -func (o *UpdateTaskInstance) SetNewState(v string) { +// SetNewState gets a reference to the given UpdateTaskState and assigns it to the NewState field. +func (o *UpdateTaskInstance) SetNewState(v UpdateTaskState) { o.NewState = &v } func (o UpdateTaskInstance) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateTaskInstance) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.DryRun != nil { + if !IsNil(o.DryRun) { toSerialize["dry_run"] = o.DryRun } - if o.NewState != nil { + if !IsNil(o.NewState) { toSerialize["new_state"] = o.NewState } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableUpdateTaskInstance struct { diff --git a/airflow/model_update_task_instances_state.go b/airflow/model_update_task_instances_state.go index 7c46a75..00e290f 100644 --- a/airflow/model_update_task_instances_state.go +++ b/airflow/model_update_task_instances_state.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,26 +15,28 @@ import ( "encoding/json" ) +// checks if the UpdateTaskInstancesState type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateTaskInstancesState{} + // UpdateTaskInstancesState struct for UpdateTaskInstancesState type UpdateTaskInstancesState struct { + // The task instance's DAG run ID. Either set this or execution_date but not both. *New in version 2.3.0* + DagRunId *string `json:"dag_run_id,omitempty"` // If set, don't actually run this operation. The response will contain a list of task instances planned to be affected, but won't be modified in any way. DryRun *bool `json:"dry_run,omitempty"` - // The task ID. - TaskId *string `json:"task_id,omitempty"` // The execution date. Either set this or dag_run_id but not both. ExecutionDate *string `json:"execution_date,omitempty"` - // The task instance's DAG run ID. Either set this or execution_date but not both. *New in version 2.3.0* - DagRunId *string `json:"dag_run_id,omitempty"` - // If set to true, upstream tasks are also affected. - IncludeUpstream *bool `json:"include_upstream,omitempty"` // If set to true, downstream tasks are also affected. IncludeDownstream *bool `json:"include_downstream,omitempty"` // If set to True, also tasks from future DAG Runs are affected. IncludeFuture *bool `json:"include_future,omitempty"` // If set to True, also tasks from past DAG Runs are affected. IncludePast *bool `json:"include_past,omitempty"` - // Expected new state. - NewState *string `json:"new_state,omitempty"` + // If set to true, upstream tasks are also affected. + IncludeUpstream *bool `json:"include_upstream,omitempty"` + NewState *UpdateTaskState `json:"new_state,omitempty"` + // The task ID. + TaskId *string `json:"task_id,omitempty"` } // NewUpdateTaskInstancesState instantiates a new UpdateTaskInstancesState object @@ -75,73 +60,73 @@ func NewUpdateTaskInstancesStateWithDefaults() *UpdateTaskInstancesState { return &this } -// GetDryRun returns the DryRun field value if set, zero value otherwise. -func (o *UpdateTaskInstancesState) GetDryRun() bool { - if o == nil || o.DryRun == nil { - var ret bool +// GetDagRunId returns the DagRunId field value if set, zero value otherwise. +func (o *UpdateTaskInstancesState) GetDagRunId() string { + if o == nil || IsNil(o.DagRunId) { + var ret string return ret } - return *o.DryRun + return *o.DagRunId } -// GetDryRunOk returns a tuple with the DryRun field value if set, nil otherwise +// GetDagRunIdOk returns a tuple with the DagRunId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateTaskInstancesState) GetDryRunOk() (*bool, bool) { - if o == nil || o.DryRun == nil { +func (o *UpdateTaskInstancesState) GetDagRunIdOk() (*string, bool) { + if o == nil || IsNil(o.DagRunId) { return nil, false } - return o.DryRun, true + return o.DagRunId, true } -// HasDryRun returns a boolean if a field has been set. -func (o *UpdateTaskInstancesState) HasDryRun() bool { - if o != nil && o.DryRun != nil { +// HasDagRunId returns a boolean if a field has been set. +func (o *UpdateTaskInstancesState) HasDagRunId() bool { + if o != nil && !IsNil(o.DagRunId) { return true } return false } -// SetDryRun gets a reference to the given bool and assigns it to the DryRun field. -func (o *UpdateTaskInstancesState) SetDryRun(v bool) { - o.DryRun = &v +// SetDagRunId gets a reference to the given string and assigns it to the DagRunId field. +func (o *UpdateTaskInstancesState) SetDagRunId(v string) { + o.DagRunId = &v } -// GetTaskId returns the TaskId field value if set, zero value otherwise. -func (o *UpdateTaskInstancesState) GetTaskId() string { - if o == nil || o.TaskId == nil { - var ret string +// GetDryRun returns the DryRun field value if set, zero value otherwise. +func (o *UpdateTaskInstancesState) GetDryRun() bool { + if o == nil || IsNil(o.DryRun) { + var ret bool return ret } - return *o.TaskId + return *o.DryRun } -// GetTaskIdOk returns a tuple with the TaskId field value if set, nil otherwise +// GetDryRunOk returns a tuple with the DryRun field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateTaskInstancesState) GetTaskIdOk() (*string, bool) { - if o == nil || o.TaskId == nil { +func (o *UpdateTaskInstancesState) GetDryRunOk() (*bool, bool) { + if o == nil || IsNil(o.DryRun) { return nil, false } - return o.TaskId, true + return o.DryRun, true } -// HasTaskId returns a boolean if a field has been set. -func (o *UpdateTaskInstancesState) HasTaskId() bool { - if o != nil && o.TaskId != nil { +// HasDryRun returns a boolean if a field has been set. +func (o *UpdateTaskInstancesState) HasDryRun() bool { + if o != nil && !IsNil(o.DryRun) { return true } return false } -// SetTaskId gets a reference to the given string and assigns it to the TaskId field. -func (o *UpdateTaskInstancesState) SetTaskId(v string) { - o.TaskId = &v +// SetDryRun gets a reference to the given bool and assigns it to the DryRun field. +func (o *UpdateTaskInstancesState) SetDryRun(v bool) { + o.DryRun = &v } // GetExecutionDate returns the ExecutionDate field value if set, zero value otherwise. func (o *UpdateTaskInstancesState) GetExecutionDate() string { - if o == nil || o.ExecutionDate == nil { + if o == nil || IsNil(o.ExecutionDate) { var ret string return ret } @@ -151,7 +136,7 @@ func (o *UpdateTaskInstancesState) GetExecutionDate() string { // GetExecutionDateOk returns a tuple with the ExecutionDate field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *UpdateTaskInstancesState) GetExecutionDateOk() (*string, bool) { - if o == nil || o.ExecutionDate == nil { + if o == nil || IsNil(o.ExecutionDate) { return nil, false } return o.ExecutionDate, true @@ -159,7 +144,7 @@ func (o *UpdateTaskInstancesState) GetExecutionDateOk() (*string, bool) { // HasExecutionDate returns a boolean if a field has been set. func (o *UpdateTaskInstancesState) HasExecutionDate() bool { - if o != nil && o.ExecutionDate != nil { + if o != nil && !IsNil(o.ExecutionDate) { return true } @@ -171,73 +156,9 @@ func (o *UpdateTaskInstancesState) SetExecutionDate(v string) { o.ExecutionDate = &v } -// GetDagRunId returns the DagRunId field value if set, zero value otherwise. -func (o *UpdateTaskInstancesState) GetDagRunId() string { - if o == nil || o.DagRunId == nil { - var ret string - return ret - } - return *o.DagRunId -} - -// GetDagRunIdOk returns a tuple with the DagRunId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateTaskInstancesState) GetDagRunIdOk() (*string, bool) { - if o == nil || o.DagRunId == nil { - return nil, false - } - return o.DagRunId, true -} - -// HasDagRunId returns a boolean if a field has been set. -func (o *UpdateTaskInstancesState) HasDagRunId() bool { - if o != nil && o.DagRunId != nil { - return true - } - - return false -} - -// SetDagRunId gets a reference to the given string and assigns it to the DagRunId field. -func (o *UpdateTaskInstancesState) SetDagRunId(v string) { - o.DagRunId = &v -} - -// GetIncludeUpstream returns the IncludeUpstream field value if set, zero value otherwise. -func (o *UpdateTaskInstancesState) GetIncludeUpstream() bool { - if o == nil || o.IncludeUpstream == nil { - var ret bool - return ret - } - return *o.IncludeUpstream -} - -// GetIncludeUpstreamOk returns a tuple with the IncludeUpstream field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UpdateTaskInstancesState) GetIncludeUpstreamOk() (*bool, bool) { - if o == nil || o.IncludeUpstream == nil { - return nil, false - } - return o.IncludeUpstream, true -} - -// HasIncludeUpstream returns a boolean if a field has been set. -func (o *UpdateTaskInstancesState) HasIncludeUpstream() bool { - if o != nil && o.IncludeUpstream != nil { - return true - } - - return false -} - -// SetIncludeUpstream gets a reference to the given bool and assigns it to the IncludeUpstream field. -func (o *UpdateTaskInstancesState) SetIncludeUpstream(v bool) { - o.IncludeUpstream = &v -} - // GetIncludeDownstream returns the IncludeDownstream field value if set, zero value otherwise. func (o *UpdateTaskInstancesState) GetIncludeDownstream() bool { - if o == nil || o.IncludeDownstream == nil { + if o == nil || IsNil(o.IncludeDownstream) { var ret bool return ret } @@ -247,7 +168,7 @@ func (o *UpdateTaskInstancesState) GetIncludeDownstream() bool { // GetIncludeDownstreamOk returns a tuple with the IncludeDownstream field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *UpdateTaskInstancesState) GetIncludeDownstreamOk() (*bool, bool) { - if o == nil || o.IncludeDownstream == nil { + if o == nil || IsNil(o.IncludeDownstream) { return nil, false } return o.IncludeDownstream, true @@ -255,7 +176,7 @@ func (o *UpdateTaskInstancesState) GetIncludeDownstreamOk() (*bool, bool) { // HasIncludeDownstream returns a boolean if a field has been set. func (o *UpdateTaskInstancesState) HasIncludeDownstream() bool { - if o != nil && o.IncludeDownstream != nil { + if o != nil && !IsNil(o.IncludeDownstream) { return true } @@ -269,7 +190,7 @@ func (o *UpdateTaskInstancesState) SetIncludeDownstream(v bool) { // GetIncludeFuture returns the IncludeFuture field value if set, zero value otherwise. func (o *UpdateTaskInstancesState) GetIncludeFuture() bool { - if o == nil || o.IncludeFuture == nil { + if o == nil || IsNil(o.IncludeFuture) { var ret bool return ret } @@ -279,7 +200,7 @@ func (o *UpdateTaskInstancesState) GetIncludeFuture() bool { // GetIncludeFutureOk returns a tuple with the IncludeFuture field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *UpdateTaskInstancesState) GetIncludeFutureOk() (*bool, bool) { - if o == nil || o.IncludeFuture == nil { + if o == nil || IsNil(o.IncludeFuture) { return nil, false } return o.IncludeFuture, true @@ -287,7 +208,7 @@ func (o *UpdateTaskInstancesState) GetIncludeFutureOk() (*bool, bool) { // HasIncludeFuture returns a boolean if a field has been set. func (o *UpdateTaskInstancesState) HasIncludeFuture() bool { - if o != nil && o.IncludeFuture != nil { + if o != nil && !IsNil(o.IncludeFuture) { return true } @@ -301,7 +222,7 @@ func (o *UpdateTaskInstancesState) SetIncludeFuture(v bool) { // GetIncludePast returns the IncludePast field value if set, zero value otherwise. func (o *UpdateTaskInstancesState) GetIncludePast() bool { - if o == nil || o.IncludePast == nil { + if o == nil || IsNil(o.IncludePast) { var ret bool return ret } @@ -311,7 +232,7 @@ func (o *UpdateTaskInstancesState) GetIncludePast() bool { // GetIncludePastOk returns a tuple with the IncludePast field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *UpdateTaskInstancesState) GetIncludePastOk() (*bool, bool) { - if o == nil || o.IncludePast == nil { + if o == nil || IsNil(o.IncludePast) { return nil, false } return o.IncludePast, true @@ -319,7 +240,7 @@ func (o *UpdateTaskInstancesState) GetIncludePastOk() (*bool, bool) { // HasIncludePast returns a boolean if a field has been set. func (o *UpdateTaskInstancesState) HasIncludePast() bool { - if o != nil && o.IncludePast != nil { + if o != nil && !IsNil(o.IncludePast) { return true } @@ -331,10 +252,42 @@ func (o *UpdateTaskInstancesState) SetIncludePast(v bool) { o.IncludePast = &v } +// GetIncludeUpstream returns the IncludeUpstream field value if set, zero value otherwise. +func (o *UpdateTaskInstancesState) GetIncludeUpstream() bool { + if o == nil || IsNil(o.IncludeUpstream) { + var ret bool + return ret + } + return *o.IncludeUpstream +} + +// GetIncludeUpstreamOk returns a tuple with the IncludeUpstream field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateTaskInstancesState) GetIncludeUpstreamOk() (*bool, bool) { + if o == nil || IsNil(o.IncludeUpstream) { + return nil, false + } + return o.IncludeUpstream, true +} + +// HasIncludeUpstream returns a boolean if a field has been set. +func (o *UpdateTaskInstancesState) HasIncludeUpstream() bool { + if o != nil && !IsNil(o.IncludeUpstream) { + return true + } + + return false +} + +// SetIncludeUpstream gets a reference to the given bool and assigns it to the IncludeUpstream field. +func (o *UpdateTaskInstancesState) SetIncludeUpstream(v bool) { + o.IncludeUpstream = &v +} + // GetNewState returns the NewState field value if set, zero value otherwise. -func (o *UpdateTaskInstancesState) GetNewState() string { - if o == nil || o.NewState == nil { - var ret string +func (o *UpdateTaskInstancesState) GetNewState() UpdateTaskState { + if o == nil || IsNil(o.NewState) { + var ret UpdateTaskState return ret } return *o.NewState @@ -342,8 +295,8 @@ func (o *UpdateTaskInstancesState) GetNewState() string { // GetNewStateOk returns a tuple with the NewState field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UpdateTaskInstancesState) GetNewStateOk() (*string, bool) { - if o == nil || o.NewState == nil { +func (o *UpdateTaskInstancesState) GetNewStateOk() (*UpdateTaskState, bool) { + if o == nil || IsNil(o.NewState) { return nil, false } return o.NewState, true @@ -351,48 +304,88 @@ func (o *UpdateTaskInstancesState) GetNewStateOk() (*string, bool) { // HasNewState returns a boolean if a field has been set. func (o *UpdateTaskInstancesState) HasNewState() bool { - if o != nil && o.NewState != nil { + if o != nil && !IsNil(o.NewState) { return true } return false } -// SetNewState gets a reference to the given string and assigns it to the NewState field. -func (o *UpdateTaskInstancesState) SetNewState(v string) { +// SetNewState gets a reference to the given UpdateTaskState and assigns it to the NewState field. +func (o *UpdateTaskInstancesState) SetNewState(v UpdateTaskState) { o.NewState = &v } -func (o UpdateTaskInstancesState) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.DryRun != nil { - toSerialize["dry_run"] = o.DryRun +// GetTaskId returns the TaskId field value if set, zero value otherwise. +func (o *UpdateTaskInstancesState) GetTaskId() string { + if o == nil || IsNil(o.TaskId) { + var ret string + return ret } - if o.TaskId != nil { - toSerialize["task_id"] = o.TaskId + return *o.TaskId +} + +// GetTaskIdOk returns a tuple with the TaskId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateTaskInstancesState) GetTaskIdOk() (*string, bool) { + if o == nil || IsNil(o.TaskId) { + return nil, false } - if o.ExecutionDate != nil { - toSerialize["execution_date"] = o.ExecutionDate + return o.TaskId, true +} + +// HasTaskId returns a boolean if a field has been set. +func (o *UpdateTaskInstancesState) HasTaskId() bool { + if o != nil && !IsNil(o.TaskId) { + return true } - if o.DagRunId != nil { + + return false +} + +// SetTaskId gets a reference to the given string and assigns it to the TaskId field. +func (o *UpdateTaskInstancesState) SetTaskId(v string) { + o.TaskId = &v +} + +func (o UpdateTaskInstancesState) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateTaskInstancesState) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DagRunId) { toSerialize["dag_run_id"] = o.DagRunId } - if o.IncludeUpstream != nil { - toSerialize["include_upstream"] = o.IncludeUpstream + if !IsNil(o.DryRun) { + toSerialize["dry_run"] = o.DryRun + } + if !IsNil(o.ExecutionDate) { + toSerialize["execution_date"] = o.ExecutionDate } - if o.IncludeDownstream != nil { + if !IsNil(o.IncludeDownstream) { toSerialize["include_downstream"] = o.IncludeDownstream } - if o.IncludeFuture != nil { + if !IsNil(o.IncludeFuture) { toSerialize["include_future"] = o.IncludeFuture } - if o.IncludePast != nil { + if !IsNil(o.IncludePast) { toSerialize["include_past"] = o.IncludePast } - if o.NewState != nil { + if !IsNil(o.IncludeUpstream) { + toSerialize["include_upstream"] = o.IncludeUpstream + } + if !IsNil(o.NewState) { toSerialize["new_state"] = o.NewState } - return json.Marshal(toSerialize) + if !IsNil(o.TaskId) { + toSerialize["task_id"] = o.TaskId + } + return toSerialize, nil } type NullableUpdateTaskInstancesState struct { diff --git a/airflow/model_update_task_state.go b/airflow/model_update_task_state.go new file mode 100644 index 0000000..a8747bb --- /dev/null +++ b/airflow/model_update_task_state.go @@ -0,0 +1,114 @@ +/* +Airflow API (Stable) + +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. + +API version: 2.10.5 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package airflow + +import ( + "encoding/json" + "fmt" +) + +// UpdateTaskState Expected new state. Only a subset of TaskState are available. Other states are managed directly by the scheduler or the workers and cannot be updated manually through the REST API. +type UpdateTaskState string + +// List of UpdateTaskState +const ( + SUCCESS UpdateTaskState = "success" + FAILED UpdateTaskState = "failed" + SKIPPED UpdateTaskState = "skipped" +) + +// All allowed values of UpdateTaskState enum +var AllowedUpdateTaskStateEnumValues = []UpdateTaskState{ + "success", + "failed", + "skipped", +} + +func (v *UpdateTaskState) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UpdateTaskState(value) + for _, existing := range AllowedUpdateTaskStateEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid UpdateTaskState", value) +} + +// NewUpdateTaskStateFromValue returns a pointer to a valid UpdateTaskState +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUpdateTaskStateFromValue(v string) (*UpdateTaskState, error) { + ev := UpdateTaskState(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UpdateTaskState: valid values are %v", v, AllowedUpdateTaskStateEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UpdateTaskState) IsValid() bool { + for _, existing := range AllowedUpdateTaskStateEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to UpdateTaskState value +func (v UpdateTaskState) Ptr() *UpdateTaskState { + return &v +} + +type NullableUpdateTaskState struct { + value *UpdateTaskState + isSet bool +} + +func (v NullableUpdateTaskState) Get() *UpdateTaskState { + return v.value +} + +func (v *NullableUpdateTaskState) Set(val *UpdateTaskState) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateTaskState) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateTaskState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateTaskState(val *UpdateTaskState) *NullableUpdateTaskState { + return &NullableUpdateTaskState{value: val, isSet: true} +} + +func (v NullableUpdateTaskState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateTaskState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/airflow/model_user.go b/airflow/model_user.go index 5980948..b7f1aa0 100644 --- a/airflow/model_user.go +++ b/airflow/model_user.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,30 +15,33 @@ import ( "encoding/json" ) +// checks if the User type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &User{} + // User A user object with sensitive data. *New in version 2.1.0* type User struct { - // The user's first name. *Changed in version 2.4.0*: The requirement for this to be non-empty was removed. - FirstName *string `json:"first_name,omitempty"` - // The user's last name. *Changed in version 2.4.0*: The requirement for this to be non-empty was removed. - LastName *string `json:"last_name,omitempty"` - // The username. *Changed in version 2.2.0*: A minimum character length requirement ('minLength') is added. - Username *string `json:"username,omitempty"` - // The user's email. *Changed in version 2.2.0*: A minimum character length requirement ('minLength') is added. - Email *string `json:"email,omitempty"` // Whether the user is active Active NullableBool `json:"active,omitempty"` + // The date user was changed + ChangedOn NullableString `json:"changed_on,omitempty"` + // The date user was created + CreatedOn NullableString `json:"created_on,omitempty"` + // The user's email. *Changed in version 2.2.0*: A minimum character length requirement ('minLength') is added. + Email *string `json:"email,omitempty"` + // The number of times the login failed + FailedLoginCount NullableInt32 `json:"failed_login_count,omitempty"` + // The user's first name. *Changed in version 2.4.0*: The requirement for this to be non-empty was removed. + FirstName *string `json:"first_name,omitempty"` // The last user login LastLogin NullableString `json:"last_login,omitempty"` + // The user's last name. *Changed in version 2.4.0*: The requirement for this to be non-empty was removed. + LastName *string `json:"last_name,omitempty"` // The login count LoginCount NullableInt32 `json:"login_count,omitempty"` - // The number of times the login failed - FailedLoginCount NullableInt32 `json:"failed_login_count,omitempty"` // User roles. *Changed in version 2.2.0*: Field is no longer read-only. - Roles *[]UserCollectionItemRoles `json:"roles,omitempty"` - // The date user was created - CreatedOn NullableString `json:"created_on,omitempty"` - // The date user was changed - ChangedOn NullableString `json:"changed_on,omitempty"` + Roles []UserCollectionItemRolesInner `json:"roles,omitempty"` + // The username. *Changed in version 2.2.0*: A minimum character length requirement ('minLength') is added. + Username *string `json:"username,omitempty"` Password *string `json:"password,omitempty"` } @@ -76,105 +62,135 @@ func NewUserWithDefaults() *User { return &this } -// GetFirstName returns the FirstName field value if set, zero value otherwise. -func (o *User) GetFirstName() string { - if o == nil || o.FirstName == nil { - var ret string +// GetActive returns the Active field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *User) GetActive() bool { + if o == nil || IsNil(o.Active.Get()) { + var ret bool return ret } - return *o.FirstName + return *o.Active.Get() } -// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise +// GetActiveOk returns a tuple with the Active field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *User) GetFirstNameOk() (*string, bool) { - if o == nil || o.FirstName == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *User) GetActiveOk() (*bool, bool) { + if o == nil { return nil, false } - return o.FirstName, true + return o.Active.Get(), o.Active.IsSet() } -// HasFirstName returns a boolean if a field has been set. -func (o *User) HasFirstName() bool { - if o != nil && o.FirstName != nil { +// HasActive returns a boolean if a field has been set. +func (o *User) HasActive() bool { + if o != nil && o.Active.IsSet() { return true } return false } -// SetFirstName gets a reference to the given string and assigns it to the FirstName field. -func (o *User) SetFirstName(v string) { - o.FirstName = &v +// SetActive gets a reference to the given NullableBool and assigns it to the Active field. +func (o *User) SetActive(v bool) { + o.Active.Set(&v) +} +// SetActiveNil sets the value for Active to be an explicit nil +func (o *User) SetActiveNil() { + o.Active.Set(nil) } -// GetLastName returns the LastName field value if set, zero value otherwise. -func (o *User) GetLastName() string { - if o == nil || o.LastName == nil { +// UnsetActive ensures that no value is present for Active, not even an explicit nil +func (o *User) UnsetActive() { + o.Active.Unset() +} + +// GetChangedOn returns the ChangedOn field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *User) GetChangedOn() string { + if o == nil || IsNil(o.ChangedOn.Get()) { var ret string return ret } - return *o.LastName + return *o.ChangedOn.Get() } -// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise +// GetChangedOnOk returns a tuple with the ChangedOn field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *User) GetLastNameOk() (*string, bool) { - if o == nil || o.LastName == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *User) GetChangedOnOk() (*string, bool) { + if o == nil { return nil, false } - return o.LastName, true + return o.ChangedOn.Get(), o.ChangedOn.IsSet() } -// HasLastName returns a boolean if a field has been set. -func (o *User) HasLastName() bool { - if o != nil && o.LastName != nil { +// HasChangedOn returns a boolean if a field has been set. +func (o *User) HasChangedOn() bool { + if o != nil && o.ChangedOn.IsSet() { return true } return false } -// SetLastName gets a reference to the given string and assigns it to the LastName field. -func (o *User) SetLastName(v string) { - o.LastName = &v +// SetChangedOn gets a reference to the given NullableString and assigns it to the ChangedOn field. +func (o *User) SetChangedOn(v string) { + o.ChangedOn.Set(&v) +} +// SetChangedOnNil sets the value for ChangedOn to be an explicit nil +func (o *User) SetChangedOnNil() { + o.ChangedOn.Set(nil) } -// GetUsername returns the Username field value if set, zero value otherwise. -func (o *User) GetUsername() string { - if o == nil || o.Username == nil { +// UnsetChangedOn ensures that no value is present for ChangedOn, not even an explicit nil +func (o *User) UnsetChangedOn() { + o.ChangedOn.Unset() +} + +// GetCreatedOn returns the CreatedOn field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *User) GetCreatedOn() string { + if o == nil || IsNil(o.CreatedOn.Get()) { var ret string return ret } - return *o.Username + return *o.CreatedOn.Get() } -// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// GetCreatedOnOk returns a tuple with the CreatedOn field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *User) GetUsernameOk() (*string, bool) { - if o == nil || o.Username == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *User) GetCreatedOnOk() (*string, bool) { + if o == nil { return nil, false } - return o.Username, true + return o.CreatedOn.Get(), o.CreatedOn.IsSet() } -// HasUsername returns a boolean if a field has been set. -func (o *User) HasUsername() bool { - if o != nil && o.Username != nil { +// HasCreatedOn returns a boolean if a field has been set. +func (o *User) HasCreatedOn() bool { + if o != nil && o.CreatedOn.IsSet() { return true } return false } -// SetUsername gets a reference to the given string and assigns it to the Username field. -func (o *User) SetUsername(v string) { - o.Username = &v +// SetCreatedOn gets a reference to the given NullableString and assigns it to the CreatedOn field. +func (o *User) SetCreatedOn(v string) { + o.CreatedOn.Set(&v) +} +// SetCreatedOnNil sets the value for CreatedOn to be an explicit nil +func (o *User) SetCreatedOnNil() { + o.CreatedOn.Set(nil) +} + +// UnsetCreatedOn ensures that no value is present for CreatedOn, not even an explicit nil +func (o *User) UnsetCreatedOn() { + o.CreatedOn.Unset() } // GetEmail returns the Email field value if set, zero value otherwise. func (o *User) GetEmail() string { - if o == nil || o.Email == nil { + if o == nil || IsNil(o.Email) { var ret string return ret } @@ -184,7 +200,7 @@ func (o *User) GetEmail() string { // GetEmailOk returns a tuple with the Email field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *User) GetEmailOk() (*string, bool) { - if o == nil || o.Email == nil { + if o == nil || IsNil(o.Email) { return nil, false } return o.Email, true @@ -192,7 +208,7 @@ func (o *User) GetEmailOk() (*string, bool) { // HasEmail returns a boolean if a field has been set. func (o *User) HasEmail() bool { - if o != nil && o.Email != nil { + if o != nil && !IsNil(o.Email) { return true } @@ -204,51 +220,83 @@ func (o *User) SetEmail(v string) { o.Email = &v } -// GetActive returns the Active field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *User) GetActive() bool { - if o == nil || o.Active.Get() == nil { - var ret bool +// GetFailedLoginCount returns the FailedLoginCount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *User) GetFailedLoginCount() int32 { + if o == nil || IsNil(o.FailedLoginCount.Get()) { + var ret int32 return ret } - return *o.Active.Get() + return *o.FailedLoginCount.Get() } -// GetActiveOk returns a tuple with the Active field value if set, nil otherwise +// GetFailedLoginCountOk returns a tuple with the FailedLoginCount field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *User) GetActiveOk() (*bool, bool) { - if o == nil { +func (o *User) GetFailedLoginCountOk() (*int32, bool) { + if o == nil { return nil, false } - return o.Active.Get(), o.Active.IsSet() + return o.FailedLoginCount.Get(), o.FailedLoginCount.IsSet() } -// HasActive returns a boolean if a field has been set. -func (o *User) HasActive() bool { - if o != nil && o.Active.IsSet() { +// HasFailedLoginCount returns a boolean if a field has been set. +func (o *User) HasFailedLoginCount() bool { + if o != nil && o.FailedLoginCount.IsSet() { return true } return false } -// SetActive gets a reference to the given NullableBool and assigns it to the Active field. -func (o *User) SetActive(v bool) { - o.Active.Set(&v) +// SetFailedLoginCount gets a reference to the given NullableInt32 and assigns it to the FailedLoginCount field. +func (o *User) SetFailedLoginCount(v int32) { + o.FailedLoginCount.Set(&v) } -// SetActiveNil sets the value for Active to be an explicit nil -func (o *User) SetActiveNil() { - o.Active.Set(nil) +// SetFailedLoginCountNil sets the value for FailedLoginCount to be an explicit nil +func (o *User) SetFailedLoginCountNil() { + o.FailedLoginCount.Set(nil) } -// UnsetActive ensures that no value is present for Active, not even an explicit nil -func (o *User) UnsetActive() { - o.Active.Unset() +// UnsetFailedLoginCount ensures that no value is present for FailedLoginCount, not even an explicit nil +func (o *User) UnsetFailedLoginCount() { + o.FailedLoginCount.Unset() +} + +// GetFirstName returns the FirstName field value if set, zero value otherwise. +func (o *User) GetFirstName() string { + if o == nil || IsNil(o.FirstName) { + var ret string + return ret + } + return *o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetFirstNameOk() (*string, bool) { + if o == nil || IsNil(o.FirstName) { + return nil, false + } + return o.FirstName, true +} + +// HasFirstName returns a boolean if a field has been set. +func (o *User) HasFirstName() bool { + if o != nil && !IsNil(o.FirstName) { + return true + } + + return false +} + +// SetFirstName gets a reference to the given string and assigns it to the FirstName field. +func (o *User) SetFirstName(v string) { + o.FirstName = &v } // GetLastLogin returns the LastLogin field value if set, zero value otherwise (both if not set or set to explicit null). func (o *User) GetLastLogin() string { - if o == nil || o.LastLogin.Get() == nil { + if o == nil || IsNil(o.LastLogin.Get()) { var ret string return ret } @@ -259,7 +307,7 @@ func (o *User) GetLastLogin() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *User) GetLastLoginOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.LastLogin.Get(), o.LastLogin.IsSet() @@ -288,9 +336,41 @@ func (o *User) UnsetLastLogin() { o.LastLogin.Unset() } +// GetLastName returns the LastName field value if set, zero value otherwise. +func (o *User) GetLastName() string { + if o == nil || IsNil(o.LastName) { + var ret string + return ret + } + return *o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetLastNameOk() (*string, bool) { + if o == nil || IsNil(o.LastName) { + return nil, false + } + return o.LastName, true +} + +// HasLastName returns a boolean if a field has been set. +func (o *User) HasLastName() bool { + if o != nil && !IsNil(o.LastName) { + return true + } + + return false +} + +// SetLastName gets a reference to the given string and assigns it to the LastName field. +func (o *User) SetLastName(v string) { + o.LastName = &v +} + // GetLoginCount returns the LoginCount field value if set, zero value otherwise (both if not set or set to explicit null). func (o *User) GetLoginCount() int32 { - if o == nil || o.LoginCount.Get() == nil { + if o == nil || IsNil(o.LoginCount.Get()) { var ret int32 return ret } @@ -301,7 +381,7 @@ func (o *User) GetLoginCount() int32 { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *User) GetLoginCountOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return o.LoginCount.Get(), o.LoginCount.IsSet() @@ -330,61 +410,19 @@ func (o *User) UnsetLoginCount() { o.LoginCount.Unset() } -// GetFailedLoginCount returns the FailedLoginCount field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *User) GetFailedLoginCount() int32 { - if o == nil || o.FailedLoginCount.Get() == nil { - var ret int32 - return ret - } - return *o.FailedLoginCount.Get() -} - -// GetFailedLoginCountOk returns a tuple with the FailedLoginCount field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *User) GetFailedLoginCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.FailedLoginCount.Get(), o.FailedLoginCount.IsSet() -} - -// HasFailedLoginCount returns a boolean if a field has been set. -func (o *User) HasFailedLoginCount() bool { - if o != nil && o.FailedLoginCount.IsSet() { - return true - } - - return false -} - -// SetFailedLoginCount gets a reference to the given NullableInt32 and assigns it to the FailedLoginCount field. -func (o *User) SetFailedLoginCount(v int32) { - o.FailedLoginCount.Set(&v) -} -// SetFailedLoginCountNil sets the value for FailedLoginCount to be an explicit nil -func (o *User) SetFailedLoginCountNil() { - o.FailedLoginCount.Set(nil) -} - -// UnsetFailedLoginCount ensures that no value is present for FailedLoginCount, not even an explicit nil -func (o *User) UnsetFailedLoginCount() { - o.FailedLoginCount.Unset() -} - // GetRoles returns the Roles field value if set, zero value otherwise. -func (o *User) GetRoles() []UserCollectionItemRoles { - if o == nil || o.Roles == nil { - var ret []UserCollectionItemRoles +func (o *User) GetRoles() []UserCollectionItemRolesInner { + if o == nil || IsNil(o.Roles) { + var ret []UserCollectionItemRolesInner return ret } - return *o.Roles + return o.Roles } // GetRolesOk returns a tuple with the Roles field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *User) GetRolesOk() (*[]UserCollectionItemRoles, bool) { - if o == nil || o.Roles == nil { +func (o *User) GetRolesOk() ([]UserCollectionItemRolesInner, bool) { + if o == nil || IsNil(o.Roles) { return nil, false } return o.Roles, true @@ -392,105 +430,53 @@ func (o *User) GetRolesOk() (*[]UserCollectionItemRoles, bool) { // HasRoles returns a boolean if a field has been set. func (o *User) HasRoles() bool { - if o != nil && o.Roles != nil { + if o != nil && !IsNil(o.Roles) { return true } return false } -// SetRoles gets a reference to the given []UserCollectionItemRoles and assigns it to the Roles field. -func (o *User) SetRoles(v []UserCollectionItemRoles) { - o.Roles = &v +// SetRoles gets a reference to the given []UserCollectionItemRolesInner and assigns it to the Roles field. +func (o *User) SetRoles(v []UserCollectionItemRolesInner) { + o.Roles = v } -// GetCreatedOn returns the CreatedOn field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *User) GetCreatedOn() string { - if o == nil || o.CreatedOn.Get() == nil { - var ret string - return ret - } - return *o.CreatedOn.Get() -} - -// GetCreatedOnOk returns a tuple with the CreatedOn field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *User) GetCreatedOnOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.CreatedOn.Get(), o.CreatedOn.IsSet() -} - -// HasCreatedOn returns a boolean if a field has been set. -func (o *User) HasCreatedOn() bool { - if o != nil && o.CreatedOn.IsSet() { - return true - } - - return false -} - -// SetCreatedOn gets a reference to the given NullableString and assigns it to the CreatedOn field. -func (o *User) SetCreatedOn(v string) { - o.CreatedOn.Set(&v) -} -// SetCreatedOnNil sets the value for CreatedOn to be an explicit nil -func (o *User) SetCreatedOnNil() { - o.CreatedOn.Set(nil) -} - -// UnsetCreatedOn ensures that no value is present for CreatedOn, not even an explicit nil -func (o *User) UnsetCreatedOn() { - o.CreatedOn.Unset() -} - -// GetChangedOn returns the ChangedOn field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *User) GetChangedOn() string { - if o == nil || o.ChangedOn.Get() == nil { +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *User) GetUsername() string { + if o == nil || IsNil(o.Username) { var ret string return ret } - return *o.ChangedOn.Get() + return *o.Username } -// GetChangedOnOk returns a tuple with the ChangedOn field value if set, nil otherwise +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *User) GetChangedOnOk() (*string, bool) { - if o == nil { +func (o *User) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { return nil, false } - return o.ChangedOn.Get(), o.ChangedOn.IsSet() + return o.Username, true } -// HasChangedOn returns a boolean if a field has been set. -func (o *User) HasChangedOn() bool { - if o != nil && o.ChangedOn.IsSet() { +// HasUsername returns a boolean if a field has been set. +func (o *User) HasUsername() bool { + if o != nil && !IsNil(o.Username) { return true } return false } -// SetChangedOn gets a reference to the given NullableString and assigns it to the ChangedOn field. -func (o *User) SetChangedOn(v string) { - o.ChangedOn.Set(&v) -} -// SetChangedOnNil sets the value for ChangedOn to be an explicit nil -func (o *User) SetChangedOnNil() { - o.ChangedOn.Set(nil) -} - -// UnsetChangedOn ensures that no value is present for ChangedOn, not even an explicit nil -func (o *User) UnsetChangedOn() { - o.ChangedOn.Unset() +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *User) SetUsername(v string) { + o.Username = &v } // GetPassword returns the Password field value if set, zero value otherwise. func (o *User) GetPassword() string { - if o == nil || o.Password == nil { + if o == nil || IsNil(o.Password) { var ret string return ret } @@ -500,7 +486,7 @@ func (o *User) GetPassword() string { // GetPasswordOk returns a tuple with the Password field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *User) GetPasswordOk() (*string, bool) { - if o == nil || o.Password == nil { + if o == nil || IsNil(o.Password) { return nil, false } return o.Password, true @@ -508,7 +494,7 @@ func (o *User) GetPasswordOk() (*string, bool) { // HasPassword returns a boolean if a field has been set. func (o *User) HasPassword() bool { - if o != nil && o.Password != nil { + if o != nil && !IsNil(o.Password) { return true } @@ -521,44 +507,52 @@ func (o *User) SetPassword(v string) { } func (o User) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o User) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.FirstName != nil { - toSerialize["first_name"] = o.FirstName + if o.Active.IsSet() { + toSerialize["active"] = o.Active.Get() } - if o.LastName != nil { - toSerialize["last_name"] = o.LastName + if o.ChangedOn.IsSet() { + toSerialize["changed_on"] = o.ChangedOn.Get() } - if o.Username != nil { - toSerialize["username"] = o.Username + if o.CreatedOn.IsSet() { + toSerialize["created_on"] = o.CreatedOn.Get() } - if o.Email != nil { + if !IsNil(o.Email) { toSerialize["email"] = o.Email } - if o.Active.IsSet() { - toSerialize["active"] = o.Active.Get() + if o.FailedLoginCount.IsSet() { + toSerialize["failed_login_count"] = o.FailedLoginCount.Get() + } + if !IsNil(o.FirstName) { + toSerialize["first_name"] = o.FirstName } if o.LastLogin.IsSet() { toSerialize["last_login"] = o.LastLogin.Get() } + if !IsNil(o.LastName) { + toSerialize["last_name"] = o.LastName + } if o.LoginCount.IsSet() { toSerialize["login_count"] = o.LoginCount.Get() } - if o.FailedLoginCount.IsSet() { - toSerialize["failed_login_count"] = o.FailedLoginCount.Get() - } - if o.Roles != nil { + if !IsNil(o.Roles) { toSerialize["roles"] = o.Roles } - if o.CreatedOn.IsSet() { - toSerialize["created_on"] = o.CreatedOn.Get() - } - if o.ChangedOn.IsSet() { - toSerialize["changed_on"] = o.ChangedOn.Get() + if !IsNil(o.Username) { + toSerialize["username"] = o.Username } - if o.Password != nil { + if !IsNil(o.Password) { toSerialize["password"] = o.Password } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableUser struct { diff --git a/airflow/model_user_collection.go b/airflow/model_user_collection.go index 71c2b8e..21b32ec 100644 --- a/airflow/model_user_collection.go +++ b/airflow/model_user_collection.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,11 +15,14 @@ import ( "encoding/json" ) +// checks if the UserCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserCollection{} + // UserCollection Collection of users. *New in version 2.1.0* type UserCollection struct { - Users *[]UserCollectionItem `json:"users,omitempty"` - // Count of objects in the current result set. + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. TotalEntries *int32 `json:"total_entries,omitempty"` + Users []UserCollectionItem `json:"users,omitempty"` } // NewUserCollection instantiates a new UserCollection object @@ -56,79 +42,87 @@ func NewUserCollectionWithDefaults() *UserCollection { return &this } -// GetUsers returns the Users field value if set, zero value otherwise. -func (o *UserCollection) GetUsers() []UserCollectionItem { - if o == nil || o.Users == nil { - var ret []UserCollectionItem +// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. +func (o *UserCollection) GetTotalEntries() int32 { + if o == nil || IsNil(o.TotalEntries) { + var ret int32 return ret } - return *o.Users + return *o.TotalEntries } -// GetUsersOk returns a tuple with the Users field value if set, nil otherwise +// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UserCollection) GetUsersOk() (*[]UserCollectionItem, bool) { - if o == nil || o.Users == nil { +func (o *UserCollection) GetTotalEntriesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalEntries) { return nil, false } - return o.Users, true + return o.TotalEntries, true } -// HasUsers returns a boolean if a field has been set. -func (o *UserCollection) HasUsers() bool { - if o != nil && o.Users != nil { +// HasTotalEntries returns a boolean if a field has been set. +func (o *UserCollection) HasTotalEntries() bool { + if o != nil && !IsNil(o.TotalEntries) { return true } return false } -// SetUsers gets a reference to the given []UserCollectionItem and assigns it to the Users field. -func (o *UserCollection) SetUsers(v []UserCollectionItem) { - o.Users = &v +// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. +func (o *UserCollection) SetTotalEntries(v int32) { + o.TotalEntries = &v } -// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. -func (o *UserCollection) GetTotalEntries() int32 { - if o == nil || o.TotalEntries == nil { - var ret int32 +// GetUsers returns the Users field value if set, zero value otherwise. +func (o *UserCollection) GetUsers() []UserCollectionItem { + if o == nil || IsNil(o.Users) { + var ret []UserCollectionItem return ret } - return *o.TotalEntries + return o.Users } -// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise +// GetUsersOk returns a tuple with the Users field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UserCollection) GetTotalEntriesOk() (*int32, bool) { - if o == nil || o.TotalEntries == nil { +func (o *UserCollection) GetUsersOk() ([]UserCollectionItem, bool) { + if o == nil || IsNil(o.Users) { return nil, false } - return o.TotalEntries, true + return o.Users, true } -// HasTotalEntries returns a boolean if a field has been set. -func (o *UserCollection) HasTotalEntries() bool { - if o != nil && o.TotalEntries != nil { +// HasUsers returns a boolean if a field has been set. +func (o *UserCollection) HasUsers() bool { + if o != nil && !IsNil(o.Users) { return true } return false } -// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. -func (o *UserCollection) SetTotalEntries(v int32) { - o.TotalEntries = &v +// SetUsers gets a reference to the given []UserCollectionItem and assigns it to the Users field. +func (o *UserCollection) SetUsers(v []UserCollectionItem) { + o.Users = v } func (o UserCollection) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Users != nil { - toSerialize["users"] = o.Users + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.TotalEntries != nil { + return json.Marshal(toSerialize) +} + +func (o UserCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalEntries) { toSerialize["total_entries"] = o.TotalEntries } - return json.Marshal(toSerialize) + if !IsNil(o.Users) { + toSerialize["users"] = o.Users + } + return toSerialize, nil } type NullableUserCollection struct { diff --git a/airflow/model_user_collection_item.go b/airflow/model_user_collection_item.go index 3eb72bb..6958b71 100644 --- a/airflow/model_user_collection_item.go +++ b/airflow/model_user_collection_item.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,30 +15,33 @@ import ( "encoding/json" ) +// checks if the UserCollectionItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserCollectionItem{} + // UserCollectionItem A user object. *New in version 2.1.0* type UserCollectionItem struct { - // The user's first name. *Changed in version 2.4.0*: The requirement for this to be non-empty was removed. - FirstName *string `json:"first_name,omitempty"` - // The user's last name. *Changed in version 2.4.0*: The requirement for this to be non-empty was removed. - LastName *string `json:"last_name,omitempty"` - // The username. *Changed in version 2.2.0*: A minimum character length requirement ('minLength') is added. - Username *string `json:"username,omitempty"` - // The user's email. *Changed in version 2.2.0*: A minimum character length requirement ('minLength') is added. - Email *string `json:"email,omitempty"` // Whether the user is active Active NullableBool `json:"active,omitempty"` + // The date user was changed + ChangedOn NullableString `json:"changed_on,omitempty"` + // The date user was created + CreatedOn NullableString `json:"created_on,omitempty"` + // The user's email. *Changed in version 2.2.0*: A minimum character length requirement ('minLength') is added. + Email *string `json:"email,omitempty"` + // The number of times the login failed + FailedLoginCount NullableInt32 `json:"failed_login_count,omitempty"` + // The user's first name. *Changed in version 2.4.0*: The requirement for this to be non-empty was removed. + FirstName *string `json:"first_name,omitempty"` // The last user login LastLogin NullableString `json:"last_login,omitempty"` + // The user's last name. *Changed in version 2.4.0*: The requirement for this to be non-empty was removed. + LastName *string `json:"last_name,omitempty"` // The login count LoginCount NullableInt32 `json:"login_count,omitempty"` - // The number of times the login failed - FailedLoginCount NullableInt32 `json:"failed_login_count,omitempty"` // User roles. *Changed in version 2.2.0*: Field is no longer read-only. - Roles *[]UserCollectionItemRoles `json:"roles,omitempty"` - // The date user was created - CreatedOn NullableString `json:"created_on,omitempty"` - // The date user was changed - ChangedOn NullableString `json:"changed_on,omitempty"` + Roles []UserCollectionItemRolesInner `json:"roles,omitempty"` + // The username. *Changed in version 2.2.0*: A minimum character length requirement ('minLength') is added. + Username *string `json:"username,omitempty"` } // NewUserCollectionItem instantiates a new UserCollectionItem object @@ -75,105 +61,135 @@ func NewUserCollectionItemWithDefaults() *UserCollectionItem { return &this } -// GetFirstName returns the FirstName field value if set, zero value otherwise. -func (o *UserCollectionItem) GetFirstName() string { - if o == nil || o.FirstName == nil { - var ret string +// GetActive returns the Active field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UserCollectionItem) GetActive() bool { + if o == nil || IsNil(o.Active.Get()) { + var ret bool return ret } - return *o.FirstName + return *o.Active.Get() } -// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise +// GetActiveOk returns a tuple with the Active field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UserCollectionItem) GetFirstNameOk() (*string, bool) { - if o == nil || o.FirstName == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserCollectionItem) GetActiveOk() (*bool, bool) { + if o == nil { return nil, false } - return o.FirstName, true + return o.Active.Get(), o.Active.IsSet() } -// HasFirstName returns a boolean if a field has been set. -func (o *UserCollectionItem) HasFirstName() bool { - if o != nil && o.FirstName != nil { +// HasActive returns a boolean if a field has been set. +func (o *UserCollectionItem) HasActive() bool { + if o != nil && o.Active.IsSet() { return true } return false } -// SetFirstName gets a reference to the given string and assigns it to the FirstName field. -func (o *UserCollectionItem) SetFirstName(v string) { - o.FirstName = &v +// SetActive gets a reference to the given NullableBool and assigns it to the Active field. +func (o *UserCollectionItem) SetActive(v bool) { + o.Active.Set(&v) +} +// SetActiveNil sets the value for Active to be an explicit nil +func (o *UserCollectionItem) SetActiveNil() { + o.Active.Set(nil) } -// GetLastName returns the LastName field value if set, zero value otherwise. -func (o *UserCollectionItem) GetLastName() string { - if o == nil || o.LastName == nil { +// UnsetActive ensures that no value is present for Active, not even an explicit nil +func (o *UserCollectionItem) UnsetActive() { + o.Active.Unset() +} + +// GetChangedOn returns the ChangedOn field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UserCollectionItem) GetChangedOn() string { + if o == nil || IsNil(o.ChangedOn.Get()) { var ret string return ret } - return *o.LastName + return *o.ChangedOn.Get() } -// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise +// GetChangedOnOk returns a tuple with the ChangedOn field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UserCollectionItem) GetLastNameOk() (*string, bool) { - if o == nil || o.LastName == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserCollectionItem) GetChangedOnOk() (*string, bool) { + if o == nil { return nil, false } - return o.LastName, true + return o.ChangedOn.Get(), o.ChangedOn.IsSet() } -// HasLastName returns a boolean if a field has been set. -func (o *UserCollectionItem) HasLastName() bool { - if o != nil && o.LastName != nil { +// HasChangedOn returns a boolean if a field has been set. +func (o *UserCollectionItem) HasChangedOn() bool { + if o != nil && o.ChangedOn.IsSet() { return true } return false } -// SetLastName gets a reference to the given string and assigns it to the LastName field. -func (o *UserCollectionItem) SetLastName(v string) { - o.LastName = &v +// SetChangedOn gets a reference to the given NullableString and assigns it to the ChangedOn field. +func (o *UserCollectionItem) SetChangedOn(v string) { + o.ChangedOn.Set(&v) +} +// SetChangedOnNil sets the value for ChangedOn to be an explicit nil +func (o *UserCollectionItem) SetChangedOnNil() { + o.ChangedOn.Set(nil) } -// GetUsername returns the Username field value if set, zero value otherwise. -func (o *UserCollectionItem) GetUsername() string { - if o == nil || o.Username == nil { +// UnsetChangedOn ensures that no value is present for ChangedOn, not even an explicit nil +func (o *UserCollectionItem) UnsetChangedOn() { + o.ChangedOn.Unset() +} + +// GetCreatedOn returns the CreatedOn field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UserCollectionItem) GetCreatedOn() string { + if o == nil || IsNil(o.CreatedOn.Get()) { var ret string return ret } - return *o.Username + return *o.CreatedOn.Get() } -// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// GetCreatedOnOk returns a tuple with the CreatedOn field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UserCollectionItem) GetUsernameOk() (*string, bool) { - if o == nil || o.Username == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserCollectionItem) GetCreatedOnOk() (*string, bool) { + if o == nil { return nil, false } - return o.Username, true + return o.CreatedOn.Get(), o.CreatedOn.IsSet() } -// HasUsername returns a boolean if a field has been set. -func (o *UserCollectionItem) HasUsername() bool { - if o != nil && o.Username != nil { +// HasCreatedOn returns a boolean if a field has been set. +func (o *UserCollectionItem) HasCreatedOn() bool { + if o != nil && o.CreatedOn.IsSet() { return true } return false } -// SetUsername gets a reference to the given string and assigns it to the Username field. -func (o *UserCollectionItem) SetUsername(v string) { - o.Username = &v +// SetCreatedOn gets a reference to the given NullableString and assigns it to the CreatedOn field. +func (o *UserCollectionItem) SetCreatedOn(v string) { + o.CreatedOn.Set(&v) +} +// SetCreatedOnNil sets the value for CreatedOn to be an explicit nil +func (o *UserCollectionItem) SetCreatedOnNil() { + o.CreatedOn.Set(nil) +} + +// UnsetCreatedOn ensures that no value is present for CreatedOn, not even an explicit nil +func (o *UserCollectionItem) UnsetCreatedOn() { + o.CreatedOn.Unset() } // GetEmail returns the Email field value if set, zero value otherwise. func (o *UserCollectionItem) GetEmail() string { - if o == nil || o.Email == nil { + if o == nil || IsNil(o.Email) { var ret string return ret } @@ -183,7 +199,7 @@ func (o *UserCollectionItem) GetEmail() string { // GetEmailOk returns a tuple with the Email field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *UserCollectionItem) GetEmailOk() (*string, bool) { - if o == nil || o.Email == nil { + if o == nil || IsNil(o.Email) { return nil, false } return o.Email, true @@ -191,7 +207,7 @@ func (o *UserCollectionItem) GetEmailOk() (*string, bool) { // HasEmail returns a boolean if a field has been set. func (o *UserCollectionItem) HasEmail() bool { - if o != nil && o.Email != nil { + if o != nil && !IsNil(o.Email) { return true } @@ -203,51 +219,83 @@ func (o *UserCollectionItem) SetEmail(v string) { o.Email = &v } -// GetActive returns the Active field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UserCollectionItem) GetActive() bool { - if o == nil || o.Active.Get() == nil { - var ret bool +// GetFailedLoginCount returns the FailedLoginCount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UserCollectionItem) GetFailedLoginCount() int32 { + if o == nil || IsNil(o.FailedLoginCount.Get()) { + var ret int32 return ret } - return *o.Active.Get() + return *o.FailedLoginCount.Get() } -// GetActiveOk returns a tuple with the Active field value if set, nil otherwise +// GetFailedLoginCountOk returns a tuple with the FailedLoginCount field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *UserCollectionItem) GetActiveOk() (*bool, bool) { - if o == nil { +func (o *UserCollectionItem) GetFailedLoginCountOk() (*int32, bool) { + if o == nil { return nil, false } - return o.Active.Get(), o.Active.IsSet() + return o.FailedLoginCount.Get(), o.FailedLoginCount.IsSet() } -// HasActive returns a boolean if a field has been set. -func (o *UserCollectionItem) HasActive() bool { - if o != nil && o.Active.IsSet() { +// HasFailedLoginCount returns a boolean if a field has been set. +func (o *UserCollectionItem) HasFailedLoginCount() bool { + if o != nil && o.FailedLoginCount.IsSet() { return true } return false } -// SetActive gets a reference to the given NullableBool and assigns it to the Active field. -func (o *UserCollectionItem) SetActive(v bool) { - o.Active.Set(&v) +// SetFailedLoginCount gets a reference to the given NullableInt32 and assigns it to the FailedLoginCount field. +func (o *UserCollectionItem) SetFailedLoginCount(v int32) { + o.FailedLoginCount.Set(&v) } -// SetActiveNil sets the value for Active to be an explicit nil -func (o *UserCollectionItem) SetActiveNil() { - o.Active.Set(nil) +// SetFailedLoginCountNil sets the value for FailedLoginCount to be an explicit nil +func (o *UserCollectionItem) SetFailedLoginCountNil() { + o.FailedLoginCount.Set(nil) } -// UnsetActive ensures that no value is present for Active, not even an explicit nil -func (o *UserCollectionItem) UnsetActive() { - o.Active.Unset() +// UnsetFailedLoginCount ensures that no value is present for FailedLoginCount, not even an explicit nil +func (o *UserCollectionItem) UnsetFailedLoginCount() { + o.FailedLoginCount.Unset() +} + +// GetFirstName returns the FirstName field value if set, zero value otherwise. +func (o *UserCollectionItem) GetFirstName() string { + if o == nil || IsNil(o.FirstName) { + var ret string + return ret + } + return *o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCollectionItem) GetFirstNameOk() (*string, bool) { + if o == nil || IsNil(o.FirstName) { + return nil, false + } + return o.FirstName, true +} + +// HasFirstName returns a boolean if a field has been set. +func (o *UserCollectionItem) HasFirstName() bool { + if o != nil && !IsNil(o.FirstName) { + return true + } + + return false +} + +// SetFirstName gets a reference to the given string and assigns it to the FirstName field. +func (o *UserCollectionItem) SetFirstName(v string) { + o.FirstName = &v } // GetLastLogin returns the LastLogin field value if set, zero value otherwise (both if not set or set to explicit null). func (o *UserCollectionItem) GetLastLogin() string { - if o == nil || o.LastLogin.Get() == nil { + if o == nil || IsNil(o.LastLogin.Get()) { var ret string return ret } @@ -258,7 +306,7 @@ func (o *UserCollectionItem) GetLastLogin() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *UserCollectionItem) GetLastLoginOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.LastLogin.Get(), o.LastLogin.IsSet() @@ -287,9 +335,41 @@ func (o *UserCollectionItem) UnsetLastLogin() { o.LastLogin.Unset() } +// GetLastName returns the LastName field value if set, zero value otherwise. +func (o *UserCollectionItem) GetLastName() string { + if o == nil || IsNil(o.LastName) { + var ret string + return ret + } + return *o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCollectionItem) GetLastNameOk() (*string, bool) { + if o == nil || IsNil(o.LastName) { + return nil, false + } + return o.LastName, true +} + +// HasLastName returns a boolean if a field has been set. +func (o *UserCollectionItem) HasLastName() bool { + if o != nil && !IsNil(o.LastName) { + return true + } + + return false +} + +// SetLastName gets a reference to the given string and assigns it to the LastName field. +func (o *UserCollectionItem) SetLastName(v string) { + o.LastName = &v +} + // GetLoginCount returns the LoginCount field value if set, zero value otherwise (both if not set or set to explicit null). func (o *UserCollectionItem) GetLoginCount() int32 { - if o == nil || o.LoginCount.Get() == nil { + if o == nil || IsNil(o.LoginCount.Get()) { var ret int32 return ret } @@ -300,7 +380,7 @@ func (o *UserCollectionItem) GetLoginCount() int32 { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *UserCollectionItem) GetLoginCountOk() (*int32, bool) { - if o == nil { + if o == nil { return nil, false } return o.LoginCount.Get(), o.LoginCount.IsSet() @@ -329,61 +409,19 @@ func (o *UserCollectionItem) UnsetLoginCount() { o.LoginCount.Unset() } -// GetFailedLoginCount returns the FailedLoginCount field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UserCollectionItem) GetFailedLoginCount() int32 { - if o == nil || o.FailedLoginCount.Get() == nil { - var ret int32 - return ret - } - return *o.FailedLoginCount.Get() -} - -// GetFailedLoginCountOk returns a tuple with the FailedLoginCount field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *UserCollectionItem) GetFailedLoginCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return o.FailedLoginCount.Get(), o.FailedLoginCount.IsSet() -} - -// HasFailedLoginCount returns a boolean if a field has been set. -func (o *UserCollectionItem) HasFailedLoginCount() bool { - if o != nil && o.FailedLoginCount.IsSet() { - return true - } - - return false -} - -// SetFailedLoginCount gets a reference to the given NullableInt32 and assigns it to the FailedLoginCount field. -func (o *UserCollectionItem) SetFailedLoginCount(v int32) { - o.FailedLoginCount.Set(&v) -} -// SetFailedLoginCountNil sets the value for FailedLoginCount to be an explicit nil -func (o *UserCollectionItem) SetFailedLoginCountNil() { - o.FailedLoginCount.Set(nil) -} - -// UnsetFailedLoginCount ensures that no value is present for FailedLoginCount, not even an explicit nil -func (o *UserCollectionItem) UnsetFailedLoginCount() { - o.FailedLoginCount.Unset() -} - // GetRoles returns the Roles field value if set, zero value otherwise. -func (o *UserCollectionItem) GetRoles() []UserCollectionItemRoles { - if o == nil || o.Roles == nil { - var ret []UserCollectionItemRoles +func (o *UserCollectionItem) GetRoles() []UserCollectionItemRolesInner { + if o == nil || IsNil(o.Roles) { + var ret []UserCollectionItemRolesInner return ret } - return *o.Roles + return o.Roles } // GetRolesOk returns a tuple with the Roles field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *UserCollectionItem) GetRolesOk() (*[]UserCollectionItemRoles, bool) { - if o == nil || o.Roles == nil { +func (o *UserCollectionItem) GetRolesOk() ([]UserCollectionItemRolesInner, bool) { + if o == nil || IsNil(o.Roles) { return nil, false } return o.Roles, true @@ -391,138 +429,94 @@ func (o *UserCollectionItem) GetRolesOk() (*[]UserCollectionItemRoles, bool) { // HasRoles returns a boolean if a field has been set. func (o *UserCollectionItem) HasRoles() bool { - if o != nil && o.Roles != nil { + if o != nil && !IsNil(o.Roles) { return true } return false } -// SetRoles gets a reference to the given []UserCollectionItemRoles and assigns it to the Roles field. -func (o *UserCollectionItem) SetRoles(v []UserCollectionItemRoles) { - o.Roles = &v +// SetRoles gets a reference to the given []UserCollectionItemRolesInner and assigns it to the Roles field. +func (o *UserCollectionItem) SetRoles(v []UserCollectionItemRolesInner) { + o.Roles = v } -// GetCreatedOn returns the CreatedOn field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UserCollectionItem) GetCreatedOn() string { - if o == nil || o.CreatedOn.Get() == nil { +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *UserCollectionItem) GetUsername() string { + if o == nil || IsNil(o.Username) { var ret string return ret } - return *o.CreatedOn.Get() + return *o.Username } -// GetCreatedOnOk returns a tuple with the CreatedOn field value if set, nil otherwise +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise // and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *UserCollectionItem) GetCreatedOnOk() (*string, bool) { - if o == nil { +func (o *UserCollectionItem) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { return nil, false } - return o.CreatedOn.Get(), o.CreatedOn.IsSet() + return o.Username, true } -// HasCreatedOn returns a boolean if a field has been set. -func (o *UserCollectionItem) HasCreatedOn() bool { - if o != nil && o.CreatedOn.IsSet() { +// HasUsername returns a boolean if a field has been set. +func (o *UserCollectionItem) HasUsername() bool { + if o != nil && !IsNil(o.Username) { return true } return false } -// SetCreatedOn gets a reference to the given NullableString and assigns it to the CreatedOn field. -func (o *UserCollectionItem) SetCreatedOn(v string) { - o.CreatedOn.Set(&v) -} -// SetCreatedOnNil sets the value for CreatedOn to be an explicit nil -func (o *UserCollectionItem) SetCreatedOnNil() { - o.CreatedOn.Set(nil) -} - -// UnsetCreatedOn ensures that no value is present for CreatedOn, not even an explicit nil -func (o *UserCollectionItem) UnsetCreatedOn() { - o.CreatedOn.Unset() -} - -// GetChangedOn returns the ChangedOn field value if set, zero value otherwise (both if not set or set to explicit null). -func (o *UserCollectionItem) GetChangedOn() string { - if o == nil || o.ChangedOn.Get() == nil { - var ret string - return ret - } - return *o.ChangedOn.Get() -} - -// GetChangedOnOk returns a tuple with the ChangedOn field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *UserCollectionItem) GetChangedOnOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.ChangedOn.Get(), o.ChangedOn.IsSet() +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *UserCollectionItem) SetUsername(v string) { + o.Username = &v } -// HasChangedOn returns a boolean if a field has been set. -func (o *UserCollectionItem) HasChangedOn() bool { - if o != nil && o.ChangedOn.IsSet() { - return true +func (o UserCollectionItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - - return false -} - -// SetChangedOn gets a reference to the given NullableString and assigns it to the ChangedOn field. -func (o *UserCollectionItem) SetChangedOn(v string) { - o.ChangedOn.Set(&v) -} -// SetChangedOnNil sets the value for ChangedOn to be an explicit nil -func (o *UserCollectionItem) SetChangedOnNil() { - o.ChangedOn.Set(nil) -} - -// UnsetChangedOn ensures that no value is present for ChangedOn, not even an explicit nil -func (o *UserCollectionItem) UnsetChangedOn() { - o.ChangedOn.Unset() + return json.Marshal(toSerialize) } -func (o UserCollectionItem) MarshalJSON() ([]byte, error) { +func (o UserCollectionItem) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} - if o.FirstName != nil { - toSerialize["first_name"] = o.FirstName + if o.Active.IsSet() { + toSerialize["active"] = o.Active.Get() } - if o.LastName != nil { - toSerialize["last_name"] = o.LastName + if o.ChangedOn.IsSet() { + toSerialize["changed_on"] = o.ChangedOn.Get() } - if o.Username != nil { - toSerialize["username"] = o.Username + if o.CreatedOn.IsSet() { + toSerialize["created_on"] = o.CreatedOn.Get() } - if o.Email != nil { + if !IsNil(o.Email) { toSerialize["email"] = o.Email } - if o.Active.IsSet() { - toSerialize["active"] = o.Active.Get() + if o.FailedLoginCount.IsSet() { + toSerialize["failed_login_count"] = o.FailedLoginCount.Get() + } + if !IsNil(o.FirstName) { + toSerialize["first_name"] = o.FirstName } if o.LastLogin.IsSet() { toSerialize["last_login"] = o.LastLogin.Get() } + if !IsNil(o.LastName) { + toSerialize["last_name"] = o.LastName + } if o.LoginCount.IsSet() { toSerialize["login_count"] = o.LoginCount.Get() } - if o.FailedLoginCount.IsSet() { - toSerialize["failed_login_count"] = o.FailedLoginCount.Get() - } - if o.Roles != nil { + if !IsNil(o.Roles) { toSerialize["roles"] = o.Roles } - if o.CreatedOn.IsSet() { - toSerialize["created_on"] = o.CreatedOn.Get() - } - if o.ChangedOn.IsSet() { - toSerialize["changed_on"] = o.ChangedOn.Get() + if !IsNil(o.Username) { + toSerialize["username"] = o.Username } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableUserCollectionItem struct { diff --git a/airflow/model_user_collection_item_roles_inner.go b/airflow/model_user_collection_item_roles_inner.go new file mode 100644 index 0000000..fad6c8f --- /dev/null +++ b/airflow/model_user_collection_item_roles_inner.go @@ -0,0 +1,127 @@ +/* +Airflow API (Stable) + +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. + +API version: 2.10.5 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package airflow + +import ( + "encoding/json" +) + +// checks if the UserCollectionItemRolesInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserCollectionItemRolesInner{} + +// UserCollectionItemRolesInner struct for UserCollectionItemRolesInner +type UserCollectionItemRolesInner struct { + Name *string `json:"name,omitempty"` +} + +// NewUserCollectionItemRolesInner instantiates a new UserCollectionItemRolesInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserCollectionItemRolesInner() *UserCollectionItemRolesInner { + this := UserCollectionItemRolesInner{} + return &this +} + +// NewUserCollectionItemRolesInnerWithDefaults instantiates a new UserCollectionItemRolesInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserCollectionItemRolesInnerWithDefaults() *UserCollectionItemRolesInner { + this := UserCollectionItemRolesInner{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UserCollectionItemRolesInner) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCollectionItemRolesInner) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UserCollectionItemRolesInner) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UserCollectionItemRolesInner) SetName(v string) { + o.Name = &v +} + +func (o UserCollectionItemRolesInner) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserCollectionItemRolesInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableUserCollectionItemRolesInner struct { + value *UserCollectionItemRolesInner + isSet bool +} + +func (v NullableUserCollectionItemRolesInner) Get() *UserCollectionItemRolesInner { + return v.value +} + +func (v *NullableUserCollectionItemRolesInner) Set(val *UserCollectionItemRolesInner) { + v.value = val + v.isSet = true +} + +func (v NullableUserCollectionItemRolesInner) IsSet() bool { + return v.isSet +} + +func (v *NullableUserCollectionItemRolesInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserCollectionItemRolesInner(val *UserCollectionItemRolesInner) *NullableUserCollectionItemRolesInner { + return &NullableUserCollectionItemRolesInner{value: val, isSet: true} +} + +func (v NullableUserCollectionItemRolesInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserCollectionItemRolesInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/model_variable.go b/airflow/model_variable.go index 6f4c385..391ff72 100644 --- a/airflow/model_variable.go +++ b/airflow/model_variable.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,11 +15,14 @@ import ( "encoding/json" ) +// checks if the Variable type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Variable{} + // Variable Full representation of Variable type Variable struct { - Key *string `json:"key,omitempty"` // The description of the variable. *New in version 2.4.0* Description NullableString `json:"description,omitempty"` + Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` } @@ -57,41 +43,9 @@ func NewVariableWithDefaults() *Variable { return &this } -// GetKey returns the Key field value if set, zero value otherwise. -func (o *Variable) GetKey() string { - if o == nil || o.Key == nil { - var ret string - return ret - } - return *o.Key -} - -// GetKeyOk returns a tuple with the Key field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Variable) GetKeyOk() (*string, bool) { - if o == nil || o.Key == nil { - return nil, false - } - return o.Key, true -} - -// HasKey returns a boolean if a field has been set. -func (o *Variable) HasKey() bool { - if o != nil && o.Key != nil { - return true - } - - return false -} - -// SetKey gets a reference to the given string and assigns it to the Key field. -func (o *Variable) SetKey(v string) { - o.Key = &v -} - // GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Variable) GetDescription() string { - if o == nil || o.Description.Get() == nil { + if o == nil || IsNil(o.Description.Get()) { var ret string return ret } @@ -102,7 +56,7 @@ func (o *Variable) GetDescription() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *Variable) GetDescriptionOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Description.Get(), o.Description.IsSet() @@ -131,9 +85,41 @@ func (o *Variable) UnsetDescription() { o.Description.Unset() } +// GetKey returns the Key field value if set, zero value otherwise. +func (o *Variable) GetKey() string { + if o == nil || IsNil(o.Key) { + var ret string + return ret + } + return *o.Key +} + +// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Variable) GetKeyOk() (*string, bool) { + if o == nil || IsNil(o.Key) { + return nil, false + } + return o.Key, true +} + +// HasKey returns a boolean if a field has been set. +func (o *Variable) HasKey() bool { + if o != nil && !IsNil(o.Key) { + return true + } + + return false +} + +// SetKey gets a reference to the given string and assigns it to the Key field. +func (o *Variable) SetKey(v string) { + o.Key = &v +} + // GetValue returns the Value field value if set, zero value otherwise. func (o *Variable) GetValue() string { - if o == nil || o.Value == nil { + if o == nil || IsNil(o.Value) { var ret string return ret } @@ -143,7 +129,7 @@ func (o *Variable) GetValue() string { // GetValueOk returns a tuple with the Value field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Variable) GetValueOk() (*string, bool) { - if o == nil || o.Value == nil { + if o == nil || IsNil(o.Value) { return nil, false } return o.Value, true @@ -151,7 +137,7 @@ func (o *Variable) GetValueOk() (*string, bool) { // HasValue returns a boolean if a field has been set. func (o *Variable) HasValue() bool { - if o != nil && o.Value != nil { + if o != nil && !IsNil(o.Value) { return true } @@ -164,17 +150,25 @@ func (o *Variable) SetValue(v string) { } func (o Variable) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Key != nil { - toSerialize["key"] = o.Key + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o Variable) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} if o.Description.IsSet() { toSerialize["description"] = o.Description.Get() } - if o.Value != nil { + if !IsNil(o.Key) { + toSerialize["key"] = o.Key + } + if !IsNil(o.Value) { toSerialize["value"] = o.Value } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableVariable struct { diff --git a/airflow/model_variable_collection.go b/airflow/model_variable_collection.go index d4f2832..e5d1512 100644 --- a/airflow/model_variable_collection.go +++ b/airflow/model_variable_collection.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,11 +15,14 @@ import ( "encoding/json" ) +// checks if the VariableCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VariableCollection{} + // VariableCollection Collection of variables. *Changed in version 2.1.0*: 'total_entries' field is added. type VariableCollection struct { - Variables *[]VariableCollectionItem `json:"variables,omitempty"` - // Count of objects in the current result set. + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. TotalEntries *int32 `json:"total_entries,omitempty"` + Variables []VariableCollectionItem `json:"variables,omitempty"` } // NewVariableCollection instantiates a new VariableCollection object @@ -56,79 +42,87 @@ func NewVariableCollectionWithDefaults() *VariableCollection { return &this } -// GetVariables returns the Variables field value if set, zero value otherwise. -func (o *VariableCollection) GetVariables() []VariableCollectionItem { - if o == nil || o.Variables == nil { - var ret []VariableCollectionItem +// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. +func (o *VariableCollection) GetTotalEntries() int32 { + if o == nil || IsNil(o.TotalEntries) { + var ret int32 return ret } - return *o.Variables + return *o.TotalEntries } -// GetVariablesOk returns a tuple with the Variables field value if set, nil otherwise +// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *VariableCollection) GetVariablesOk() (*[]VariableCollectionItem, bool) { - if o == nil || o.Variables == nil { +func (o *VariableCollection) GetTotalEntriesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalEntries) { return nil, false } - return o.Variables, true + return o.TotalEntries, true } -// HasVariables returns a boolean if a field has been set. -func (o *VariableCollection) HasVariables() bool { - if o != nil && o.Variables != nil { +// HasTotalEntries returns a boolean if a field has been set. +func (o *VariableCollection) HasTotalEntries() bool { + if o != nil && !IsNil(o.TotalEntries) { return true } return false } -// SetVariables gets a reference to the given []VariableCollectionItem and assigns it to the Variables field. -func (o *VariableCollection) SetVariables(v []VariableCollectionItem) { - o.Variables = &v +// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. +func (o *VariableCollection) SetTotalEntries(v int32) { + o.TotalEntries = &v } -// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. -func (o *VariableCollection) GetTotalEntries() int32 { - if o == nil || o.TotalEntries == nil { - var ret int32 +// GetVariables returns the Variables field value if set, zero value otherwise. +func (o *VariableCollection) GetVariables() []VariableCollectionItem { + if o == nil || IsNil(o.Variables) { + var ret []VariableCollectionItem return ret } - return *o.TotalEntries + return o.Variables } -// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise +// GetVariablesOk returns a tuple with the Variables field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *VariableCollection) GetTotalEntriesOk() (*int32, bool) { - if o == nil || o.TotalEntries == nil { +func (o *VariableCollection) GetVariablesOk() ([]VariableCollectionItem, bool) { + if o == nil || IsNil(o.Variables) { return nil, false } - return o.TotalEntries, true + return o.Variables, true } -// HasTotalEntries returns a boolean if a field has been set. -func (o *VariableCollection) HasTotalEntries() bool { - if o != nil && o.TotalEntries != nil { +// HasVariables returns a boolean if a field has been set. +func (o *VariableCollection) HasVariables() bool { + if o != nil && !IsNil(o.Variables) { return true } return false } -// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. -func (o *VariableCollection) SetTotalEntries(v int32) { - o.TotalEntries = &v +// SetVariables gets a reference to the given []VariableCollectionItem and assigns it to the Variables field. +func (o *VariableCollection) SetVariables(v []VariableCollectionItem) { + o.Variables = v } func (o VariableCollection) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Variables != nil { - toSerialize["variables"] = o.Variables + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.TotalEntries != nil { + return json.Marshal(toSerialize) +} + +func (o VariableCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalEntries) { toSerialize["total_entries"] = o.TotalEntries } - return json.Marshal(toSerialize) + if !IsNil(o.Variables) { + toSerialize["variables"] = o.Variables + } + return toSerialize, nil } type NullableVariableCollection struct { diff --git a/airflow/model_variable_collection_item.go b/airflow/model_variable_collection_item.go index 891abf2..b9ec2cd 100644 --- a/airflow/model_variable_collection_item.go +++ b/airflow/model_variable_collection_item.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,11 +15,14 @@ import ( "encoding/json" ) +// checks if the VariableCollectionItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VariableCollectionItem{} + // VariableCollectionItem XCom entry collection item. The value field are only available when retrieving a single object due to the sensitivity of this data. type VariableCollectionItem struct { - Key *string `json:"key,omitempty"` // The description of the variable. *New in version 2.4.0* Description NullableString `json:"description,omitempty"` + Key *string `json:"key,omitempty"` } // NewVariableCollectionItem instantiates a new VariableCollectionItem object @@ -56,41 +42,9 @@ func NewVariableCollectionItemWithDefaults() *VariableCollectionItem { return &this } -// GetKey returns the Key field value if set, zero value otherwise. -func (o *VariableCollectionItem) GetKey() string { - if o == nil || o.Key == nil { - var ret string - return ret - } - return *o.Key -} - -// GetKeyOk returns a tuple with the Key field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *VariableCollectionItem) GetKeyOk() (*string, bool) { - if o == nil || o.Key == nil { - return nil, false - } - return o.Key, true -} - -// HasKey returns a boolean if a field has been set. -func (o *VariableCollectionItem) HasKey() bool { - if o != nil && o.Key != nil { - return true - } - - return false -} - -// SetKey gets a reference to the given string and assigns it to the Key field. -func (o *VariableCollectionItem) SetKey(v string) { - o.Key = &v -} - // GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VariableCollectionItem) GetDescription() string { - if o == nil || o.Description.Get() == nil { + if o == nil || IsNil(o.Description.Get()) { var ret string return ret } @@ -101,7 +55,7 @@ func (o *VariableCollectionItem) GetDescription() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VariableCollectionItem) GetDescriptionOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.Description.Get(), o.Description.IsSet() @@ -130,15 +84,55 @@ func (o *VariableCollectionItem) UnsetDescription() { o.Description.Unset() } +// GetKey returns the Key field value if set, zero value otherwise. +func (o *VariableCollectionItem) GetKey() string { + if o == nil || IsNil(o.Key) { + var ret string + return ret + } + return *o.Key +} + +// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VariableCollectionItem) GetKeyOk() (*string, bool) { + if o == nil || IsNil(o.Key) { + return nil, false + } + return o.Key, true +} + +// HasKey returns a boolean if a field has been set. +func (o *VariableCollectionItem) HasKey() bool { + if o != nil && !IsNil(o.Key) { + return true + } + + return false +} + +// SetKey gets a reference to the given string and assigns it to the Key field. +func (o *VariableCollectionItem) SetKey(v string) { + o.Key = &v +} + func (o VariableCollectionItem) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Key != nil { - toSerialize["key"] = o.Key + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o VariableCollectionItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} if o.Description.IsSet() { toSerialize["description"] = o.Description.Get() } - return json.Marshal(toSerialize) + if !IsNil(o.Key) { + toSerialize["key"] = o.Key + } + return toSerialize, nil } type NullableVariableCollectionItem struct { diff --git a/airflow/model_version_info.go b/airflow/model_version_info.go index c7f0bbb..af50a00 100644 --- a/airflow/model_version_info.go +++ b/airflow/model_version_info.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,12 +15,15 @@ import ( "encoding/json" ) +// checks if the VersionInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VersionInfo{} + // VersionInfo Version information. type VersionInfo struct { - // The version of Airflow - Version *string `json:"version,omitempty"` // The git version (including git commit hash) GitVersion NullableString `json:"git_version,omitempty"` + // The version of Airflow + Version *string `json:"version,omitempty"` } // NewVersionInfo instantiates a new VersionInfo object @@ -57,41 +43,9 @@ func NewVersionInfoWithDefaults() *VersionInfo { return &this } -// GetVersion returns the Version field value if set, zero value otherwise. -func (o *VersionInfo) GetVersion() string { - if o == nil || o.Version == nil { - var ret string - return ret - } - return *o.Version -} - -// GetVersionOk returns a tuple with the Version field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *VersionInfo) GetVersionOk() (*string, bool) { - if o == nil || o.Version == nil { - return nil, false - } - return o.Version, true -} - -// HasVersion returns a boolean if a field has been set. -func (o *VersionInfo) HasVersion() bool { - if o != nil && o.Version != nil { - return true - } - - return false -} - -// SetVersion gets a reference to the given string and assigns it to the Version field. -func (o *VersionInfo) SetVersion(v string) { - o.Version = &v -} - // GetGitVersion returns the GitVersion field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VersionInfo) GetGitVersion() string { - if o == nil || o.GitVersion.Get() == nil { + if o == nil || IsNil(o.GitVersion.Get()) { var ret string return ret } @@ -102,7 +56,7 @@ func (o *VersionInfo) GetGitVersion() string { // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned func (o *VersionInfo) GetGitVersionOk() (*string, bool) { - if o == nil { + if o == nil { return nil, false } return o.GitVersion.Get(), o.GitVersion.IsSet() @@ -131,15 +85,55 @@ func (o *VersionInfo) UnsetGitVersion() { o.GitVersion.Unset() } +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *VersionInfo) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VersionInfo) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *VersionInfo) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *VersionInfo) SetVersion(v string) { + o.Version = &v +} + func (o VersionInfo) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Version != nil { - toSerialize["version"] = o.Version + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } + return json.Marshal(toSerialize) +} + +func (o VersionInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} if o.GitVersion.IsSet() { toSerialize["git_version"] = o.GitVersion.Get() } - return json.Marshal(toSerialize) + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + return toSerialize, nil } type NullableVersionInfo struct { diff --git a/airflow/model_weight_rule.go b/airflow/model_weight_rule.go index 7c97c8d..1ad9849 100644 --- a/airflow/model_weight_rule.go +++ b/airflow/model_weight_rule.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -38,9 +21,9 @@ type WeightRule string // List of WeightRule const ( - WEIGHTRULE_DOWNSTREAM WeightRule = "downstream" - WEIGHTRULE_UPSTREAM WeightRule = "upstream" - WEIGHTRULE_ABSOLUTE WeightRule = "absolute" + DOWNSTREAM WeightRule = "downstream" + UPSTREAM WeightRule = "upstream" + ABSOLUTE WeightRule = "absolute" ) // All allowed values of WeightRule enum diff --git a/airflow/model_x_com.go b/airflow/model_x_com.go index f62b041..af54257 100644 --- a/airflow/model_x_com.go +++ b/airflow/model_x_com.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,15 +15,19 @@ import ( "encoding/json" ) +// checks if the XCom type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &XCom{} + // XCom Full representations of XCom entry. type XCom struct { - Key *string `json:"key,omitempty"` - Timestamp *string `json:"timestamp,omitempty"` + DagId *string `json:"dag_id,omitempty"` ExecutionDate *string `json:"execution_date,omitempty"` + Key *string `json:"key,omitempty"` + MapIndex *int32 `json:"map_index,omitempty"` TaskId *string `json:"task_id,omitempty"` - DagId *string `json:"dag_id,omitempty"` - // The value - Value *string `json:"value,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` + // The value(s), + Value interface{} `json:"value,omitempty"` } // NewXCom instantiates a new XCom object @@ -60,105 +47,137 @@ func NewXComWithDefaults() *XCom { return &this } -// GetKey returns the Key field value if set, zero value otherwise. -func (o *XCom) GetKey() string { - if o == nil || o.Key == nil { +// GetDagId returns the DagId field value if set, zero value otherwise. +func (o *XCom) GetDagId() string { + if o == nil || IsNil(o.DagId) { var ret string return ret } - return *o.Key + return *o.DagId } -// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// GetDagIdOk returns a tuple with the DagId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *XCom) GetKeyOk() (*string, bool) { - if o == nil || o.Key == nil { +func (o *XCom) GetDagIdOk() (*string, bool) { + if o == nil || IsNil(o.DagId) { return nil, false } - return o.Key, true + return o.DagId, true } -// HasKey returns a boolean if a field has been set. -func (o *XCom) HasKey() bool { - if o != nil && o.Key != nil { +// HasDagId returns a boolean if a field has been set. +func (o *XCom) HasDagId() bool { + if o != nil && !IsNil(o.DagId) { return true } return false } -// SetKey gets a reference to the given string and assigns it to the Key field. -func (o *XCom) SetKey(v string) { - o.Key = &v +// SetDagId gets a reference to the given string and assigns it to the DagId field. +func (o *XCom) SetDagId(v string) { + o.DagId = &v } -// GetTimestamp returns the Timestamp field value if set, zero value otherwise. -func (o *XCom) GetTimestamp() string { - if o == nil || o.Timestamp == nil { +// GetExecutionDate returns the ExecutionDate field value if set, zero value otherwise. +func (o *XCom) GetExecutionDate() string { + if o == nil || IsNil(o.ExecutionDate) { var ret string return ret } - return *o.Timestamp + return *o.ExecutionDate } -// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// GetExecutionDateOk returns a tuple with the ExecutionDate field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *XCom) GetTimestampOk() (*string, bool) { - if o == nil || o.Timestamp == nil { +func (o *XCom) GetExecutionDateOk() (*string, bool) { + if o == nil || IsNil(o.ExecutionDate) { return nil, false } - return o.Timestamp, true + return o.ExecutionDate, true } -// HasTimestamp returns a boolean if a field has been set. -func (o *XCom) HasTimestamp() bool { - if o != nil && o.Timestamp != nil { +// HasExecutionDate returns a boolean if a field has been set. +func (o *XCom) HasExecutionDate() bool { + if o != nil && !IsNil(o.ExecutionDate) { return true } return false } -// SetTimestamp gets a reference to the given string and assigns it to the Timestamp field. -func (o *XCom) SetTimestamp(v string) { - o.Timestamp = &v +// SetExecutionDate gets a reference to the given string and assigns it to the ExecutionDate field. +func (o *XCom) SetExecutionDate(v string) { + o.ExecutionDate = &v } -// GetExecutionDate returns the ExecutionDate field value if set, zero value otherwise. -func (o *XCom) GetExecutionDate() string { - if o == nil || o.ExecutionDate == nil { +// GetKey returns the Key field value if set, zero value otherwise. +func (o *XCom) GetKey() string { + if o == nil || IsNil(o.Key) { var ret string return ret } - return *o.ExecutionDate + return *o.Key } -// GetExecutionDateOk returns a tuple with the ExecutionDate field value if set, nil otherwise +// GetKeyOk returns a tuple with the Key field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *XCom) GetExecutionDateOk() (*string, bool) { - if o == nil || o.ExecutionDate == nil { +func (o *XCom) GetKeyOk() (*string, bool) { + if o == nil || IsNil(o.Key) { return nil, false } - return o.ExecutionDate, true + return o.Key, true } -// HasExecutionDate returns a boolean if a field has been set. -func (o *XCom) HasExecutionDate() bool { - if o != nil && o.ExecutionDate != nil { +// HasKey returns a boolean if a field has been set. +func (o *XCom) HasKey() bool { + if o != nil && !IsNil(o.Key) { return true } return false } -// SetExecutionDate gets a reference to the given string and assigns it to the ExecutionDate field. -func (o *XCom) SetExecutionDate(v string) { - o.ExecutionDate = &v +// SetKey gets a reference to the given string and assigns it to the Key field. +func (o *XCom) SetKey(v string) { + o.Key = &v +} + +// GetMapIndex returns the MapIndex field value if set, zero value otherwise. +func (o *XCom) GetMapIndex() int32 { + if o == nil || IsNil(o.MapIndex) { + var ret int32 + return ret + } + return *o.MapIndex +} + +// GetMapIndexOk returns a tuple with the MapIndex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XCom) GetMapIndexOk() (*int32, bool) { + if o == nil || IsNil(o.MapIndex) { + return nil, false + } + return o.MapIndex, true +} + +// HasMapIndex returns a boolean if a field has been set. +func (o *XCom) HasMapIndex() bool { + if o != nil && !IsNil(o.MapIndex) { + return true + } + + return false +} + +// SetMapIndex gets a reference to the given int32 and assigns it to the MapIndex field. +func (o *XCom) SetMapIndex(v int32) { + o.MapIndex = &v } // GetTaskId returns the TaskId field value if set, zero value otherwise. func (o *XCom) GetTaskId() string { - if o == nil || o.TaskId == nil { + if o == nil || IsNil(o.TaskId) { var ret string return ret } @@ -168,7 +187,7 @@ func (o *XCom) GetTaskId() string { // GetTaskIdOk returns a tuple with the TaskId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XCom) GetTaskIdOk() (*string, bool) { - if o == nil || o.TaskId == nil { + if o == nil || IsNil(o.TaskId) { return nil, false } return o.TaskId, true @@ -176,7 +195,7 @@ func (o *XCom) GetTaskIdOk() (*string, bool) { // HasTaskId returns a boolean if a field has been set. func (o *XCom) HasTaskId() bool { - if o != nil && o.TaskId != nil { + if o != nil && !IsNil(o.TaskId) { return true } @@ -188,91 +207,103 @@ func (o *XCom) SetTaskId(v string) { o.TaskId = &v } -// GetDagId returns the DagId field value if set, zero value otherwise. -func (o *XCom) GetDagId() string { - if o == nil || o.DagId == nil { +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *XCom) GetTimestamp() string { + if o == nil || IsNil(o.Timestamp) { var ret string return ret } - return *o.DagId + return *o.Timestamp } -// GetDagIdOk returns a tuple with the DagId field value if set, nil otherwise +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *XCom) GetDagIdOk() (*string, bool) { - if o == nil || o.DagId == nil { +func (o *XCom) GetTimestampOk() (*string, bool) { + if o == nil || IsNil(o.Timestamp) { return nil, false } - return o.DagId, true + return o.Timestamp, true } -// HasDagId returns a boolean if a field has been set. -func (o *XCom) HasDagId() bool { - if o != nil && o.DagId != nil { +// HasTimestamp returns a boolean if a field has been set. +func (o *XCom) HasTimestamp() bool { + if o != nil && !IsNil(o.Timestamp) { return true } return false } -// SetDagId gets a reference to the given string and assigns it to the DagId field. -func (o *XCom) SetDagId(v string) { - o.DagId = &v +// SetTimestamp gets a reference to the given string and assigns it to the Timestamp field. +func (o *XCom) SetTimestamp(v string) { + o.Timestamp = &v } -// GetValue returns the Value field value if set, zero value otherwise. -func (o *XCom) GetValue() string { - if o == nil || o.Value == nil { - var ret string +// GetValue returns the Value field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *XCom) GetValue() interface{} { + if o == nil { + var ret interface{} return ret } - return *o.Value + return o.Value } // GetValueOk returns a tuple with the Value field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *XCom) GetValueOk() (*string, bool) { - if o == nil || o.Value == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *XCom) GetValueOk() (*interface{}, bool) { + if o == nil || IsNil(o.Value) { return nil, false } - return o.Value, true + return &o.Value, true } // HasValue returns a boolean if a field has been set. func (o *XCom) HasValue() bool { - if o != nil && o.Value != nil { + if o != nil && !IsNil(o.Value) { return true } return false } -// SetValue gets a reference to the given string and assigns it to the Value field. -func (o *XCom) SetValue(v string) { - o.Value = &v +// SetValue gets a reference to the given interface{} and assigns it to the Value field. +func (o *XCom) SetValue(v interface{}) { + o.Value = v } func (o XCom) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Key != nil { - toSerialize["key"] = o.Key + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.Timestamp != nil { - toSerialize["timestamp"] = o.Timestamp + return json.Marshal(toSerialize) +} + +func (o XCom) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DagId) { + toSerialize["dag_id"] = o.DagId } - if o.ExecutionDate != nil { + if !IsNil(o.ExecutionDate) { toSerialize["execution_date"] = o.ExecutionDate } - if o.TaskId != nil { + if !IsNil(o.Key) { + toSerialize["key"] = o.Key + } + if !IsNil(o.MapIndex) { + toSerialize["map_index"] = o.MapIndex + } + if !IsNil(o.TaskId) { toSerialize["task_id"] = o.TaskId } - if o.DagId != nil { - toSerialize["dag_id"] = o.DagId + if !IsNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp } if o.Value != nil { toSerialize["value"] = o.Value } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableXCom struct { diff --git a/airflow/model_x_com_collection.go b/airflow/model_x_com_collection.go index 39625d3..004378e 100644 --- a/airflow/model_x_com_collection.go +++ b/airflow/model_x_com_collection.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,11 +15,14 @@ import ( "encoding/json" ) +// checks if the XComCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &XComCollection{} + // XComCollection Collection of XCom entries. *Changed in version 2.1.0*: 'total_entries' field is added. type XComCollection struct { - XcomEntries *[]XComCollectionItem `json:"xcom_entries,omitempty"` - // Count of objects in the current result set. + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. TotalEntries *int32 `json:"total_entries,omitempty"` + XcomEntries []XComCollectionItem `json:"xcom_entries,omitempty"` } // NewXComCollection instantiates a new XComCollection object @@ -56,79 +42,87 @@ func NewXComCollectionWithDefaults() *XComCollection { return &this } -// GetXcomEntries returns the XcomEntries field value if set, zero value otherwise. -func (o *XComCollection) GetXcomEntries() []XComCollectionItem { - if o == nil || o.XcomEntries == nil { - var ret []XComCollectionItem +// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. +func (o *XComCollection) GetTotalEntries() int32 { + if o == nil || IsNil(o.TotalEntries) { + var ret int32 return ret } - return *o.XcomEntries + return *o.TotalEntries } -// GetXcomEntriesOk returns a tuple with the XcomEntries field value if set, nil otherwise +// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *XComCollection) GetXcomEntriesOk() (*[]XComCollectionItem, bool) { - if o == nil || o.XcomEntries == nil { +func (o *XComCollection) GetTotalEntriesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalEntries) { return nil, false } - return o.XcomEntries, true + return o.TotalEntries, true } -// HasXcomEntries returns a boolean if a field has been set. -func (o *XComCollection) HasXcomEntries() bool { - if o != nil && o.XcomEntries != nil { +// HasTotalEntries returns a boolean if a field has been set. +func (o *XComCollection) HasTotalEntries() bool { + if o != nil && !IsNil(o.TotalEntries) { return true } return false } -// SetXcomEntries gets a reference to the given []XComCollectionItem and assigns it to the XcomEntries field. -func (o *XComCollection) SetXcomEntries(v []XComCollectionItem) { - o.XcomEntries = &v +// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. +func (o *XComCollection) SetTotalEntries(v int32) { + o.TotalEntries = &v } -// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. -func (o *XComCollection) GetTotalEntries() int32 { - if o == nil || o.TotalEntries == nil { - var ret int32 +// GetXcomEntries returns the XcomEntries field value if set, zero value otherwise. +func (o *XComCollection) GetXcomEntries() []XComCollectionItem { + if o == nil || IsNil(o.XcomEntries) { + var ret []XComCollectionItem return ret } - return *o.TotalEntries + return o.XcomEntries } -// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise +// GetXcomEntriesOk returns a tuple with the XcomEntries field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *XComCollection) GetTotalEntriesOk() (*int32, bool) { - if o == nil || o.TotalEntries == nil { +func (o *XComCollection) GetXcomEntriesOk() ([]XComCollectionItem, bool) { + if o == nil || IsNil(o.XcomEntries) { return nil, false } - return o.TotalEntries, true + return o.XcomEntries, true } -// HasTotalEntries returns a boolean if a field has been set. -func (o *XComCollection) HasTotalEntries() bool { - if o != nil && o.TotalEntries != nil { +// HasXcomEntries returns a boolean if a field has been set. +func (o *XComCollection) HasXcomEntries() bool { + if o != nil && !IsNil(o.XcomEntries) { return true } return false } -// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. -func (o *XComCollection) SetTotalEntries(v int32) { - o.TotalEntries = &v +// SetXcomEntries gets a reference to the given []XComCollectionItem and assigns it to the XcomEntries field. +func (o *XComCollection) SetXcomEntries(v []XComCollectionItem) { + o.XcomEntries = v } func (o XComCollection) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.XcomEntries != nil { - toSerialize["xcom_entries"] = o.XcomEntries + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.TotalEntries != nil { + return json.Marshal(toSerialize) +} + +func (o XComCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalEntries) { toSerialize["total_entries"] = o.TotalEntries } - return json.Marshal(toSerialize) + if !IsNil(o.XcomEntries) { + toSerialize["xcom_entries"] = o.XcomEntries + } + return toSerialize, nil } type NullableXComCollection struct { diff --git a/airflow/model_x_com_collection_item.go b/airflow/model_x_com_collection_item.go index e8c90ff..75cfdb2 100644 --- a/airflow/model_x_com_collection_item.go +++ b/airflow/model_x_com_collection_item.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -32,13 +15,17 @@ import ( "encoding/json" ) +// checks if the XComCollectionItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &XComCollectionItem{} + // XComCollectionItem XCom entry collection item. The value field is only available when reading a single object due to the size of the value. type XComCollectionItem struct { - Key *string `json:"key,omitempty"` - Timestamp *string `json:"timestamp,omitempty"` + DagId *string `json:"dag_id,omitempty"` ExecutionDate *string `json:"execution_date,omitempty"` + Key *string `json:"key,omitempty"` + MapIndex *int32 `json:"map_index,omitempty"` TaskId *string `json:"task_id,omitempty"` - DagId *string `json:"dag_id,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` } // NewXComCollectionItem instantiates a new XComCollectionItem object @@ -58,105 +45,137 @@ func NewXComCollectionItemWithDefaults() *XComCollectionItem { return &this } -// GetKey returns the Key field value if set, zero value otherwise. -func (o *XComCollectionItem) GetKey() string { - if o == nil || o.Key == nil { +// GetDagId returns the DagId field value if set, zero value otherwise. +func (o *XComCollectionItem) GetDagId() string { + if o == nil || IsNil(o.DagId) { var ret string return ret } - return *o.Key + return *o.DagId } -// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// GetDagIdOk returns a tuple with the DagId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *XComCollectionItem) GetKeyOk() (*string, bool) { - if o == nil || o.Key == nil { +func (o *XComCollectionItem) GetDagIdOk() (*string, bool) { + if o == nil || IsNil(o.DagId) { return nil, false } - return o.Key, true + return o.DagId, true } -// HasKey returns a boolean if a field has been set. -func (o *XComCollectionItem) HasKey() bool { - if o != nil && o.Key != nil { +// HasDagId returns a boolean if a field has been set. +func (o *XComCollectionItem) HasDagId() bool { + if o != nil && !IsNil(o.DagId) { return true } return false } -// SetKey gets a reference to the given string and assigns it to the Key field. -func (o *XComCollectionItem) SetKey(v string) { - o.Key = &v +// SetDagId gets a reference to the given string and assigns it to the DagId field. +func (o *XComCollectionItem) SetDagId(v string) { + o.DagId = &v } -// GetTimestamp returns the Timestamp field value if set, zero value otherwise. -func (o *XComCollectionItem) GetTimestamp() string { - if o == nil || o.Timestamp == nil { +// GetExecutionDate returns the ExecutionDate field value if set, zero value otherwise. +func (o *XComCollectionItem) GetExecutionDate() string { + if o == nil || IsNil(o.ExecutionDate) { var ret string return ret } - return *o.Timestamp + return *o.ExecutionDate } -// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// GetExecutionDateOk returns a tuple with the ExecutionDate field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *XComCollectionItem) GetTimestampOk() (*string, bool) { - if o == nil || o.Timestamp == nil { +func (o *XComCollectionItem) GetExecutionDateOk() (*string, bool) { + if o == nil || IsNil(o.ExecutionDate) { return nil, false } - return o.Timestamp, true + return o.ExecutionDate, true } -// HasTimestamp returns a boolean if a field has been set. -func (o *XComCollectionItem) HasTimestamp() bool { - if o != nil && o.Timestamp != nil { +// HasExecutionDate returns a boolean if a field has been set. +func (o *XComCollectionItem) HasExecutionDate() bool { + if o != nil && !IsNil(o.ExecutionDate) { return true } return false } -// SetTimestamp gets a reference to the given string and assigns it to the Timestamp field. -func (o *XComCollectionItem) SetTimestamp(v string) { - o.Timestamp = &v +// SetExecutionDate gets a reference to the given string and assigns it to the ExecutionDate field. +func (o *XComCollectionItem) SetExecutionDate(v string) { + o.ExecutionDate = &v } -// GetExecutionDate returns the ExecutionDate field value if set, zero value otherwise. -func (o *XComCollectionItem) GetExecutionDate() string { - if o == nil || o.ExecutionDate == nil { +// GetKey returns the Key field value if set, zero value otherwise. +func (o *XComCollectionItem) GetKey() string { + if o == nil || IsNil(o.Key) { var ret string return ret } - return *o.ExecutionDate + return *o.Key } -// GetExecutionDateOk returns a tuple with the ExecutionDate field value if set, nil otherwise +// GetKeyOk returns a tuple with the Key field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *XComCollectionItem) GetExecutionDateOk() (*string, bool) { - if o == nil || o.ExecutionDate == nil { +func (o *XComCollectionItem) GetKeyOk() (*string, bool) { + if o == nil || IsNil(o.Key) { return nil, false } - return o.ExecutionDate, true + return o.Key, true } -// HasExecutionDate returns a boolean if a field has been set. -func (o *XComCollectionItem) HasExecutionDate() bool { - if o != nil && o.ExecutionDate != nil { +// HasKey returns a boolean if a field has been set. +func (o *XComCollectionItem) HasKey() bool { + if o != nil && !IsNil(o.Key) { return true } return false } -// SetExecutionDate gets a reference to the given string and assigns it to the ExecutionDate field. -func (o *XComCollectionItem) SetExecutionDate(v string) { - o.ExecutionDate = &v +// SetKey gets a reference to the given string and assigns it to the Key field. +func (o *XComCollectionItem) SetKey(v string) { + o.Key = &v +} + +// GetMapIndex returns the MapIndex field value if set, zero value otherwise. +func (o *XComCollectionItem) GetMapIndex() int32 { + if o == nil || IsNil(o.MapIndex) { + var ret int32 + return ret + } + return *o.MapIndex +} + +// GetMapIndexOk returns a tuple with the MapIndex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *XComCollectionItem) GetMapIndexOk() (*int32, bool) { + if o == nil || IsNil(o.MapIndex) { + return nil, false + } + return o.MapIndex, true +} + +// HasMapIndex returns a boolean if a field has been set. +func (o *XComCollectionItem) HasMapIndex() bool { + if o != nil && !IsNil(o.MapIndex) { + return true + } + + return false +} + +// SetMapIndex gets a reference to the given int32 and assigns it to the MapIndex field. +func (o *XComCollectionItem) SetMapIndex(v int32) { + o.MapIndex = &v } // GetTaskId returns the TaskId field value if set, zero value otherwise. func (o *XComCollectionItem) GetTaskId() string { - if o == nil || o.TaskId == nil { + if o == nil || IsNil(o.TaskId) { var ret string return ret } @@ -166,7 +185,7 @@ func (o *XComCollectionItem) GetTaskId() string { // GetTaskIdOk returns a tuple with the TaskId field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *XComCollectionItem) GetTaskIdOk() (*string, bool) { - if o == nil || o.TaskId == nil { + if o == nil || IsNil(o.TaskId) { return nil, false } return o.TaskId, true @@ -174,7 +193,7 @@ func (o *XComCollectionItem) GetTaskIdOk() (*string, bool) { // HasTaskId returns a boolean if a field has been set. func (o *XComCollectionItem) HasTaskId() bool { - if o != nil && o.TaskId != nil { + if o != nil && !IsNil(o.TaskId) { return true } @@ -186,56 +205,67 @@ func (o *XComCollectionItem) SetTaskId(v string) { o.TaskId = &v } -// GetDagId returns the DagId field value if set, zero value otherwise. -func (o *XComCollectionItem) GetDagId() string { - if o == nil || o.DagId == nil { +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *XComCollectionItem) GetTimestamp() string { + if o == nil || IsNil(o.Timestamp) { var ret string return ret } - return *o.DagId + return *o.Timestamp } -// GetDagIdOk returns a tuple with the DagId field value if set, nil otherwise +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *XComCollectionItem) GetDagIdOk() (*string, bool) { - if o == nil || o.DagId == nil { +func (o *XComCollectionItem) GetTimestampOk() (*string, bool) { + if o == nil || IsNil(o.Timestamp) { return nil, false } - return o.DagId, true + return o.Timestamp, true } -// HasDagId returns a boolean if a field has been set. -func (o *XComCollectionItem) HasDagId() bool { - if o != nil && o.DagId != nil { +// HasTimestamp returns a boolean if a field has been set. +func (o *XComCollectionItem) HasTimestamp() bool { + if o != nil && !IsNil(o.Timestamp) { return true } return false } -// SetDagId gets a reference to the given string and assigns it to the DagId field. -func (o *XComCollectionItem) SetDagId(v string) { - o.DagId = &v +// SetTimestamp gets a reference to the given string and assigns it to the Timestamp field. +func (o *XComCollectionItem) SetTimestamp(v string) { + o.Timestamp = &v } func (o XComCollectionItem) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Key != nil { - toSerialize["key"] = o.Key + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err } - if o.Timestamp != nil { - toSerialize["timestamp"] = o.Timestamp + return json.Marshal(toSerialize) +} + +func (o XComCollectionItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DagId) { + toSerialize["dag_id"] = o.DagId } - if o.ExecutionDate != nil { + if !IsNil(o.ExecutionDate) { toSerialize["execution_date"] = o.ExecutionDate } - if o.TaskId != nil { + if !IsNil(o.Key) { + toSerialize["key"] = o.Key + } + if !IsNil(o.MapIndex) { + toSerialize["map_index"] = o.MapIndex + } + if !IsNil(o.TaskId) { toSerialize["task_id"] = o.TaskId } - if o.DagId != nil { - toSerialize["dag_id"] = o.DagId + if !IsNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp } - return json.Marshal(toSerialize) + return toSerialize, nil } type NullableXComCollectionItem struct { diff --git a/airflow/response.go b/airflow/response.go index e5b60a5..26dbdee 100644 --- a/airflow/response.go +++ b/airflow/response.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ diff --git a/airflow/test/api_config_test.go b/airflow/test/api_config_test.go new file mode 100644 index 0000000..a1fd50f --- /dev/null +++ b/airflow/test/api_config_test.go @@ -0,0 +1,52 @@ +/* +Airflow API (Stable) + +Testing ConfigAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package airflow + +import ( + openapiclient "./airflow" + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func Test_airflow_ConfigAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test ConfigAPIService GetConfig", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ConfigAPI.GetConfig(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ConfigAPIService GetValue", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var section string + var option string + + resp, httpRes, err := apiClient.ConfigAPI.GetValue(context.Background(), section, option).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/airflow/test/api_connection_test.go b/airflow/test/api_connection_test.go new file mode 100644 index 0000000..02d897f --- /dev/null +++ b/airflow/test/api_connection_test.go @@ -0,0 +1,102 @@ +/* +Airflow API (Stable) + +Testing ConnectionAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package airflow + +import ( + openapiclient "./airflow" + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func Test_airflow_ConnectionAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test ConnectionAPIService DeleteConnection", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var connectionId string + + httpRes, err := apiClient.ConnectionAPI.DeleteConnection(context.Background(), connectionId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ConnectionAPIService GetConnection", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var connectionId string + + resp, httpRes, err := apiClient.ConnectionAPI.GetConnection(context.Background(), connectionId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ConnectionAPIService GetConnections", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ConnectionAPI.GetConnections(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ConnectionAPIService PatchConnection", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var connectionId string + + resp, httpRes, err := apiClient.ConnectionAPI.PatchConnection(context.Background(), connectionId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ConnectionAPIService PostConnection", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ConnectionAPI.PostConnection(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ConnectionAPIService TestConnection", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ConnectionAPI.TestConnection(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/airflow/test/api_dag_run_test.go b/airflow/test/api_dag_run_test.go new file mode 100644 index 0000000..58ccf01 --- /dev/null +++ b/airflow/test/api_dag_run_test.go @@ -0,0 +1,154 @@ +/* +Airflow API (Stable) + +Testing DAGRunAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package airflow + +import ( + openapiclient "./airflow" + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func Test_airflow_DAGRunAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DAGRunAPIService ClearDagRun", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + + resp, httpRes, err := apiClient.DAGRunAPI.ClearDagRun(context.Background(), dagId, dagRunId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DAGRunAPIService DeleteDagRun", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + + httpRes, err := apiClient.DAGRunAPI.DeleteDagRun(context.Background(), dagId, dagRunId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DAGRunAPIService GetDagRun", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + + resp, httpRes, err := apiClient.DAGRunAPI.GetDagRun(context.Background(), dagId, dagRunId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DAGRunAPIService GetDagRuns", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + + resp, httpRes, err := apiClient.DAGRunAPI.GetDagRuns(context.Background(), dagId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DAGRunAPIService GetDagRunsBatch", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DAGRunAPI.GetDagRunsBatch(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DAGRunAPIService GetUpstreamDatasetEvents", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + + resp, httpRes, err := apiClient.DAGRunAPI.GetUpstreamDatasetEvents(context.Background(), dagId, dagRunId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DAGRunAPIService PostDagRun", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + + resp, httpRes, err := apiClient.DAGRunAPI.PostDagRun(context.Background(), dagId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DAGRunAPIService SetDagRunNote", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + + resp, httpRes, err := apiClient.DAGRunAPI.SetDagRunNote(context.Background(), dagId, dagRunId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DAGRunAPIService UpdateDagRunState", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + + resp, httpRes, err := apiClient.DAGRunAPI.UpdateDagRunState(context.Background(), dagId, dagRunId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/airflow/test/api_dag_stats_test.go b/airflow/test/api_dag_stats_test.go new file mode 100644 index 0000000..1fe0627 --- /dev/null +++ b/airflow/test/api_dag_stats_test.go @@ -0,0 +1,37 @@ +/* +Airflow API (Stable) + +Testing DagStatsAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package airflow + +import ( + openapiclient "./airflow" + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func Test_airflow_DagStatsAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DagStatsAPIService GetDagStats", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DagStatsAPI.GetDagStats(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/airflow/test/api_dag_test.go b/airflow/test/api_dag_test.go new file mode 100644 index 0000000..03aebf2 --- /dev/null +++ b/airflow/test/api_dag_test.go @@ -0,0 +1,188 @@ +/* +Airflow API (Stable) + +Testing DAGAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package airflow + +import ( + openapiclient "./airflow" + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func Test_airflow_DAGAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DAGAPIService DeleteDag", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + + httpRes, err := apiClient.DAGAPI.DeleteDag(context.Background(), dagId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DAGAPIService GetDag", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + + resp, httpRes, err := apiClient.DAGAPI.GetDag(context.Background(), dagId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DAGAPIService GetDagDetails", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + + resp, httpRes, err := apiClient.DAGAPI.GetDagDetails(context.Background(), dagId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DAGAPIService GetDagSource", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var fileToken string + + resp, httpRes, err := apiClient.DAGAPI.GetDagSource(context.Background(), fileToken).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DAGAPIService GetDags", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DAGAPI.GetDags(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DAGAPIService GetTask", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var taskId string + + resp, httpRes, err := apiClient.DAGAPI.GetTask(context.Background(), dagId, taskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DAGAPIService GetTasks", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + + resp, httpRes, err := apiClient.DAGAPI.GetTasks(context.Background(), dagId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DAGAPIService PatchDag", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + + resp, httpRes, err := apiClient.DAGAPI.PatchDag(context.Background(), dagId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DAGAPIService PatchDags", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DAGAPI.PatchDags(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DAGAPIService PostClearTaskInstances", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + + resp, httpRes, err := apiClient.DAGAPI.PostClearTaskInstances(context.Background(), dagId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DAGAPIService PostSetTaskInstancesState", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + + resp, httpRes, err := apiClient.DAGAPI.PostSetTaskInstancesState(context.Background(), dagId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DAGAPIService ReparseDagFile", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var fileToken string + + httpRes, err := apiClient.DAGAPI.ReparseDagFile(context.Background(), fileToken).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/airflow/test/api_dag_warning_test.go b/airflow/test/api_dag_warning_test.go new file mode 100644 index 0000000..3a8f7ae --- /dev/null +++ b/airflow/test/api_dag_warning_test.go @@ -0,0 +1,37 @@ +/* +Airflow API (Stable) + +Testing DagWarningAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package airflow + +import ( + openapiclient "./airflow" + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func Test_airflow_DagWarningAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DagWarningAPIService GetDagWarnings", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DagWarningAPI.GetDagWarnings(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/airflow/test/api_dataset_test.go b/airflow/test/api_dataset_test.go new file mode 100644 index 0000000..aeb8029 --- /dev/null +++ b/airflow/test/api_dataset_test.go @@ -0,0 +1,173 @@ +/* +Airflow API (Stable) + +Testing DatasetAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package airflow + +import ( + openapiclient "./airflow" + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func Test_airflow_DatasetAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test DatasetAPIService CreateDatasetEvent", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DatasetAPI.CreateDatasetEvent(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DatasetAPIService DeleteDagDatasetQueuedEvent", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var uri string + + httpRes, err := apiClient.DatasetAPI.DeleteDagDatasetQueuedEvent(context.Background(), dagId, uri).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DatasetAPIService DeleteDagDatasetQueuedEvents", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + + httpRes, err := apiClient.DatasetAPI.DeleteDagDatasetQueuedEvents(context.Background(), dagId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DatasetAPIService DeleteDatasetQueuedEvents", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var uri string + + httpRes, err := apiClient.DatasetAPI.DeleteDatasetQueuedEvents(context.Background(), uri).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DatasetAPIService GetDagDatasetQueuedEvent", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var uri string + + resp, httpRes, err := apiClient.DatasetAPI.GetDagDatasetQueuedEvent(context.Background(), dagId, uri).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DatasetAPIService GetDagDatasetQueuedEvents", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + + resp, httpRes, err := apiClient.DatasetAPI.GetDagDatasetQueuedEvents(context.Background(), dagId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DatasetAPIService GetDataset", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var uri string + + resp, httpRes, err := apiClient.DatasetAPI.GetDataset(context.Background(), uri).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DatasetAPIService GetDatasetEvents", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DatasetAPI.GetDatasetEvents(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DatasetAPIService GetDatasetQueuedEvents", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var uri string + + resp, httpRes, err := apiClient.DatasetAPI.GetDatasetQueuedEvents(context.Background(), uri).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DatasetAPIService GetDatasets", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.DatasetAPI.GetDatasets(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test DatasetAPIService GetUpstreamDatasetEvents", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + + resp, httpRes, err := apiClient.DatasetAPI.GetUpstreamDatasetEvents(context.Background(), dagId, dagRunId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/airflow/test/api_event_log_test.go b/airflow/test/api_event_log_test.go new file mode 100644 index 0000000..f81d4e5 --- /dev/null +++ b/airflow/test/api_event_log_test.go @@ -0,0 +1,51 @@ +/* +Airflow API (Stable) + +Testing EventLogAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package airflow + +import ( + openapiclient "./airflow" + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func Test_airflow_EventLogAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test EventLogAPIService GetEventLog", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var eventLogId int32 + + resp, httpRes, err := apiClient.EventLogAPI.GetEventLog(context.Background(), eventLogId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test EventLogAPIService GetEventLogs", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.EventLogAPI.GetEventLogs(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/airflow/test/api_import_error_test.go b/airflow/test/api_import_error_test.go new file mode 100644 index 0000000..00f365a --- /dev/null +++ b/airflow/test/api_import_error_test.go @@ -0,0 +1,51 @@ +/* +Airflow API (Stable) + +Testing ImportErrorAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package airflow + +import ( + openapiclient "./airflow" + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func Test_airflow_ImportErrorAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test ImportErrorAPIService GetImportError", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var importErrorId int32 + + resp, httpRes, err := apiClient.ImportErrorAPI.GetImportError(context.Background(), importErrorId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ImportErrorAPIService GetImportErrors", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ImportErrorAPI.GetImportErrors(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/airflow/test/api_monitoring_test.go b/airflow/test/api_monitoring_test.go new file mode 100644 index 0000000..1296bf8 --- /dev/null +++ b/airflow/test/api_monitoring_test.go @@ -0,0 +1,49 @@ +/* +Airflow API (Stable) + +Testing MonitoringAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package airflow + +import ( + openapiclient "./airflow" + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func Test_airflow_MonitoringAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test MonitoringAPIService GetHealth", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.MonitoringAPI.GetHealth(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test MonitoringAPIService GetVersion", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.MonitoringAPI.GetVersion(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/airflow/test/api_permission_test.go b/airflow/test/api_permission_test.go new file mode 100644 index 0000000..9bbe534 --- /dev/null +++ b/airflow/test/api_permission_test.go @@ -0,0 +1,37 @@ +/* +Airflow API (Stable) + +Testing PermissionAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package airflow + +import ( + openapiclient "./airflow" + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func Test_airflow_PermissionAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test PermissionAPIService GetPermissions", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.PermissionAPI.GetPermissions(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/airflow/test/api_plugin_test.go b/airflow/test/api_plugin_test.go new file mode 100644 index 0000000..3f16436 --- /dev/null +++ b/airflow/test/api_plugin_test.go @@ -0,0 +1,37 @@ +/* +Airflow API (Stable) + +Testing PluginAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package airflow + +import ( + openapiclient "./airflow" + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func Test_airflow_PluginAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test PluginAPIService GetPlugins", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.PluginAPI.GetPlugins(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/airflow/test/api_pool_test.go b/airflow/test/api_pool_test.go new file mode 100644 index 0000000..0ccd03b --- /dev/null +++ b/airflow/test/api_pool_test.go @@ -0,0 +1,90 @@ +/* +Airflow API (Stable) + +Testing PoolAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package airflow + +import ( + openapiclient "./airflow" + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func Test_airflow_PoolAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test PoolAPIService DeletePool", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var poolName string + + httpRes, err := apiClient.PoolAPI.DeletePool(context.Background(), poolName).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PoolAPIService GetPool", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var poolName string + + resp, httpRes, err := apiClient.PoolAPI.GetPool(context.Background(), poolName).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PoolAPIService GetPools", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.PoolAPI.GetPools(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PoolAPIService PatchPool", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var poolName string + + resp, httpRes, err := apiClient.PoolAPI.PatchPool(context.Background(), poolName).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PoolAPIService PostPool", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.PoolAPI.PostPool(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/airflow/test/api_provider_test.go b/airflow/test/api_provider_test.go new file mode 100644 index 0000000..7cd0e14 --- /dev/null +++ b/airflow/test/api_provider_test.go @@ -0,0 +1,37 @@ +/* +Airflow API (Stable) + +Testing ProviderAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package airflow + +import ( + openapiclient "./airflow" + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func Test_airflow_ProviderAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test ProviderAPIService GetProviders", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ProviderAPI.GetProviders(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/airflow/test/api_role_test.go b/airflow/test/api_role_test.go new file mode 100644 index 0000000..cd82730 --- /dev/null +++ b/airflow/test/api_role_test.go @@ -0,0 +1,90 @@ +/* +Airflow API (Stable) + +Testing RoleAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package airflow + +import ( + openapiclient "./airflow" + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func Test_airflow_RoleAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test RoleAPIService DeleteRole", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var roleName string + + httpRes, err := apiClient.RoleAPI.DeleteRole(context.Background(), roleName).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test RoleAPIService GetRole", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var roleName string + + resp, httpRes, err := apiClient.RoleAPI.GetRole(context.Background(), roleName).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test RoleAPIService GetRoles", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.RoleAPI.GetRoles(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test RoleAPIService PatchRole", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var roleName string + + resp, httpRes, err := apiClient.RoleAPI.PatchRole(context.Background(), roleName).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test RoleAPIService PostRole", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.RoleAPI.PostRole(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/airflow/test/api_task_instance_test.go b/airflow/test/api_task_instance_test.go new file mode 100644 index 0000000..dca5aa6 --- /dev/null +++ b/airflow/test/api_task_instance_test.go @@ -0,0 +1,301 @@ +/* +Airflow API (Stable) + +Testing TaskInstanceAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package airflow + +import ( + openapiclient "./airflow" + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func Test_airflow_TaskInstanceAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test TaskInstanceAPIService GetExtraLinks", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + var taskId string + + resp, httpRes, err := apiClient.TaskInstanceAPI.GetExtraLinks(context.Background(), dagId, dagRunId, taskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TaskInstanceAPIService GetLog", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + var taskId string + var taskTryNumber int32 + + resp, httpRes, err := apiClient.TaskInstanceAPI.GetLog(context.Background(), dagId, dagRunId, taskId, taskTryNumber).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TaskInstanceAPIService GetMappedTaskInstance", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + var taskId string + var mapIndex int32 + + resp, httpRes, err := apiClient.TaskInstanceAPI.GetMappedTaskInstance(context.Background(), dagId, dagRunId, taskId, mapIndex).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TaskInstanceAPIService GetMappedTaskInstanceDependencies", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + var taskId string + var mapIndex int32 + + resp, httpRes, err := apiClient.TaskInstanceAPI.GetMappedTaskInstanceDependencies(context.Background(), dagId, dagRunId, taskId, mapIndex).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TaskInstanceAPIService GetMappedTaskInstanceTries", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + var taskId string + var mapIndex int32 + + resp, httpRes, err := apiClient.TaskInstanceAPI.GetMappedTaskInstanceTries(context.Background(), dagId, dagRunId, taskId, mapIndex).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TaskInstanceAPIService GetMappedTaskInstanceTryDetails", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + var taskId string + var mapIndex int32 + var taskTryNumber int32 + + resp, httpRes, err := apiClient.TaskInstanceAPI.GetMappedTaskInstanceTryDetails(context.Background(), dagId, dagRunId, taskId, mapIndex, taskTryNumber).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TaskInstanceAPIService GetMappedTaskInstances", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + var taskId string + + resp, httpRes, err := apiClient.TaskInstanceAPI.GetMappedTaskInstances(context.Background(), dagId, dagRunId, taskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TaskInstanceAPIService GetTaskInstance", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + var taskId string + + resp, httpRes, err := apiClient.TaskInstanceAPI.GetTaskInstance(context.Background(), dagId, dagRunId, taskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TaskInstanceAPIService GetTaskInstanceDependencies", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + var taskId string + + resp, httpRes, err := apiClient.TaskInstanceAPI.GetTaskInstanceDependencies(context.Background(), dagId, dagRunId, taskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TaskInstanceAPIService GetTaskInstanceTries", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + var taskId string + + resp, httpRes, err := apiClient.TaskInstanceAPI.GetTaskInstanceTries(context.Background(), dagId, dagRunId, taskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TaskInstanceAPIService GetTaskInstanceTryDetails", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + var taskId string + var taskTryNumber int32 + + resp, httpRes, err := apiClient.TaskInstanceAPI.GetTaskInstanceTryDetails(context.Background(), dagId, dagRunId, taskId, taskTryNumber).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TaskInstanceAPIService GetTaskInstances", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + + resp, httpRes, err := apiClient.TaskInstanceAPI.GetTaskInstances(context.Background(), dagId, dagRunId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TaskInstanceAPIService GetTaskInstancesBatch", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.TaskInstanceAPI.GetTaskInstancesBatch(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TaskInstanceAPIService PatchMappedTaskInstance", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + var taskId string + var mapIndex int32 + + resp, httpRes, err := apiClient.TaskInstanceAPI.PatchMappedTaskInstance(context.Background(), dagId, dagRunId, taskId, mapIndex).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TaskInstanceAPIService PatchTaskInstance", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + var taskId string + + resp, httpRes, err := apiClient.TaskInstanceAPI.PatchTaskInstance(context.Background(), dagId, dagRunId, taskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TaskInstanceAPIService SetMappedTaskInstanceNote", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + var taskId string + var mapIndex int32 + + resp, httpRes, err := apiClient.TaskInstanceAPI.SetMappedTaskInstanceNote(context.Background(), dagId, dagRunId, taskId, mapIndex).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test TaskInstanceAPIService SetTaskInstanceNote", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + var taskId string + + resp, httpRes, err := apiClient.TaskInstanceAPI.SetTaskInstanceNote(context.Background(), dagId, dagRunId, taskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/airflow/test/api_user_test.go b/airflow/test/api_user_test.go new file mode 100644 index 0000000..5419d2f --- /dev/null +++ b/airflow/test/api_user_test.go @@ -0,0 +1,90 @@ +/* +Airflow API (Stable) + +Testing UserAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package airflow + +import ( + openapiclient "./airflow" + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func Test_airflow_UserAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test UserAPIService DeleteUser", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var username string + + httpRes, err := apiClient.UserAPI.DeleteUser(context.Background(), username).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test UserAPIService GetUser", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var username string + + resp, httpRes, err := apiClient.UserAPI.GetUser(context.Background(), username).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test UserAPIService GetUsers", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.UserAPI.GetUsers(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test UserAPIService PatchUser", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var username string + + resp, httpRes, err := apiClient.UserAPI.PatchUser(context.Background(), username).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test UserAPIService PostUser", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.UserAPI.PostUser(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/airflow/test/api_variable_test.go b/airflow/test/api_variable_test.go new file mode 100644 index 0000000..0464f66 --- /dev/null +++ b/airflow/test/api_variable_test.go @@ -0,0 +1,90 @@ +/* +Airflow API (Stable) + +Testing VariableAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package airflow + +import ( + openapiclient "./airflow" + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func Test_airflow_VariableAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test VariableAPIService DeleteVariable", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var variableKey string + + httpRes, err := apiClient.VariableAPI.DeleteVariable(context.Background(), variableKey).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test VariableAPIService GetVariable", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var variableKey string + + resp, httpRes, err := apiClient.VariableAPI.GetVariable(context.Background(), variableKey).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test VariableAPIService GetVariables", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.VariableAPI.GetVariables(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test VariableAPIService PatchVariable", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var variableKey string + + resp, httpRes, err := apiClient.VariableAPI.PatchVariable(context.Background(), variableKey).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test VariableAPIService PostVariables", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.VariableAPI.PostVariables(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/airflow/test/api_x_com_test.go b/airflow/test/api_x_com_test.go new file mode 100644 index 0000000..8cffb31 --- /dev/null +++ b/airflow/test/api_x_com_test.go @@ -0,0 +1,58 @@ +/* +Airflow API (Stable) + +Testing XComAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package airflow + +import ( + openapiclient "./airflow" + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func Test_airflow_XComAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test XComAPIService GetXcomEntries", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + var taskId string + + resp, httpRes, err := apiClient.XComAPI.GetXcomEntries(context.Background(), dagId, dagRunId, taskId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test XComAPIService GetXcomEntry", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var dagId string + var dagRunId string + var taskId string + var xcomKey string + + resp, httpRes, err := apiClient.XComAPI.GetXcomEntry(context.Background(), dagId, dagRunId, taskId, xcomKey).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/airflow/utils.go b/airflow/utils.go index dd011df..f6caa2d 100644 --- a/airflow/utils.go +++ b/airflow/utils.go @@ -1,26 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - /* Airflow API (Stable) -# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executing via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"name\": \"string\", \"slots\": 0, \"occupied_slots\": 0, \"used_slots\": 0, \"queued_slots\": 0, \"open_slots\": 0 } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. +# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means that you must usually add the following headers to your request: ``` Content-type: application/json Accept: application/json ``` ## Resources The term `resource` refers to a single type of object in the Airflow metadata. An API is broken up by its endpoint's corresponding resource. The name of a resource is typically plural and expressed in camelCase. Example: `dagRuns`. Resource names are used as part of endpoint URLs, as well as in API parameters and responses. ## CRUD Operations The platform supports **C**reate, **R**ead, **U**pdate, and **D**elete operations on most resources. You can review the standards for these operations and their standard parameters below. Some endpoints have special behavior as exceptions. ### Create To create a resource, you typically submit an HTTP `POST` request with the resource's required metadata in the request body. The response returns a `201 Created` response code upon success with the resource's metadata, including its internal `id`, in the response body. ### Read The HTTP `GET` request can be used to read a resource or to list a number of resources. A resource's `id` can be submitted in the request parameters to read a specific resource. The response usually returns a `200 OK` response code upon success, with the resource's metadata in the response body. If a `GET` request does not include a specific resource `id`, it is treated as a list request. The response usually returns a `200 OK` response code upon success, with an object containing a list of resources' metadata in the response body. When reading resources, some common query parameters are usually available. e.g.: ``` v1/connections?limit=25&offset=25 ``` |Query Parameter|Type|Description| |---------------|----|-----------| |limit|integer|Maximum number of objects to fetch. Usually 25 by default| |offset|integer|Offset after which to start returning objects. For use with limit query parameter.| ### Update Updating a resource requires the resource `id`, and is typically done using an HTTP `PATCH` request, with the fields to modify in the request body. The response usually returns a `200 OK` response code upon success, with information about the modified resource in the response body. ### Delete Deleting a resource requires the resource `id` and is typically executed via an HTTP `DELETE` request. The response usually returns a `204 No Content` response code upon success. ## Conventions - Resource names are plural and expressed in camelCase. - Names are consistent between URL parameter name and field name. - Field names are in snake_case. ```json { \"description\": \"string\", \"name\": \"string\", \"occupied_slots\": 0, \"open_slots\": 0 \"queued_slots\": 0, \"running_slots\": 0, \"scheduled_slots\": 0, \"slots\": 0, } ``` ### Update Mask Update mask is available as a query parameter in patch endpoints. It is used to notify the API which fields you want to update. Using `update_mask` makes it easier to update objects by helping the server know which fields to update in an object instead of updating all fields. The update request ignores any fields that aren't specified in the field mask, leaving them with their current values. Example: ``` resource = request.get('/resource/my-id').json() resource['my_field'] = 'new-value' request.patch('/resource/my-id?update_mask=my_field', data=json.dumps(resource)) ``` ## Versioning and Endpoint Lifecycle - API versioning is not synchronized to specific releases of the Apache Airflow. - APIs are designed to be backward compatible. - Any changes to the API will first go through a deprecation phase. # Trying the API You can use a third party client, such as [curl](https://curl.haxx.se/), [HTTPie](https://httpie.org/), [Postman](https://www.postman.com/) or [the Insomnia rest client](https://insomnia.rest/) to test the Apache Airflow API. Note that you will need to pass credentials data. For e.g., here is how to pause a DAG with [curl](https://curl.haxx.se/), when basic authorization is used: ```bash curl -X PATCH 'https://example.com/api/v1/dags/{dag_id}?update_mask=is_paused' \\ -H 'Content-Type: application/json' \\ --user \"username:password\" \\ -d '{ \"is_paused\": true }' ``` Using a graphical tool such as [Postman](https://www.postman.com/) or [Insomnia](https://insomnia.rest/), it is possible to import the API specifications directly: 1. Download the API specification by clicking the **Download** button at the top of this document 2. Import the JSON specification in the graphical tool of your choice. - In *Postman*, you can click the **import** button at the top - With *Insomnia*, you can just drag-and-drop the file on the UI Note that with *Postman*, you can also generate code snippets by selecting a request and clicking on the **Code** button. ## Enabling CORS [Cross-origin resource sharing (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) is a browser security feature that restricts HTTP requests that are initiated from scripts running in the browser. For details on enabling/configuring CORS, see [Enabling CORS](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Authentication To be able to meet the requirements of many organizations, Airflow supports many authentication methods, and it is even possible to add your own method. If you want to check which auth backend is currently set, you can use `airflow config get-value api auth_backends` command as in the example below. ```bash $ airflow config get-value api auth_backends airflow.api.auth.backend.basic_auth ``` The default is to deny all requests. For details on configuring the authentication, see [API Authorization](https://airflow.apache.org/docs/apache-airflow/stable/security/api.html). # Errors We follow the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs. As with our normal API responses, your client must be prepared to gracefully handle additional members of the response. ## Unauthenticated This indicates that the request has not been applied because it lacks valid authentication credentials for the target resource. Please check that you have valid credentials. ## PermissionDenied This response means that the server understood the request but refuses to authorize it because it lacks sufficient rights to the resource. It happens when you do not have the necessary permission to execute the action you performed. You need to get the appropriate permissions in other to resolve this error. ## BadRequest This response means that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing). To resolve this, please ensure that your syntax is correct. ## NotFound This client error response indicates that the server cannot find the requested resource. ## MethodNotAllowed Indicates that the request method is known by the server but is not supported by the target resource. ## NotAcceptable The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request, and the server is unwilling to supply a default representation. ## AlreadyExists The request could not be completed due to a conflict with the current state of the target resource, e.g. the resource it tries to create already exists. ## Unknown This means that the server encountered an unexpected condition that prevented it from fulfilling the request. -API version: 2.5.0 +API version: 2.10.5 Contact: dev@airflow.apache.org */ @@ -29,7 +12,10 @@ Contact: dev@airflow.apache.org package airflow import ( + "bytes" "encoding/json" + "fmt" + "reflect" "time" ) @@ -337,10 +323,40 @@ func NewNullableTime(val *time.Time) *NullableTime { } func (v NullableTime) MarshalJSON() ([]byte, error) { - return v.value.MarshalJSON() + return json.Marshal(v.value) } func (v *NullableTime) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} \ No newline at end of file diff --git a/go.mod b/go.mod index fa7d57d..37fe9a3 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,36 @@ module github.com/apache/airflow-client-go -go 1.13 +go 1.21.0 + +toolchain go1.24.3 replace github.com/apache/airflow-client-go/airflow => ./airflow require ( github.com/apache/airflow-client-go/airflow v0.0.0-20200725194829-7af9875e7d4c - github.com/stretchr/testify v1.6.1 + github.com/stretchr/testify v1.10.0 ) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 // indirect + github.com/getkin/kin-openapi v0.127.0 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect + github.com/invopop/yaml v0.3.1 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect + github.com/oapi-codegen/oapi-codegen/v2 v2.4.1 // indirect + github.com/perimeterx/marshmallow v1.1.5 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/speakeasy-api/openapi-overlay v0.9.0 // indirect + github.com/vmware-labs/yaml-jsonpath v0.3.2 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/text v0.18.0 // indirect + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) + +tool github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen diff --git a/go.sum b/go.sum index d396bbd..3fb0ffe 100644 --- a/go.sum +++ b/go.sum @@ -1,371 +1,171 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dprotaso/go-yit v0.0.0-20191028211022-135eb7262960/go.mod h1:9HQzr9D/0PGwMEbC3d5AB7oi67+h4TsQqItC1GVYG58= +github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 h1:PRxIJD8XjimM5aTknUK9w6DHLDox2r2M3DI4i2pnd3w= +github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936/go.mod h1:ttYvX5qlB+mlV1okblJqcSMtR4c52UKxDiX9GRBS8+Q= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/getkin/kin-openapi v0.127.0 h1:Mghqi3Dhryf3F8vR370nN67pAERW+3a95vomb3MAREY= +github.com/getkin/kin-openapi v0.127.0/go.mod h1:OZrfXzUfGrNbsKj+xmFBx6E5c6yH3At/tAKSc2UszXM= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= +github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/invopop/yaml v0.3.1 h1:f0+ZpmhfBSS4MhG+4HYseMdJhoeeopbSKbq5Rpeelso= +github.com/invopop/yaml v0.3.1/go.mod h1:PMOp3nn4/12yEZUFfmOuNHJsZToEEOwoWsT+D81KkeA= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oapi-codegen/oapi-codegen/v2 v2.4.1 h1:ykgG34472DWey7TSjd8vIfNykXgjOgYJZoQbKfEeY/Q= +github.com/oapi-codegen/oapi-codegen/v2 v2.4.1/go.mod h1:N5+lY1tiTDV3V1BeHtOxeWXHoPVeApvsvjJqegfoaz8= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.2/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= +github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE= +github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg= +github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= +github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= +github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/speakeasy-api/openapi-overlay v0.9.0 h1:Wrz6NO02cNlLzx1fB093lBlYxSI54VRhy1aSutx0PQg= +github.com/speakeasy-api/openapi-overlay v0.9.0/go.mod h1:f5FloQrHA7MsxYg9djzMD5h6dxrHjVVByWKh7an8TRc= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/vmware-labs/yaml-jsonpath v0.3.2 h1:/5QKeCBGdsInyDCyVNLbXyilb61MXGi9NP674f9Hobk= +github.com/vmware-labs/yaml-jsonpath v0.3.2/go.mod h1:U6whw1z03QyqgWdgXxvVnQ90zN1BWz5V+51Ewf8k+rQ= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99 h1:5vD4XjIc0X5+kHZjx4UecYdjA6mJo+XXNoaW0EjU5Os= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20191026110619-0b21df46bc1d/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 4f3a3e54a799b73f537bb9c754a92f4ce141d74f Mon Sep 17 00:00:00 2001 From: Mikhail Nacharov <1246847+mnacharov@users.noreply.github.com> Date: Thu, 22 May 2025 20:46:27 +0200 Subject: [PATCH 2/3] Generate auth fab client version 1.5.0 --- airflow/auth/fab/.gitignore | 24 + airflow/auth/fab/.openapi-generator-ignore | 23 + airflow/auth/fab/.openapi-generator/FILES | 45 + airflow/auth/fab/.openapi-generator/VERSION | 1 + airflow/auth/fab/.travis.yml | 8 + airflow/auth/fab/README.md | 169 +++ airflow/auth/fab/api/openapi.yaml | 1078 +++++++++++++++++ airflow/auth/fab/api_permission.go | 170 +++ airflow/auth/fab/api_role.go | 772 ++++++++++++ airflow/auth/fab/api_user.go | 783 ++++++++++++ airflow/auth/fab/client.go | 668 ++++++++++ airflow/auth/fab/configuration.go | 219 ++++ airflow/auth/fab/docs/Action.md | 56 + airflow/auth/fab/docs/ActionCollection.md | 82 ++ airflow/auth/fab/docs/ActionResource.md | 82 ++ airflow/auth/fab/docs/CollectionInfo.md | 56 + airflow/auth/fab/docs/Error.md | 145 +++ airflow/auth/fab/docs/PermissionAPI.md | 77 ++ airflow/auth/fab/docs/Resource.md | 56 + airflow/auth/fab/docs/Role.md | 82 ++ airflow/auth/fab/docs/RoleAPI.md | 361 ++++++ airflow/auth/fab/docs/RoleCollection.md | 82 ++ airflow/auth/fab/docs/User.md | 402 ++++++ airflow/auth/fab/docs/UserAPI.md | 361 ++++++ airflow/auth/fab/docs/UserCollection.md | 82 ++ airflow/auth/fab/docs/UserCollectionItem.md | 376 ++++++ .../fab/docs/UserCollectionItemRolesInner.md | 56 + airflow/auth/fab/git_push.sh | 57 + airflow/auth/fab/go.mod | 11 + airflow/auth/fab/go.sum | 5 + airflow/auth/fab/model_action.go | 128 ++ airflow/auth/fab/model_action_collection.go | 164 +++ airflow/auth/fab/model_action_resource.go | 163 +++ airflow/auth/fab/model_collection_info.go | 128 ++ airflow/auth/fab/model_error.go | 292 +++++ airflow/auth/fab/model_resource.go | 128 ++ airflow/auth/fab/model_role.go | 164 +++ airflow/auth/fab/model_role_collection.go | 164 +++ airflow/auth/fab/model_user.go | 594 +++++++++ airflow/auth/fab/model_user_collection.go | 164 +++ .../auth/fab/model_user_collection_item.go | 558 +++++++++ .../model_user_collection_item_roles_inner.go | 127 ++ airflow/auth/fab/response.go | 48 + airflow/auth/fab/test/api_permission_test.go | 37 + airflow/auth/fab/test/api_role_test.go | 90 ++ airflow/auth/fab/test/api_user_test.go | 90 ++ airflow/auth/fab/utils.go | 362 ++++++ 47 files changed, 9790 insertions(+) create mode 100644 airflow/auth/fab/.gitignore create mode 100644 airflow/auth/fab/.openapi-generator-ignore create mode 100644 airflow/auth/fab/.openapi-generator/FILES create mode 100644 airflow/auth/fab/.openapi-generator/VERSION create mode 100644 airflow/auth/fab/.travis.yml create mode 100644 airflow/auth/fab/README.md create mode 100644 airflow/auth/fab/api/openapi.yaml create mode 100644 airflow/auth/fab/api_permission.go create mode 100644 airflow/auth/fab/api_role.go create mode 100644 airflow/auth/fab/api_user.go create mode 100644 airflow/auth/fab/client.go create mode 100644 airflow/auth/fab/configuration.go create mode 100644 airflow/auth/fab/docs/Action.md create mode 100644 airflow/auth/fab/docs/ActionCollection.md create mode 100644 airflow/auth/fab/docs/ActionResource.md create mode 100644 airflow/auth/fab/docs/CollectionInfo.md create mode 100644 airflow/auth/fab/docs/Error.md create mode 100644 airflow/auth/fab/docs/PermissionAPI.md create mode 100644 airflow/auth/fab/docs/Resource.md create mode 100644 airflow/auth/fab/docs/Role.md create mode 100644 airflow/auth/fab/docs/RoleAPI.md create mode 100644 airflow/auth/fab/docs/RoleCollection.md create mode 100644 airflow/auth/fab/docs/User.md create mode 100644 airflow/auth/fab/docs/UserAPI.md create mode 100644 airflow/auth/fab/docs/UserCollection.md create mode 100644 airflow/auth/fab/docs/UserCollectionItem.md create mode 100644 airflow/auth/fab/docs/UserCollectionItemRolesInner.md create mode 100644 airflow/auth/fab/git_push.sh create mode 100644 airflow/auth/fab/go.mod create mode 100644 airflow/auth/fab/go.sum create mode 100644 airflow/auth/fab/model_action.go create mode 100644 airflow/auth/fab/model_action_collection.go create mode 100644 airflow/auth/fab/model_action_resource.go create mode 100644 airflow/auth/fab/model_collection_info.go create mode 100644 airflow/auth/fab/model_error.go create mode 100644 airflow/auth/fab/model_resource.go create mode 100644 airflow/auth/fab/model_role.go create mode 100644 airflow/auth/fab/model_role_collection.go create mode 100644 airflow/auth/fab/model_user.go create mode 100644 airflow/auth/fab/model_user_collection.go create mode 100644 airflow/auth/fab/model_user_collection_item.go create mode 100644 airflow/auth/fab/model_user_collection_item_roles_inner.go create mode 100644 airflow/auth/fab/response.go create mode 100644 airflow/auth/fab/test/api_permission_test.go create mode 100644 airflow/auth/fab/test/api_role_test.go create mode 100644 airflow/auth/fab/test/api_user_test.go create mode 100644 airflow/auth/fab/utils.go diff --git a/airflow/auth/fab/.gitignore b/airflow/auth/fab/.gitignore new file mode 100644 index 0000000..daf913b --- /dev/null +++ b/airflow/auth/fab/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/airflow/auth/fab/.openapi-generator-ignore b/airflow/auth/fab/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/airflow/auth/fab/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/airflow/auth/fab/.openapi-generator/FILES b/airflow/auth/fab/.openapi-generator/FILES new file mode 100644 index 0000000..8c02b63 --- /dev/null +++ b/airflow/auth/fab/.openapi-generator/FILES @@ -0,0 +1,45 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +api_permission.go +api_role.go +api_user.go +client.go +configuration.go +docs/Action.md +docs/ActionCollection.md +docs/ActionResource.md +docs/CollectionInfo.md +docs/Error.md +docs/PermissionAPI.md +docs/Resource.md +docs/Role.md +docs/RoleAPI.md +docs/RoleCollection.md +docs/User.md +docs/UserAPI.md +docs/UserCollection.md +docs/UserCollectionItem.md +docs/UserCollectionItemRolesInner.md +git_push.sh +go.mod +go.sum +model_action.go +model_action_collection.go +model_action_resource.go +model_collection_info.go +model_error.go +model_resource.go +model_role.go +model_role_collection.go +model_user.go +model_user_collection.go +model_user_collection_item.go +model_user_collection_item_roles_inner.go +response.go +test/api_permission_test.go +test/api_role_test.go +test/api_user_test.go +utils.go diff --git a/airflow/auth/fab/.openapi-generator/VERSION b/airflow/auth/fab/.openapi-generator/VERSION new file mode 100644 index 0000000..eb1dc6a --- /dev/null +++ b/airflow/auth/fab/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.13.0 diff --git a/airflow/auth/fab/.travis.yml b/airflow/auth/fab/.travis.yml new file mode 100644 index 0000000..f5cb2ce --- /dev/null +++ b/airflow/auth/fab/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/airflow/auth/fab/README.md b/airflow/auth/fab/README.md new file mode 100644 index 0000000..f19b4a3 --- /dev/null +++ b/airflow/auth/fab/README.md @@ -0,0 +1,169 @@ + +# Go API client for fab + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: 1.5.3 +- Generator version: 7.13.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen +For more information, please visit [https://airflow.apache.org](https://airflow.apache.org) + +## Installation + +Install the following dependencies: + +```sh +go get github.com/stretchr/testify/assert +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```go +import fab "github.com/airflow/airflow-client-go/airflow/auth/fab" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```go +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `fab.ContextServerIndex` of type `int`. + +```go +ctx := context.WithValue(context.Background(), fab.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `fab.ContextServerVariables` of type `map[string]string`. + +```go +ctx := context.WithValue(context.Background(), fab.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identified by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `fab.ContextOperationServerIndices` and `fab.ContextOperationServerVariables` context maps. + +```go +ctx := context.WithValue(context.Background(), fab.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), fab.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to */auth/fab/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*PermissionAPI* | [**GetPermissions**](docs/PermissionAPI.md#getpermissions) | **Get** /permissions | List permissions +*RoleAPI* | [**DeleteRole**](docs/RoleAPI.md#deleterole) | **Delete** /roles/{role_name} | Delete a role +*RoleAPI* | [**GetRole**](docs/RoleAPI.md#getrole) | **Get** /roles/{role_name} | Get a role +*RoleAPI* | [**GetRoles**](docs/RoleAPI.md#getroles) | **Get** /roles | List roles +*RoleAPI* | [**PatchRole**](docs/RoleAPI.md#patchrole) | **Patch** /roles/{role_name} | Update a role +*RoleAPI* | [**PostRole**](docs/RoleAPI.md#postrole) | **Post** /roles | Create a role +*UserAPI* | [**DeleteUser**](docs/UserAPI.md#deleteuser) | **Delete** /users/{username} | Delete a user +*UserAPI* | [**GetUser**](docs/UserAPI.md#getuser) | **Get** /users/{username} | Get a user +*UserAPI* | [**GetUsers**](docs/UserAPI.md#getusers) | **Get** /users | List users +*UserAPI* | [**PatchUser**](docs/UserAPI.md#patchuser) | **Patch** /users/{username} | Update a user +*UserAPI* | [**PostUser**](docs/UserAPI.md#postuser) | **Post** /users | Create a user + + +## Documentation For Models + + - [Action](docs/Action.md) + - [ActionCollection](docs/ActionCollection.md) + - [ActionResource](docs/ActionResource.md) + - [CollectionInfo](docs/CollectionInfo.md) + - [Error](docs/Error.md) + - [Resource](docs/Resource.md) + - [Role](docs/Role.md) + - [RoleCollection](docs/RoleCollection.md) + - [User](docs/User.md) + - [UserCollection](docs/UserCollection.md) + - [UserCollectionItem](docs/UserCollectionItem.md) + - [UserCollectionItemRolesInner](docs/UserCollectionItemRolesInner.md) + + +## Documentation For Authorization + + +Authentication schemes defined for the API: +### Basic + +- **Type**: HTTP basic authentication + +Example + +```go +auth := context.WithValue(context.Background(), fab.ContextBasicAuth, fab.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + +### GoogleOpenId + +### Kerberos + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + +dev@airflow.apache.org + diff --git a/airflow/auth/fab/api/openapi.yaml b/airflow/auth/fab/api/openapi.yaml new file mode 100644 index 0000000..f5e034c --- /dev/null +++ b/airflow/auth/fab/api/openapi.yaml @@ -0,0 +1,1078 @@ +openapi: 3.0.3 +info: + contact: + email: dev@airflow.apache.org + name: Apache Software Foundation + url: https://airflow.apache.org + license: + name: Apache 2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html + title: Flask App Builder User & Role API + version: 1.0.0 +servers: +- url: /auth/fab/v1 +tags: +- name: Role +- name: Permission +- name: User +paths: + /permissions: + get: + description: | + Get a list of permissions. + + *New in version 2.8.0* + operationId: get_permissions + parameters: + - description: The numbers of items to return. + explode: true + in: query + name: limit + required: false + schema: + default: 100 + type: integer + style: form + - description: The number of items to skip before starting to collect the result + set. + explode: true + in: query + name: offset + required: false + schema: + minimum: 0 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ActionCollection' + description: Success. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + summary: List permissions + tags: + - Permission + x-openapi-router-controller: airflow.providers.fab.auth_manager.api_endpoints.role_and_permission_endpoint + /roles: + get: + description: | + Get a list of roles. + + *New in version 2.8.0* + operationId: get_roles + parameters: + - description: The numbers of items to return. + explode: true + in: query + name: limit + required: false + schema: + default: 100 + type: integer + style: form + - description: The number of items to skip before starting to collect the result + set. + explode: true + in: query + name: offset + required: false + schema: + minimum: 0 + type: integer + style: form + - description: | + The name of the field to order the results by. + Prefix a field name with `-` to reverse the sort order. + + *New in version 2.8.0* + explode: true + in: query + name: order_by + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RoleCollection' + description: Success. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + summary: List roles + tags: + - Role + x-openapi-router-controller: airflow.providers.fab.auth_manager.api_endpoints.role_and_permission_endpoint + post: + description: | + Create a new role. + + *New in version 2.8.0* + operationId: post_role + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Role' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Role' + description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + summary: Create a role + tags: + - Role + x-openapi-router-controller: airflow.providers.fab.auth_manager.api_endpoints.role_and_permission_endpoint + /roles/{role_name}: + delete: + description: | + Delete a role. + + *New in version 2.8.0* + operationId: delete_role + parameters: + - description: The role name + explode: false + in: path + name: role_name + required: true + schema: + type: string + style: simple + responses: + "204": + description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Delete a role + tags: + - Role + x-openapi-router-controller: airflow.providers.fab.auth_manager.api_endpoints.role_and_permission_endpoint + get: + description: | + Get a role. + + *New in version 2.8.0* + operationId: get_role + parameters: + - description: The role name + explode: false + in: path + name: role_name + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Role' + description: Success. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Get a role + tags: + - Role + x-openapi-router-controller: airflow.providers.fab.auth_manager.api_endpoints.role_and_permission_endpoint + patch: + description: | + Update a role. + + *New in version 2.8.0* + operationId: patch_role + parameters: + - description: The role name + explode: false + in: path + name: role_name + required: true + schema: + type: string + style: simple + - description: | + The fields to update on the resource. If absent or empty, all modifiable fields are updated. + A comma-separated list of fully qualified names of fields. + explode: false + in: query + name: update_mask + required: false + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Role' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Role' + description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Update a role + tags: + - Role + x-openapi-router-controller: airflow.providers.fab.auth_manager.api_endpoints.role_and_permission_endpoint + /users: + get: + description: | + Get a list of users. + + *New in version 2.8.0* + operationId: get_users + parameters: + - description: The numbers of items to return. + explode: true + in: query + name: limit + required: false + schema: + default: 100 + type: integer + style: form + - description: The number of items to skip before starting to collect the result + set. + explode: true + in: query + name: offset + required: false + schema: + minimum: 0 + type: integer + style: form + - description: | + The name of the field to order the results by. + Prefix a field name with `-` to reverse the sort order. + + *New in version 2.8.0* + explode: true + in: query + name: order_by + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UserCollection' + description: Success. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + summary: List users + tags: + - User + x-openapi-router-controller: airflow.providers.fab.auth_manager.api_endpoints.user_endpoint + post: + description: | + Create a new user with unique username and email. + + *New in version 2.8.0* + operationId: post_user + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: An existing resource conflicts with the request. + summary: Create a user + tags: + - User + x-openapi-router-controller: airflow.providers.fab.auth_manager.api_endpoints.user_endpoint + /users/{username}: + delete: + description: | + Delete a user with a specific username. + + *New in version 2.8.0* + operationId: delete_user + parameters: + - description: | + The username of the user. + + *New in version 2.8.0* + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "204": + description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Delete a user + tags: + - User + x-openapi-router-controller: airflow.providers.fab.auth_manager.api_endpoints.user_endpoint + get: + description: | + Get a user with a specific username. + + *New in version 2.8.0* + operationId: get_user + parameters: + - description: | + The username of the user. + + *New in version 2.8.0* + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UserCollectionItem' + description: Success. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Get a user + tags: + - User + x-openapi-router-controller: airflow.providers.fab.auth_manager.api_endpoints.user_endpoint + patch: + description: | + Update fields for a user. + + *New in version 2.8.0* + operationId: patch_user + parameters: + - description: | + The username of the user. + + *New in version 2.8.0* + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + - description: | + The fields to update on the resource. If absent or empty, all modifiable fields are updated. + A comma-separated list of fully qualified names of fields. + explode: false + in: query + name: update_mask + required: false + schema: + items: + type: string + type: array + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UserCollectionItem' + description: Success. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. + "401": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + summary: Update a user + tags: + - User + x-openapi-router-controller: airflow.providers.fab.auth_manager.api_endpoints.user_endpoint +components: + parameters: + OrderBy: + description: | + The name of the field to order the results by. + Prefix a field name with `-` to reverse the sort order. + + *New in version 2.8.0* + explode: true + in: query + name: order_by + required: false + schema: + type: string + style: form + PageLimit: + description: The numbers of items to return. + explode: true + in: query + name: limit + required: false + schema: + default: 100 + type: integer + style: form + PageOffset: + description: The number of items to skip before starting to collect the result + set. + explode: true + in: query + name: offset + required: false + schema: + minimum: 0 + type: integer + style: form + RoleName: + description: The role name + explode: false + in: path + name: role_name + required: true + schema: + type: string + style: simple + UpdateMask: + description: | + The fields to update on the resource. If absent or empty, all modifiable fields are updated. + A comma-separated list of fully qualified names of fields. + explode: false + in: query + name: update_mask + required: false + schema: + items: + type: string + type: array + style: form + Username: + description: | + The username of the user. + + *New in version 2.8.0* + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + AlreadyExists: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: An existing resource conflicts with the request. + BadRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client specified an invalid argument. + MethodNotAllowed: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Request method is known by the server but is not supported by the + target resource. + NotAcceptable: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified Accept header is not allowed. + NotFound: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: A specified resource is not found. + PermissionDenied: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Client does not have sufficient permission. + Unauthenticated: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "Request not authenticated due to missing, invalid, authentication\ + \ info." + Unknown: + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Unknown server error. + schemas: + Action: + description: | + An action Item. + + *New in version 2.8.0* + example: + name: name + properties: + name: + description: The name of the permission "action" + nullable: false + type: string + type: object + ActionCollection: + allOf: + - properties: + actions: + items: + $ref: '#/components/schemas/Action' + type: array + type: object + - $ref: '#/components/schemas/CollectionInfo' + description: | + A collection of actions. + + *New in version 2.8.0* + example: + actions: + - name: name + - name: name + total_entries: 0 + type: object + ActionResource: + description: | + The Action-Resource item. + + *New in version 2.8.0* + example: + resource: + name: name + action: + name: name + properties: + action: + $ref: '#/components/schemas/Action' + resource: + $ref: '#/components/schemas/Resource' + type: object + CollectionInfo: + description: Metadata about collection. + properties: + total_entries: + description: | + Count of total objects in the current result set before pagination parameters + (limit, offset) are applied. + type: integer + type: object + Error: + description: | + [RFC7807](https://tools.ietf.org/html/rfc7807) compliant response. + example: + instance: instance + detail: detail + title: title + type: type + status: 6.027456183070403 + properties: + detail: + description: A human-readable explanation specific to this occurrence of + the problem. + type: string + instance: + description: | + A URI reference that identifies the specific occurrence of the problem. It may or may + not yield further information if dereferenced. + type: string + status: + description: The HTTP status code generated by the API server for this occurrence + of the problem. + type: number + title: + description: "A short, human-readable summary of the problem type." + type: string + type: + description: | + A URI reference [RFC3986] that identifies the problem type. This specification + encourages that, when dereferenced, it provide human-readable documentation for + the problem type. + type: string + required: + - status + - title + - type + type: object + Resource: + description: | + A resource on which permissions are granted. + + *New in version 2.8.0* + example: + name: name + properties: + name: + description: The name of the resource + nullable: false + type: string + type: object + Role: + description: | + a role item. + + *New in version 2.8.0* + example: + name: name + actions: + - resource: + name: name + action: + name: name + - resource: + name: name + action: + name: name + properties: + actions: + items: + $ref: '#/components/schemas/ActionResource' + type: array + name: + description: | + The name of the role + minLength: 1 + type: string + type: object + RoleCollection: + allOf: + - properties: + roles: + items: + $ref: '#/components/schemas/Role' + type: array + type: object + - $ref: '#/components/schemas/CollectionInfo' + description: | + A collection of roles. + + *New in version 2.8.0* + example: + roles: + - name: name + actions: + - resource: + name: name + action: + name: name + - resource: + name: name + action: + name: name + - name: name + actions: + - resource: + name: name + action: + name: name + - resource: + name: name + action: + name: name + total_entries: 0 + type: object + User: + allOf: + - $ref: '#/components/schemas/UserCollectionItem' + - properties: + password: + type: string + writeOnly: true + type: object + description: | + A user object with sensitive data. + + *New in version 2.8.0* + example: + failed_login_count: 0 + login_count: 6 + password: password + created_on: created_on + last_login: last_login + roles: + - name: name + - name: name + active: true + last_name: last_name + first_name: first_name + changed_on: changed_on + email: email + username: username + type: object + UserCollection: + allOf: + - properties: + users: + items: + $ref: '#/components/schemas/UserCollectionItem' + type: array + type: object + - $ref: '#/components/schemas/CollectionInfo' + description: | + Collection of users. + + *New in version 2.8.0* + example: + users: + - failed_login_count: 0 + login_count: 6 + created_on: created_on + last_login: last_login + roles: + - name: name + - name: name + active: true + last_name: last_name + first_name: first_name + changed_on: changed_on + email: email + username: username + - failed_login_count: 0 + login_count: 6 + created_on: created_on + last_login: last_login + roles: + - name: name + - name: name + active: true + last_name: last_name + first_name: first_name + changed_on: changed_on + email: email + username: username + total_entries: 1 + type: object + UserCollectionItem: + description: | + A user object. + + *New in version 2.8.0* + example: + failed_login_count: 0 + login_count: 6 + created_on: created_on + last_login: last_login + roles: + - name: name + - name: name + active: true + last_name: last_name + first_name: first_name + changed_on: changed_on + email: email + username: username + properties: + active: + description: Whether the user is active + nullable: true + readOnly: true + type: boolean + changed_on: + description: The date user was changed + format: datetime + nullable: true + readOnly: true + type: string + created_on: + description: The date user was created + format: datetime + nullable: true + readOnly: true + type: string + email: + description: | + The user's email. + minLength: 1 + type: string + failed_login_count: + description: The number of times the login failed + nullable: true + readOnly: true + type: integer + first_name: + description: | + The user's first name. + type: string + last_login: + description: The last user login + format: datetime + nullable: true + readOnly: true + type: string + last_name: + description: | + The user's last name. + type: string + login_count: + description: The login count + nullable: true + readOnly: true + type: integer + roles: + description: | + User roles. + items: + $ref: '#/components/schemas/UserCollectionItem_roles_inner' + type: array + username: + description: | + The username. + minLength: 1 + type: string + type: object + UserCollectionItem_roles_inner: + example: + name: name + nullable: true + properties: + name: + type: string + type: object + securitySchemes: + Basic: + scheme: basic + type: http + GoogleOpenId: + openIdConnectUrl: https://accounts.google.com/.well-known/openid-configuration + type: openIdConnect + Kerberos: + scheme: negotiate + type: http diff --git a/airflow/auth/fab/api_permission.go b/airflow/auth/fab/api_permission.go new file mode 100644 index 0000000..c29dc02 --- /dev/null +++ b/airflow/auth/fab/api_permission.go @@ -0,0 +1,170 @@ +/* +Flask App Builder User & Role API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package fab + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// PermissionAPIService PermissionAPI service +type PermissionAPIService service + +type ApiGetPermissionsRequest struct { + ctx context.Context + ApiService *PermissionAPIService + limit *int32 + offset *int32 +} + +// The numbers of items to return. +func (r ApiGetPermissionsRequest) Limit(limit int32) ApiGetPermissionsRequest { + r.limit = &limit + return r +} + +// The number of items to skip before starting to collect the result set. +func (r ApiGetPermissionsRequest) Offset(offset int32) ApiGetPermissionsRequest { + r.offset = &offset + return r +} + +func (r ApiGetPermissionsRequest) Execute() (*ActionCollection, *http.Response, error) { + return r.ApiService.GetPermissionsExecute(r) +} + +/* +GetPermissions List permissions + +Get a list of permissions. + +*New in version 2.8.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetPermissionsRequest +*/ +func (a *PermissionAPIService) GetPermissions(ctx context.Context) ApiGetPermissionsRequest { + return ApiGetPermissionsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ActionCollection +func (a *PermissionAPIService) GetPermissionsExecute(r ApiGetPermissionsRequest) (*ActionCollection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ActionCollection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PermissionAPIService.GetPermissions") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/permissions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/airflow/auth/fab/api_role.go b/airflow/auth/fab/api_role.go new file mode 100644 index 0000000..8b0d5ca --- /dev/null +++ b/airflow/auth/fab/api_role.go @@ -0,0 +1,772 @@ +/* +Flask App Builder User & Role API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package fab + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// RoleAPIService RoleAPI service +type RoleAPIService service + +type ApiDeleteRoleRequest struct { + ctx context.Context + ApiService *RoleAPIService + roleName string +} + +func (r ApiDeleteRoleRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteRoleExecute(r) +} + +/* +DeleteRole Delete a role + +Delete a role. + +*New in version 2.8.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param roleName The role name + @return ApiDeleteRoleRequest +*/ +func (a *RoleAPIService) DeleteRole(ctx context.Context, roleName string) ApiDeleteRoleRequest { + return ApiDeleteRoleRequest{ + ApiService: a, + ctx: ctx, + roleName: roleName, + } +} + +// Execute executes the request +func (a *RoleAPIService) DeleteRoleExecute(r ApiDeleteRoleRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RoleAPIService.DeleteRole") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/roles/{role_name}" + localVarPath = strings.Replace(localVarPath, "{"+"role_name"+"}", url.PathEscape(parameterValueToString(r.roleName, "roleName")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetRoleRequest struct { + ctx context.Context + ApiService *RoleAPIService + roleName string +} + +func (r ApiGetRoleRequest) Execute() (*Role, *http.Response, error) { + return r.ApiService.GetRoleExecute(r) +} + +/* +GetRole Get a role + +Get a role. + +*New in version 2.8.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param roleName The role name + @return ApiGetRoleRequest +*/ +func (a *RoleAPIService) GetRole(ctx context.Context, roleName string) ApiGetRoleRequest { + return ApiGetRoleRequest{ + ApiService: a, + ctx: ctx, + roleName: roleName, + } +} + +// Execute executes the request +// @return Role +func (a *RoleAPIService) GetRoleExecute(r ApiGetRoleRequest) (*Role, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Role + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RoleAPIService.GetRole") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/roles/{role_name}" + localVarPath = strings.Replace(localVarPath, "{"+"role_name"+"}", url.PathEscape(parameterValueToString(r.roleName, "roleName")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetRolesRequest struct { + ctx context.Context + ApiService *RoleAPIService + limit *int32 + offset *int32 + orderBy *string +} + +// The numbers of items to return. +func (r ApiGetRolesRequest) Limit(limit int32) ApiGetRolesRequest { + r.limit = &limit + return r +} + +// The number of items to skip before starting to collect the result set. +func (r ApiGetRolesRequest) Offset(offset int32) ApiGetRolesRequest { + r.offset = &offset + return r +} + +// The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.8.0* +func (r ApiGetRolesRequest) OrderBy(orderBy string) ApiGetRolesRequest { + r.orderBy = &orderBy + return r +} + +func (r ApiGetRolesRequest) Execute() (*RoleCollection, *http.Response, error) { + return r.ApiService.GetRolesExecute(r) +} + +/* +GetRoles List roles + +Get a list of roles. + +*New in version 2.8.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetRolesRequest +*/ +func (a *RoleAPIService) GetRoles(ctx context.Context) ApiGetRolesRequest { + return ApiGetRolesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RoleCollection +func (a *RoleAPIService) GetRolesExecute(r ApiGetRolesRequest) (*RoleCollection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RoleCollection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RoleAPIService.GetRoles") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/roles" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.orderBy != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "order_by", r.orderBy, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPatchRoleRequest struct { + ctx context.Context + ApiService *RoleAPIService + roleName string + role *Role + updateMask *[]string +} + +func (r ApiPatchRoleRequest) Role(role Role) ApiPatchRoleRequest { + r.role = &role + return r +} + +// The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. +func (r ApiPatchRoleRequest) UpdateMask(updateMask []string) ApiPatchRoleRequest { + r.updateMask = &updateMask + return r +} + +func (r ApiPatchRoleRequest) Execute() (*Role, *http.Response, error) { + return r.ApiService.PatchRoleExecute(r) +} + +/* +PatchRole Update a role + +Update a role. + +*New in version 2.8.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param roleName The role name + @return ApiPatchRoleRequest +*/ +func (a *RoleAPIService) PatchRole(ctx context.Context, roleName string) ApiPatchRoleRequest { + return ApiPatchRoleRequest{ + ApiService: a, + ctx: ctx, + roleName: roleName, + } +} + +// Execute executes the request +// @return Role +func (a *RoleAPIService) PatchRoleExecute(r ApiPatchRoleRequest) (*Role, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Role + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RoleAPIService.PatchRole") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/roles/{role_name}" + localVarPath = strings.Replace(localVarPath, "{"+"role_name"+"}", url.PathEscape(parameterValueToString(r.roleName, "roleName")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.role == nil { + return localVarReturnValue, nil, reportError("role is required and must be specified") + } + + if r.updateMask != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "update_mask", r.updateMask, "form", "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.role + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPostRoleRequest struct { + ctx context.Context + ApiService *RoleAPIService + role *Role +} + +func (r ApiPostRoleRequest) Role(role Role) ApiPostRoleRequest { + r.role = &role + return r +} + +func (r ApiPostRoleRequest) Execute() (*Role, *http.Response, error) { + return r.ApiService.PostRoleExecute(r) +} + +/* +PostRole Create a role + +Create a new role. + +*New in version 2.8.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPostRoleRequest +*/ +func (a *RoleAPIService) PostRole(ctx context.Context) ApiPostRoleRequest { + return ApiPostRoleRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return Role +func (a *RoleAPIService) PostRoleExecute(r ApiPostRoleRequest) (*Role, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Role + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RoleAPIService.PostRole") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/roles" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.role == nil { + return localVarReturnValue, nil, reportError("role is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.role + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/airflow/auth/fab/api_user.go b/airflow/auth/fab/api_user.go new file mode 100644 index 0000000..412f461 --- /dev/null +++ b/airflow/auth/fab/api_user.go @@ -0,0 +1,783 @@ +/* +Flask App Builder User & Role API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package fab + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// UserAPIService UserAPI service +type UserAPIService service + +type ApiDeleteUserRequest struct { + ctx context.Context + ApiService *UserAPIService + username string +} + +func (r ApiDeleteUserRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteUserExecute(r) +} + +/* +DeleteUser Delete a user + +Delete a user with a specific username. + +*New in version 2.8.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param username The username of the user. *New in version 2.8.0* + @return ApiDeleteUserRequest +*/ +func (a *UserAPIService) DeleteUser(ctx context.Context, username string) ApiDeleteUserRequest { + return ApiDeleteUserRequest{ + ApiService: a, + ctx: ctx, + username: username, + } +} + +// Execute executes the request +func (a *UserAPIService) DeleteUserExecute(r ApiDeleteUserRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserAPIService.DeleteUser") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/users/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiGetUserRequest struct { + ctx context.Context + ApiService *UserAPIService + username string +} + +func (r ApiGetUserRequest) Execute() (*UserCollectionItem, *http.Response, error) { + return r.ApiService.GetUserExecute(r) +} + +/* +GetUser Get a user + +Get a user with a specific username. + +*New in version 2.8.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param username The username of the user. *New in version 2.8.0* + @return ApiGetUserRequest +*/ +func (a *UserAPIService) GetUser(ctx context.Context, username string) ApiGetUserRequest { + return ApiGetUserRequest{ + ApiService: a, + ctx: ctx, + username: username, + } +} + +// Execute executes the request +// @return UserCollectionItem +func (a *UserAPIService) GetUserExecute(r ApiGetUserRequest) (*UserCollectionItem, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserCollectionItem + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserAPIService.GetUser") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/users/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetUsersRequest struct { + ctx context.Context + ApiService *UserAPIService + limit *int32 + offset *int32 + orderBy *string +} + +// The numbers of items to return. +func (r ApiGetUsersRequest) Limit(limit int32) ApiGetUsersRequest { + r.limit = &limit + return r +} + +// The number of items to skip before starting to collect the result set. +func (r ApiGetUsersRequest) Offset(offset int32) ApiGetUsersRequest { + r.offset = &offset + return r +} + +// The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.8.0* +func (r ApiGetUsersRequest) OrderBy(orderBy string) ApiGetUsersRequest { + r.orderBy = &orderBy + return r +} + +func (r ApiGetUsersRequest) Execute() (*UserCollection, *http.Response, error) { + return r.ApiService.GetUsersExecute(r) +} + +/* +GetUsers List users + +Get a list of users. + +*New in version 2.8.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetUsersRequest +*/ +func (a *UserAPIService) GetUsers(ctx context.Context) ApiGetUsersRequest { + return ApiGetUsersRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return UserCollection +func (a *UserAPIService) GetUsersExecute(r ApiGetUsersRequest) (*UserCollection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserCollection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserAPIService.GetUsers") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/users" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 100 + r.limit = &defaultValue + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.orderBy != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "order_by", r.orderBy, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPatchUserRequest struct { + ctx context.Context + ApiService *UserAPIService + username string + user *User + updateMask *[]string +} + +func (r ApiPatchUserRequest) User(user User) ApiPatchUserRequest { + r.user = &user + return r +} + +// The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. +func (r ApiPatchUserRequest) UpdateMask(updateMask []string) ApiPatchUserRequest { + r.updateMask = &updateMask + return r +} + +func (r ApiPatchUserRequest) Execute() (*UserCollectionItem, *http.Response, error) { + return r.ApiService.PatchUserExecute(r) +} + +/* +PatchUser Update a user + +Update fields for a user. + +*New in version 2.8.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param username The username of the user. *New in version 2.8.0* + @return ApiPatchUserRequest +*/ +func (a *UserAPIService) PatchUser(ctx context.Context, username string) ApiPatchUserRequest { + return ApiPatchUserRequest{ + ApiService: a, + ctx: ctx, + username: username, + } +} + +// Execute executes the request +// @return UserCollectionItem +func (a *UserAPIService) PatchUserExecute(r ApiPatchUserRequest) (*UserCollectionItem, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserCollectionItem + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserAPIService.PatchUser") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/users/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.user == nil { + return localVarReturnValue, nil, reportError("user is required and must be specified") + } + + if r.updateMask != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "update_mask", r.updateMask, "form", "csv") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.user + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPostUserRequest struct { + ctx context.Context + ApiService *UserAPIService + user *User +} + +func (r ApiPostUserRequest) User(user User) ApiPostUserRequest { + r.user = &user + return r +} + +func (r ApiPostUserRequest) Execute() (*User, *http.Response, error) { + return r.ApiService.PostUserExecute(r) +} + +/* +PostUser Create a user + +Create a new user with unique username and email. + +*New in version 2.8.0* + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPostUserRequest +*/ +func (a *UserAPIService) PostUser(ctx context.Context) ApiPostUserRequest { + return ApiPostUserRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return User +func (a *UserAPIService) PostUserExecute(r ApiPostUserRequest) (*User, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *User + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserAPIService.PostUser") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/users" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.user == nil { + return localVarReturnValue, nil, reportError("user is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.user + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/airflow/auth/fab/client.go b/airflow/auth/fab/client.go new file mode 100644 index 0000000..6bbd7f3 --- /dev/null +++ b/airflow/auth/fab/client.go @@ -0,0 +1,668 @@ +/* +Flask App Builder User & Role API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package fab + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the Flask App Builder User & Role API API v1.0.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + PermissionAPI *PermissionAPIService + + RoleAPI *RoleAPIService + + UserAPI *UserAPIService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.PermissionAPI = (*PermissionAPIService)(&c.common) + c.RoleAPI = (*RoleAPIService)(&c.common) + c.UserAPI = (*UserAPIService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + // Basic HTTP Authentication + if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { + localVarRequest.SetBasicAuth(auth.UserName, auth.Password) + } + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/airflow/auth/fab/configuration.go b/airflow/auth/fab/configuration.go new file mode 100644 index 0000000..69eaee0 --- /dev/null +++ b/airflow/auth/fab/configuration.go @@ -0,0 +1,219 @@ +/* +Flask App Builder User & Role API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package fab + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextBasicAuth takes BasicAuth as authentication for the request. + ContextBasicAuth = contextKey("basic") + + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.5.3/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "/auth/fab/v1", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{ + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/airflow/auth/fab/docs/Action.md b/airflow/auth/fab/docs/Action.md new file mode 100644 index 0000000..0b22067 --- /dev/null +++ b/airflow/auth/fab/docs/Action.md @@ -0,0 +1,56 @@ +# Action + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | The name of the permission \"action\" | [optional] + +## Methods + +### NewAction + +`func NewAction() *Action` + +NewAction instantiates a new Action object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActionWithDefaults + +`func NewActionWithDefaults() *Action` + +NewActionWithDefaults instantiates a new Action object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *Action) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Action) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Action) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Action) HasName() bool` + +HasName returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/auth/fab/docs/ActionCollection.md b/airflow/auth/fab/docs/ActionCollection.md new file mode 100644 index 0000000..753ff10 --- /dev/null +++ b/airflow/auth/fab/docs/ActionCollection.md @@ -0,0 +1,82 @@ +# ActionCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] +**Actions** | Pointer to [**[]Action**](Action.md) | | [optional] + +## Methods + +### NewActionCollection + +`func NewActionCollection() *ActionCollection` + +NewActionCollection instantiates a new ActionCollection object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActionCollectionWithDefaults + +`func NewActionCollectionWithDefaults() *ActionCollection` + +NewActionCollectionWithDefaults instantiates a new ActionCollection object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotalEntries + +`func (o *ActionCollection) GetTotalEntries() int32` + +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. + +### GetTotalEntriesOk + +`func (o *ActionCollection) GetTotalEntriesOk() (*int32, bool)` + +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalEntries + +`func (o *ActionCollection) SetTotalEntries(v int32)` + +SetTotalEntries sets TotalEntries field to given value. + +### HasTotalEntries + +`func (o *ActionCollection) HasTotalEntries() bool` + +HasTotalEntries returns a boolean if a field has been set. + +### GetActions + +`func (o *ActionCollection) GetActions() []Action` + +GetActions returns the Actions field if non-nil, zero value otherwise. + +### GetActionsOk + +`func (o *ActionCollection) GetActionsOk() (*[]Action, bool)` + +GetActionsOk returns a tuple with the Actions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActions + +`func (o *ActionCollection) SetActions(v []Action)` + +SetActions sets Actions field to given value. + +### HasActions + +`func (o *ActionCollection) HasActions() bool` + +HasActions returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/auth/fab/docs/ActionResource.md b/airflow/auth/fab/docs/ActionResource.md new file mode 100644 index 0000000..f541894 --- /dev/null +++ b/airflow/auth/fab/docs/ActionResource.md @@ -0,0 +1,82 @@ +# ActionResource + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Action** | Pointer to [**Action**](Action.md) | | [optional] +**Resource** | Pointer to [**Resource**](Resource.md) | | [optional] + +## Methods + +### NewActionResource + +`func NewActionResource() *ActionResource` + +NewActionResource instantiates a new ActionResource object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewActionResourceWithDefaults + +`func NewActionResourceWithDefaults() *ActionResource` + +NewActionResourceWithDefaults instantiates a new ActionResource object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAction + +`func (o *ActionResource) GetAction() Action` + +GetAction returns the Action field if non-nil, zero value otherwise. + +### GetActionOk + +`func (o *ActionResource) GetActionOk() (*Action, bool)` + +GetActionOk returns a tuple with the Action field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAction + +`func (o *ActionResource) SetAction(v Action)` + +SetAction sets Action field to given value. + +### HasAction + +`func (o *ActionResource) HasAction() bool` + +HasAction returns a boolean if a field has been set. + +### GetResource + +`func (o *ActionResource) GetResource() Resource` + +GetResource returns the Resource field if non-nil, zero value otherwise. + +### GetResourceOk + +`func (o *ActionResource) GetResourceOk() (*Resource, bool)` + +GetResourceOk returns a tuple with the Resource field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResource + +`func (o *ActionResource) SetResource(v Resource)` + +SetResource sets Resource field to given value. + +### HasResource + +`func (o *ActionResource) HasResource() bool` + +HasResource returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/auth/fab/docs/CollectionInfo.md b/airflow/auth/fab/docs/CollectionInfo.md new file mode 100644 index 0000000..20088ca --- /dev/null +++ b/airflow/auth/fab/docs/CollectionInfo.md @@ -0,0 +1,56 @@ +# CollectionInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] + +## Methods + +### NewCollectionInfo + +`func NewCollectionInfo() *CollectionInfo` + +NewCollectionInfo instantiates a new CollectionInfo object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCollectionInfoWithDefaults + +`func NewCollectionInfoWithDefaults() *CollectionInfo` + +NewCollectionInfoWithDefaults instantiates a new CollectionInfo object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotalEntries + +`func (o *CollectionInfo) GetTotalEntries() int32` + +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. + +### GetTotalEntriesOk + +`func (o *CollectionInfo) GetTotalEntriesOk() (*int32, bool)` + +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalEntries + +`func (o *CollectionInfo) SetTotalEntries(v int32)` + +SetTotalEntries sets TotalEntries field to given value. + +### HasTotalEntries + +`func (o *CollectionInfo) HasTotalEntries() bool` + +HasTotalEntries returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/auth/fab/docs/Error.md b/airflow/auth/fab/docs/Error.md new file mode 100644 index 0000000..23f22d6 --- /dev/null +++ b/airflow/auth/fab/docs/Error.md @@ -0,0 +1,145 @@ +# Error + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Detail** | Pointer to **string** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**Instance** | Pointer to **string** | A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. | [optional] +**Status** | **float32** | The HTTP status code generated by the API server for this occurrence of the problem. | +**Title** | **string** | A short, human-readable summary of the problem type. | +**Type** | **string** | A URI reference [RFC3986] that identifies the problem type. This specification encourages that, when dereferenced, it provide human-readable documentation for the problem type. | + +## Methods + +### NewError + +`func NewError(status float32, title string, type_ string, ) *Error` + +NewError instantiates a new Error object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewErrorWithDefaults + +`func NewErrorWithDefaults() *Error` + +NewErrorWithDefaults instantiates a new Error object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDetail + +`func (o *Error) GetDetail() string` + +GetDetail returns the Detail field if non-nil, zero value otherwise. + +### GetDetailOk + +`func (o *Error) GetDetailOk() (*string, bool)` + +GetDetailOk returns a tuple with the Detail field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDetail + +`func (o *Error) SetDetail(v string)` + +SetDetail sets Detail field to given value. + +### HasDetail + +`func (o *Error) HasDetail() bool` + +HasDetail returns a boolean if a field has been set. + +### GetInstance + +`func (o *Error) GetInstance() string` + +GetInstance returns the Instance field if non-nil, zero value otherwise. + +### GetInstanceOk + +`func (o *Error) GetInstanceOk() (*string, bool)` + +GetInstanceOk returns a tuple with the Instance field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInstance + +`func (o *Error) SetInstance(v string)` + +SetInstance sets Instance field to given value. + +### HasInstance + +`func (o *Error) HasInstance() bool` + +HasInstance returns a boolean if a field has been set. + +### GetStatus + +`func (o *Error) GetStatus() float32` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *Error) GetStatusOk() (*float32, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *Error) SetStatus(v float32)` + +SetStatus sets Status field to given value. + + +### GetTitle + +`func (o *Error) GetTitle() string` + +GetTitle returns the Title field if non-nil, zero value otherwise. + +### GetTitleOk + +`func (o *Error) GetTitleOk() (*string, bool)` + +GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTitle + +`func (o *Error) SetTitle(v string)` + +SetTitle sets Title field to given value. + + +### GetType + +`func (o *Error) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *Error) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *Error) SetType(v string)` + +SetType sets Type field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/auth/fab/docs/PermissionAPI.md b/airflow/auth/fab/docs/PermissionAPI.md new file mode 100644 index 0000000..8996cc4 --- /dev/null +++ b/airflow/auth/fab/docs/PermissionAPI.md @@ -0,0 +1,77 @@ +# \PermissionAPI + +All URIs are relative to */auth/fab/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetPermissions**](PermissionAPI.md#GetPermissions) | **Get** /permissions | List permissions + + + +## GetPermissions + +> ActionCollection GetPermissions(ctx).Limit(limit).Offset(offset).Execute() + +List permissions + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./airflow/auth/fab" +) + +func main() { + limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) + offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PermissionAPI.GetPermissions(context.Background()).Limit(limit).Offset(offset).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PermissionAPI.GetPermissions``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetPermissions`: ActionCollection + fmt.Fprintf(os.Stdout, "Response from `PermissionAPI.GetPermissions`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetPermissionsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int32** | The numbers of items to return. | [default to 100] + **offset** | **int32** | The number of items to skip before starting to collect the result set. | + +### Return type + +[**ActionCollection**](ActionCollection.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[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/airflow/auth/fab/docs/Resource.md b/airflow/auth/fab/docs/Resource.md new file mode 100644 index 0000000..2e6358c --- /dev/null +++ b/airflow/auth/fab/docs/Resource.md @@ -0,0 +1,56 @@ +# Resource + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | The name of the resource | [optional] + +## Methods + +### NewResource + +`func NewResource() *Resource` + +NewResource instantiates a new Resource object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewResourceWithDefaults + +`func NewResourceWithDefaults() *Resource` + +NewResourceWithDefaults instantiates a new Resource object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *Resource) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Resource) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Resource) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Resource) HasName() bool` + +HasName returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/auth/fab/docs/Role.md b/airflow/auth/fab/docs/Role.md new file mode 100644 index 0000000..351e624 --- /dev/null +++ b/airflow/auth/fab/docs/Role.md @@ -0,0 +1,82 @@ +# Role + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Actions** | Pointer to [**[]ActionResource**](ActionResource.md) | | [optional] +**Name** | Pointer to **string** | The name of the role | [optional] + +## Methods + +### NewRole + +`func NewRole() *Role` + +NewRole instantiates a new Role object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRoleWithDefaults + +`func NewRoleWithDefaults() *Role` + +NewRoleWithDefaults instantiates a new Role object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetActions + +`func (o *Role) GetActions() []ActionResource` + +GetActions returns the Actions field if non-nil, zero value otherwise. + +### GetActionsOk + +`func (o *Role) GetActionsOk() (*[]ActionResource, bool)` + +GetActionsOk returns a tuple with the Actions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActions + +`func (o *Role) SetActions(v []ActionResource)` + +SetActions sets Actions field to given value. + +### HasActions + +`func (o *Role) HasActions() bool` + +HasActions returns a boolean if a field has been set. + +### GetName + +`func (o *Role) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Role) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Role) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Role) HasName() bool` + +HasName returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/auth/fab/docs/RoleAPI.md b/airflow/auth/fab/docs/RoleAPI.md new file mode 100644 index 0000000..3785c10 --- /dev/null +++ b/airflow/auth/fab/docs/RoleAPI.md @@ -0,0 +1,361 @@ +# \RoleAPI + +All URIs are relative to */auth/fab/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteRole**](RoleAPI.md#DeleteRole) | **Delete** /roles/{role_name} | Delete a role +[**GetRole**](RoleAPI.md#GetRole) | **Get** /roles/{role_name} | Get a role +[**GetRoles**](RoleAPI.md#GetRoles) | **Get** /roles | List roles +[**PatchRole**](RoleAPI.md#PatchRole) | **Patch** /roles/{role_name} | Update a role +[**PostRole**](RoleAPI.md#PostRole) | **Post** /roles | Create a role + + + +## DeleteRole + +> DeleteRole(ctx, roleName).Execute() + +Delete a role + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./airflow/auth/fab" +) + +func main() { + roleName := "roleName_example" // string | The role name + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.RoleAPI.DeleteRole(context.Background(), roleName).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RoleAPI.DeleteRole``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**roleName** | **string** | The role name | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteRoleRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetRole + +> Role GetRole(ctx, roleName).Execute() + +Get a role + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./airflow/auth/fab" +) + +func main() { + roleName := "roleName_example" // string | The role name + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.RoleAPI.GetRole(context.Background(), roleName).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RoleAPI.GetRole``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetRole`: Role + fmt.Fprintf(os.Stdout, "Response from `RoleAPI.GetRole`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**roleName** | **string** | The role name | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetRoleRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**Role**](Role.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetRoles + +> RoleCollection GetRoles(ctx).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() + +List roles + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./airflow/auth/fab" +) + +func main() { + limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) + offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) + orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.8.0* (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.RoleAPI.GetRoles(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RoleAPI.GetRoles``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetRoles`: RoleCollection + fmt.Fprintf(os.Stdout, "Response from `RoleAPI.GetRoles`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetRolesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int32** | The numbers of items to return. | [default to 100] + **offset** | **int32** | The number of items to skip before starting to collect the result set. | + **orderBy** | **string** | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.8.0* | + +### Return type + +[**RoleCollection**](RoleCollection.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## PatchRole + +> Role PatchRole(ctx, roleName).Role(role).UpdateMask(updateMask).Execute() + +Update a role + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./airflow/auth/fab" +) + +func main() { + roleName := "roleName_example" // string | The role name + role := *openapiclient.NewRole() // Role | + updateMask := []string{"Inner_example"} // []string | The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.RoleAPI.PatchRole(context.Background(), roleName).Role(role).UpdateMask(updateMask).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RoleAPI.PatchRole``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PatchRole`: Role + fmt.Fprintf(os.Stdout, "Response from `RoleAPI.PatchRole`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**roleName** | **string** | The role name | + +### Other Parameters + +Other parameters are passed through a pointer to a apiPatchRoleRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **role** | [**Role**](Role.md) | | + **updateMask** | **[]string** | The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. | + +### Return type + +[**Role**](Role.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## PostRole + +> Role PostRole(ctx).Role(role).Execute() + +Create a role + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./airflow/auth/fab" +) + +func main() { + role := *openapiclient.NewRole() // Role | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.RoleAPI.PostRole(context.Background()).Role(role).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RoleAPI.PostRole``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PostRole`: Role + fmt.Fprintf(os.Stdout, "Response from `RoleAPI.PostRole`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiPostRoleRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **role** | [**Role**](Role.md) | | + +### Return type + +[**Role**](Role.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[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/airflow/auth/fab/docs/RoleCollection.md b/airflow/auth/fab/docs/RoleCollection.md new file mode 100644 index 0000000..b96f0ab --- /dev/null +++ b/airflow/auth/fab/docs/RoleCollection.md @@ -0,0 +1,82 @@ +# RoleCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] +**Roles** | Pointer to [**[]Role**](Role.md) | | [optional] + +## Methods + +### NewRoleCollection + +`func NewRoleCollection() *RoleCollection` + +NewRoleCollection instantiates a new RoleCollection object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRoleCollectionWithDefaults + +`func NewRoleCollectionWithDefaults() *RoleCollection` + +NewRoleCollectionWithDefaults instantiates a new RoleCollection object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotalEntries + +`func (o *RoleCollection) GetTotalEntries() int32` + +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. + +### GetTotalEntriesOk + +`func (o *RoleCollection) GetTotalEntriesOk() (*int32, bool)` + +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalEntries + +`func (o *RoleCollection) SetTotalEntries(v int32)` + +SetTotalEntries sets TotalEntries field to given value. + +### HasTotalEntries + +`func (o *RoleCollection) HasTotalEntries() bool` + +HasTotalEntries returns a boolean if a field has been set. + +### GetRoles + +`func (o *RoleCollection) GetRoles() []Role` + +GetRoles returns the Roles field if non-nil, zero value otherwise. + +### GetRolesOk + +`func (o *RoleCollection) GetRolesOk() (*[]Role, bool)` + +GetRolesOk returns a tuple with the Roles field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRoles + +`func (o *RoleCollection) SetRoles(v []Role)` + +SetRoles sets Roles field to given value. + +### HasRoles + +`func (o *RoleCollection) HasRoles() bool` + +HasRoles returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/auth/fab/docs/User.md b/airflow/auth/fab/docs/User.md new file mode 100644 index 0000000..70ef757 --- /dev/null +++ b/airflow/auth/fab/docs/User.md @@ -0,0 +1,402 @@ +# User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Active** | Pointer to **NullableBool** | Whether the user is active | [optional] [readonly] +**ChangedOn** | Pointer to **NullableString** | The date user was changed | [optional] [readonly] +**CreatedOn** | Pointer to **NullableString** | The date user was created | [optional] [readonly] +**Email** | Pointer to **string** | The user's email. | [optional] +**FailedLoginCount** | Pointer to **NullableInt32** | The number of times the login failed | [optional] [readonly] +**FirstName** | Pointer to **string** | The user's first name. | [optional] +**LastLogin** | Pointer to **NullableString** | The last user login | [optional] [readonly] +**LastName** | Pointer to **string** | The user's last name. | [optional] +**LoginCount** | Pointer to **NullableInt32** | The login count | [optional] [readonly] +**Roles** | Pointer to [**[]UserCollectionItemRolesInner**](UserCollectionItemRolesInner.md) | User roles. | [optional] +**Username** | Pointer to **string** | The username. | [optional] +**Password** | Pointer to **string** | | [optional] + +## Methods + +### NewUser + +`func NewUser() *User` + +NewUser instantiates a new User object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserWithDefaults + +`func NewUserWithDefaults() *User` + +NewUserWithDefaults instantiates a new User object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetActive + +`func (o *User) GetActive() bool` + +GetActive returns the Active field if non-nil, zero value otherwise. + +### GetActiveOk + +`func (o *User) GetActiveOk() (*bool, bool)` + +GetActiveOk returns a tuple with the Active field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActive + +`func (o *User) SetActive(v bool)` + +SetActive sets Active field to given value. + +### HasActive + +`func (o *User) HasActive() bool` + +HasActive returns a boolean if a field has been set. + +### SetActiveNil + +`func (o *User) SetActiveNil(b bool)` + + SetActiveNil sets the value for Active to be an explicit nil + +### UnsetActive +`func (o *User) UnsetActive()` + +UnsetActive ensures that no value is present for Active, not even an explicit nil +### GetChangedOn + +`func (o *User) GetChangedOn() string` + +GetChangedOn returns the ChangedOn field if non-nil, zero value otherwise. + +### GetChangedOnOk + +`func (o *User) GetChangedOnOk() (*string, bool)` + +GetChangedOnOk returns a tuple with the ChangedOn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChangedOn + +`func (o *User) SetChangedOn(v string)` + +SetChangedOn sets ChangedOn field to given value. + +### HasChangedOn + +`func (o *User) HasChangedOn() bool` + +HasChangedOn returns a boolean if a field has been set. + +### SetChangedOnNil + +`func (o *User) SetChangedOnNil(b bool)` + + SetChangedOnNil sets the value for ChangedOn to be an explicit nil + +### UnsetChangedOn +`func (o *User) UnsetChangedOn()` + +UnsetChangedOn ensures that no value is present for ChangedOn, not even an explicit nil +### GetCreatedOn + +`func (o *User) GetCreatedOn() string` + +GetCreatedOn returns the CreatedOn field if non-nil, zero value otherwise. + +### GetCreatedOnOk + +`func (o *User) GetCreatedOnOk() (*string, bool)` + +GetCreatedOnOk returns a tuple with the CreatedOn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedOn + +`func (o *User) SetCreatedOn(v string)` + +SetCreatedOn sets CreatedOn field to given value. + +### HasCreatedOn + +`func (o *User) HasCreatedOn() bool` + +HasCreatedOn returns a boolean if a field has been set. + +### SetCreatedOnNil + +`func (o *User) SetCreatedOnNil(b bool)` + + SetCreatedOnNil sets the value for CreatedOn to be an explicit nil + +### UnsetCreatedOn +`func (o *User) UnsetCreatedOn()` + +UnsetCreatedOn ensures that no value is present for CreatedOn, not even an explicit nil +### GetEmail + +`func (o *User) GetEmail() string` + +GetEmail returns the Email field if non-nil, zero value otherwise. + +### GetEmailOk + +`func (o *User) GetEmailOk() (*string, bool)` + +GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmail + +`func (o *User) SetEmail(v string)` + +SetEmail sets Email field to given value. + +### HasEmail + +`func (o *User) HasEmail() bool` + +HasEmail returns a boolean if a field has been set. + +### GetFailedLoginCount + +`func (o *User) GetFailedLoginCount() int32` + +GetFailedLoginCount returns the FailedLoginCount field if non-nil, zero value otherwise. + +### GetFailedLoginCountOk + +`func (o *User) GetFailedLoginCountOk() (*int32, bool)` + +GetFailedLoginCountOk returns a tuple with the FailedLoginCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailedLoginCount + +`func (o *User) SetFailedLoginCount(v int32)` + +SetFailedLoginCount sets FailedLoginCount field to given value. + +### HasFailedLoginCount + +`func (o *User) HasFailedLoginCount() bool` + +HasFailedLoginCount returns a boolean if a field has been set. + +### SetFailedLoginCountNil + +`func (o *User) SetFailedLoginCountNil(b bool)` + + SetFailedLoginCountNil sets the value for FailedLoginCount to be an explicit nil + +### UnsetFailedLoginCount +`func (o *User) UnsetFailedLoginCount()` + +UnsetFailedLoginCount ensures that no value is present for FailedLoginCount, not even an explicit nil +### GetFirstName + +`func (o *User) GetFirstName() string` + +GetFirstName returns the FirstName field if non-nil, zero value otherwise. + +### GetFirstNameOk + +`func (o *User) GetFirstNameOk() (*string, bool)` + +GetFirstNameOk returns a tuple with the FirstName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirstName + +`func (o *User) SetFirstName(v string)` + +SetFirstName sets FirstName field to given value. + +### HasFirstName + +`func (o *User) HasFirstName() bool` + +HasFirstName returns a boolean if a field has been set. + +### GetLastLogin + +`func (o *User) GetLastLogin() string` + +GetLastLogin returns the LastLogin field if non-nil, zero value otherwise. + +### GetLastLoginOk + +`func (o *User) GetLastLoginOk() (*string, bool)` + +GetLastLoginOk returns a tuple with the LastLogin field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastLogin + +`func (o *User) SetLastLogin(v string)` + +SetLastLogin sets LastLogin field to given value. + +### HasLastLogin + +`func (o *User) HasLastLogin() bool` + +HasLastLogin returns a boolean if a field has been set. + +### SetLastLoginNil + +`func (o *User) SetLastLoginNil(b bool)` + + SetLastLoginNil sets the value for LastLogin to be an explicit nil + +### UnsetLastLogin +`func (o *User) UnsetLastLogin()` + +UnsetLastLogin ensures that no value is present for LastLogin, not even an explicit nil +### GetLastName + +`func (o *User) GetLastName() string` + +GetLastName returns the LastName field if non-nil, zero value otherwise. + +### GetLastNameOk + +`func (o *User) GetLastNameOk() (*string, bool)` + +GetLastNameOk returns a tuple with the LastName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastName + +`func (o *User) SetLastName(v string)` + +SetLastName sets LastName field to given value. + +### HasLastName + +`func (o *User) HasLastName() bool` + +HasLastName returns a boolean if a field has been set. + +### GetLoginCount + +`func (o *User) GetLoginCount() int32` + +GetLoginCount returns the LoginCount field if non-nil, zero value otherwise. + +### GetLoginCountOk + +`func (o *User) GetLoginCountOk() (*int32, bool)` + +GetLoginCountOk returns a tuple with the LoginCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLoginCount + +`func (o *User) SetLoginCount(v int32)` + +SetLoginCount sets LoginCount field to given value. + +### HasLoginCount + +`func (o *User) HasLoginCount() bool` + +HasLoginCount returns a boolean if a field has been set. + +### SetLoginCountNil + +`func (o *User) SetLoginCountNil(b bool)` + + SetLoginCountNil sets the value for LoginCount to be an explicit nil + +### UnsetLoginCount +`func (o *User) UnsetLoginCount()` + +UnsetLoginCount ensures that no value is present for LoginCount, not even an explicit nil +### GetRoles + +`func (o *User) GetRoles() []UserCollectionItemRolesInner` + +GetRoles returns the Roles field if non-nil, zero value otherwise. + +### GetRolesOk + +`func (o *User) GetRolesOk() (*[]UserCollectionItemRolesInner, bool)` + +GetRolesOk returns a tuple with the Roles field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRoles + +`func (o *User) SetRoles(v []UserCollectionItemRolesInner)` + +SetRoles sets Roles field to given value. + +### HasRoles + +`func (o *User) HasRoles() bool` + +HasRoles returns a boolean if a field has been set. + +### GetUsername + +`func (o *User) GetUsername() string` + +GetUsername returns the Username field if non-nil, zero value otherwise. + +### GetUsernameOk + +`func (o *User) GetUsernameOk() (*string, bool)` + +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsername + +`func (o *User) SetUsername(v string)` + +SetUsername sets Username field to given value. + +### HasUsername + +`func (o *User) HasUsername() bool` + +HasUsername returns a boolean if a field has been set. + +### GetPassword + +`func (o *User) GetPassword() string` + +GetPassword returns the Password field if non-nil, zero value otherwise. + +### GetPasswordOk + +`func (o *User) GetPasswordOk() (*string, bool)` + +GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPassword + +`func (o *User) SetPassword(v string)` + +SetPassword sets Password field to given value. + +### HasPassword + +`func (o *User) HasPassword() bool` + +HasPassword returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/auth/fab/docs/UserAPI.md b/airflow/auth/fab/docs/UserAPI.md new file mode 100644 index 0000000..6d982c6 --- /dev/null +++ b/airflow/auth/fab/docs/UserAPI.md @@ -0,0 +1,361 @@ +# \UserAPI + +All URIs are relative to */auth/fab/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteUser**](UserAPI.md#DeleteUser) | **Delete** /users/{username} | Delete a user +[**GetUser**](UserAPI.md#GetUser) | **Get** /users/{username} | Get a user +[**GetUsers**](UserAPI.md#GetUsers) | **Get** /users | List users +[**PatchUser**](UserAPI.md#PatchUser) | **Patch** /users/{username} | Update a user +[**PostUser**](UserAPI.md#PostUser) | **Post** /users | Create a user + + + +## DeleteUser + +> DeleteUser(ctx, username).Execute() + +Delete a user + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./airflow/auth/fab" +) + +func main() { + username := "username_example" // string | The username of the user. *New in version 2.8.0* + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.UserAPI.DeleteUser(context.Background(), username).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.DeleteUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**username** | **string** | The username of the user. *New in version 2.8.0* | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteUserRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetUser + +> UserCollectionItem GetUser(ctx, username).Execute() + +Get a user + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./airflow/auth/fab" +) + +func main() { + username := "username_example" // string | The username of the user. *New in version 2.8.0* + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserAPI.GetUser(context.Background(), username).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.GetUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetUser`: UserCollectionItem + fmt.Fprintf(os.Stdout, "Response from `UserAPI.GetUser`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**username** | **string** | The username of the user. *New in version 2.8.0* | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetUserRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**UserCollectionItem**](UserCollectionItem.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetUsers + +> UserCollection GetUsers(ctx).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() + +List users + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./airflow/auth/fab" +) + +func main() { + limit := int32(56) // int32 | The numbers of items to return. (optional) (default to 100) + offset := int32(56) // int32 | The number of items to skip before starting to collect the result set. (optional) + orderBy := "orderBy_example" // string | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.8.0* (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserAPI.GetUsers(context.Background()).Limit(limit).Offset(offset).OrderBy(orderBy).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.GetUsers``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetUsers`: UserCollection + fmt.Fprintf(os.Stdout, "Response from `UserAPI.GetUsers`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetUsersRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int32** | The numbers of items to return. | [default to 100] + **offset** | **int32** | The number of items to skip before starting to collect the result set. | + **orderBy** | **string** | The name of the field to order the results by. Prefix a field name with `-` to reverse the sort order. *New in version 2.8.0* | + +### Return type + +[**UserCollection**](UserCollection.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## PatchUser + +> UserCollectionItem PatchUser(ctx, username).User(user).UpdateMask(updateMask).Execute() + +Update a user + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./airflow/auth/fab" +) + +func main() { + username := "username_example" // string | The username of the user. *New in version 2.8.0* + user := *openapiclient.NewUser() // User | + updateMask := []string{"Inner_example"} // []string | The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserAPI.PatchUser(context.Background(), username).User(user).UpdateMask(updateMask).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.PatchUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PatchUser`: UserCollectionItem + fmt.Fprintf(os.Stdout, "Response from `UserAPI.PatchUser`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**username** | **string** | The username of the user. *New in version 2.8.0* | + +### Other Parameters + +Other parameters are passed through a pointer to a apiPatchUserRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **user** | [**User**](User.md) | | + **updateMask** | **[]string** | The fields to update on the resource. If absent or empty, all modifiable fields are updated. A comma-separated list of fully qualified names of fields. | + +### Return type + +[**UserCollectionItem**](UserCollectionItem.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## PostUser + +> User PostUser(ctx).User(user).Execute() + +Create a user + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./airflow/auth/fab" +) + +func main() { + user := *openapiclient.NewUser() // User | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserAPI.PostUser(context.Background()).User(user).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.PostUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PostUser`: User + fmt.Fprintf(os.Stdout, "Response from `UserAPI.PostUser`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiPostUserRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**User**](User.md) | | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[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/airflow/auth/fab/docs/UserCollection.md b/airflow/auth/fab/docs/UserCollection.md new file mode 100644 index 0000000..bb868e3 --- /dev/null +++ b/airflow/auth/fab/docs/UserCollection.md @@ -0,0 +1,82 @@ +# UserCollection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TotalEntries** | Pointer to **int32** | Count of total objects in the current result set before pagination parameters (limit, offset) are applied. | [optional] +**Users** | Pointer to [**[]UserCollectionItem**](UserCollectionItem.md) | | [optional] + +## Methods + +### NewUserCollection + +`func NewUserCollection() *UserCollection` + +NewUserCollection instantiates a new UserCollection object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserCollectionWithDefaults + +`func NewUserCollectionWithDefaults() *UserCollection` + +NewUserCollectionWithDefaults instantiates a new UserCollection object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotalEntries + +`func (o *UserCollection) GetTotalEntries() int32` + +GetTotalEntries returns the TotalEntries field if non-nil, zero value otherwise. + +### GetTotalEntriesOk + +`func (o *UserCollection) GetTotalEntriesOk() (*int32, bool)` + +GetTotalEntriesOk returns a tuple with the TotalEntries field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalEntries + +`func (o *UserCollection) SetTotalEntries(v int32)` + +SetTotalEntries sets TotalEntries field to given value. + +### HasTotalEntries + +`func (o *UserCollection) HasTotalEntries() bool` + +HasTotalEntries returns a boolean if a field has been set. + +### GetUsers + +`func (o *UserCollection) GetUsers() []UserCollectionItem` + +GetUsers returns the Users field if non-nil, zero value otherwise. + +### GetUsersOk + +`func (o *UserCollection) GetUsersOk() (*[]UserCollectionItem, bool)` + +GetUsersOk returns a tuple with the Users field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsers + +`func (o *UserCollection) SetUsers(v []UserCollectionItem)` + +SetUsers sets Users field to given value. + +### HasUsers + +`func (o *UserCollection) HasUsers() bool` + +HasUsers returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/auth/fab/docs/UserCollectionItem.md b/airflow/auth/fab/docs/UserCollectionItem.md new file mode 100644 index 0000000..52e0d71 --- /dev/null +++ b/airflow/auth/fab/docs/UserCollectionItem.md @@ -0,0 +1,376 @@ +# UserCollectionItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Active** | Pointer to **NullableBool** | Whether the user is active | [optional] [readonly] +**ChangedOn** | Pointer to **NullableString** | The date user was changed | [optional] [readonly] +**CreatedOn** | Pointer to **NullableString** | The date user was created | [optional] [readonly] +**Email** | Pointer to **string** | The user's email. | [optional] +**FailedLoginCount** | Pointer to **NullableInt32** | The number of times the login failed | [optional] [readonly] +**FirstName** | Pointer to **string** | The user's first name. | [optional] +**LastLogin** | Pointer to **NullableString** | The last user login | [optional] [readonly] +**LastName** | Pointer to **string** | The user's last name. | [optional] +**LoginCount** | Pointer to **NullableInt32** | The login count | [optional] [readonly] +**Roles** | Pointer to [**[]UserCollectionItemRolesInner**](UserCollectionItemRolesInner.md) | User roles. | [optional] +**Username** | Pointer to **string** | The username. | [optional] + +## Methods + +### NewUserCollectionItem + +`func NewUserCollectionItem() *UserCollectionItem` + +NewUserCollectionItem instantiates a new UserCollectionItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserCollectionItemWithDefaults + +`func NewUserCollectionItemWithDefaults() *UserCollectionItem` + +NewUserCollectionItemWithDefaults instantiates a new UserCollectionItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetActive + +`func (o *UserCollectionItem) GetActive() bool` + +GetActive returns the Active field if non-nil, zero value otherwise. + +### GetActiveOk + +`func (o *UserCollectionItem) GetActiveOk() (*bool, bool)` + +GetActiveOk returns a tuple with the Active field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetActive + +`func (o *UserCollectionItem) SetActive(v bool)` + +SetActive sets Active field to given value. + +### HasActive + +`func (o *UserCollectionItem) HasActive() bool` + +HasActive returns a boolean if a field has been set. + +### SetActiveNil + +`func (o *UserCollectionItem) SetActiveNil(b bool)` + + SetActiveNil sets the value for Active to be an explicit nil + +### UnsetActive +`func (o *UserCollectionItem) UnsetActive()` + +UnsetActive ensures that no value is present for Active, not even an explicit nil +### GetChangedOn + +`func (o *UserCollectionItem) GetChangedOn() string` + +GetChangedOn returns the ChangedOn field if non-nil, zero value otherwise. + +### GetChangedOnOk + +`func (o *UserCollectionItem) GetChangedOnOk() (*string, bool)` + +GetChangedOnOk returns a tuple with the ChangedOn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChangedOn + +`func (o *UserCollectionItem) SetChangedOn(v string)` + +SetChangedOn sets ChangedOn field to given value. + +### HasChangedOn + +`func (o *UserCollectionItem) HasChangedOn() bool` + +HasChangedOn returns a boolean if a field has been set. + +### SetChangedOnNil + +`func (o *UserCollectionItem) SetChangedOnNil(b bool)` + + SetChangedOnNil sets the value for ChangedOn to be an explicit nil + +### UnsetChangedOn +`func (o *UserCollectionItem) UnsetChangedOn()` + +UnsetChangedOn ensures that no value is present for ChangedOn, not even an explicit nil +### GetCreatedOn + +`func (o *UserCollectionItem) GetCreatedOn() string` + +GetCreatedOn returns the CreatedOn field if non-nil, zero value otherwise. + +### GetCreatedOnOk + +`func (o *UserCollectionItem) GetCreatedOnOk() (*string, bool)` + +GetCreatedOnOk returns a tuple with the CreatedOn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedOn + +`func (o *UserCollectionItem) SetCreatedOn(v string)` + +SetCreatedOn sets CreatedOn field to given value. + +### HasCreatedOn + +`func (o *UserCollectionItem) HasCreatedOn() bool` + +HasCreatedOn returns a boolean if a field has been set. + +### SetCreatedOnNil + +`func (o *UserCollectionItem) SetCreatedOnNil(b bool)` + + SetCreatedOnNil sets the value for CreatedOn to be an explicit nil + +### UnsetCreatedOn +`func (o *UserCollectionItem) UnsetCreatedOn()` + +UnsetCreatedOn ensures that no value is present for CreatedOn, not even an explicit nil +### GetEmail + +`func (o *UserCollectionItem) GetEmail() string` + +GetEmail returns the Email field if non-nil, zero value otherwise. + +### GetEmailOk + +`func (o *UserCollectionItem) GetEmailOk() (*string, bool)` + +GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmail + +`func (o *UserCollectionItem) SetEmail(v string)` + +SetEmail sets Email field to given value. + +### HasEmail + +`func (o *UserCollectionItem) HasEmail() bool` + +HasEmail returns a boolean if a field has been set. + +### GetFailedLoginCount + +`func (o *UserCollectionItem) GetFailedLoginCount() int32` + +GetFailedLoginCount returns the FailedLoginCount field if non-nil, zero value otherwise. + +### GetFailedLoginCountOk + +`func (o *UserCollectionItem) GetFailedLoginCountOk() (*int32, bool)` + +GetFailedLoginCountOk returns a tuple with the FailedLoginCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFailedLoginCount + +`func (o *UserCollectionItem) SetFailedLoginCount(v int32)` + +SetFailedLoginCount sets FailedLoginCount field to given value. + +### HasFailedLoginCount + +`func (o *UserCollectionItem) HasFailedLoginCount() bool` + +HasFailedLoginCount returns a boolean if a field has been set. + +### SetFailedLoginCountNil + +`func (o *UserCollectionItem) SetFailedLoginCountNil(b bool)` + + SetFailedLoginCountNil sets the value for FailedLoginCount to be an explicit nil + +### UnsetFailedLoginCount +`func (o *UserCollectionItem) UnsetFailedLoginCount()` + +UnsetFailedLoginCount ensures that no value is present for FailedLoginCount, not even an explicit nil +### GetFirstName + +`func (o *UserCollectionItem) GetFirstName() string` + +GetFirstName returns the FirstName field if non-nil, zero value otherwise. + +### GetFirstNameOk + +`func (o *UserCollectionItem) GetFirstNameOk() (*string, bool)` + +GetFirstNameOk returns a tuple with the FirstName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirstName + +`func (o *UserCollectionItem) SetFirstName(v string)` + +SetFirstName sets FirstName field to given value. + +### HasFirstName + +`func (o *UserCollectionItem) HasFirstName() bool` + +HasFirstName returns a boolean if a field has been set. + +### GetLastLogin + +`func (o *UserCollectionItem) GetLastLogin() string` + +GetLastLogin returns the LastLogin field if non-nil, zero value otherwise. + +### GetLastLoginOk + +`func (o *UserCollectionItem) GetLastLoginOk() (*string, bool)` + +GetLastLoginOk returns a tuple with the LastLogin field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastLogin + +`func (o *UserCollectionItem) SetLastLogin(v string)` + +SetLastLogin sets LastLogin field to given value. + +### HasLastLogin + +`func (o *UserCollectionItem) HasLastLogin() bool` + +HasLastLogin returns a boolean if a field has been set. + +### SetLastLoginNil + +`func (o *UserCollectionItem) SetLastLoginNil(b bool)` + + SetLastLoginNil sets the value for LastLogin to be an explicit nil + +### UnsetLastLogin +`func (o *UserCollectionItem) UnsetLastLogin()` + +UnsetLastLogin ensures that no value is present for LastLogin, not even an explicit nil +### GetLastName + +`func (o *UserCollectionItem) GetLastName() string` + +GetLastName returns the LastName field if non-nil, zero value otherwise. + +### GetLastNameOk + +`func (o *UserCollectionItem) GetLastNameOk() (*string, bool)` + +GetLastNameOk returns a tuple with the LastName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastName + +`func (o *UserCollectionItem) SetLastName(v string)` + +SetLastName sets LastName field to given value. + +### HasLastName + +`func (o *UserCollectionItem) HasLastName() bool` + +HasLastName returns a boolean if a field has been set. + +### GetLoginCount + +`func (o *UserCollectionItem) GetLoginCount() int32` + +GetLoginCount returns the LoginCount field if non-nil, zero value otherwise. + +### GetLoginCountOk + +`func (o *UserCollectionItem) GetLoginCountOk() (*int32, bool)` + +GetLoginCountOk returns a tuple with the LoginCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLoginCount + +`func (o *UserCollectionItem) SetLoginCount(v int32)` + +SetLoginCount sets LoginCount field to given value. + +### HasLoginCount + +`func (o *UserCollectionItem) HasLoginCount() bool` + +HasLoginCount returns a boolean if a field has been set. + +### SetLoginCountNil + +`func (o *UserCollectionItem) SetLoginCountNil(b bool)` + + SetLoginCountNil sets the value for LoginCount to be an explicit nil + +### UnsetLoginCount +`func (o *UserCollectionItem) UnsetLoginCount()` + +UnsetLoginCount ensures that no value is present for LoginCount, not even an explicit nil +### GetRoles + +`func (o *UserCollectionItem) GetRoles() []UserCollectionItemRolesInner` + +GetRoles returns the Roles field if non-nil, zero value otherwise. + +### GetRolesOk + +`func (o *UserCollectionItem) GetRolesOk() (*[]UserCollectionItemRolesInner, bool)` + +GetRolesOk returns a tuple with the Roles field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRoles + +`func (o *UserCollectionItem) SetRoles(v []UserCollectionItemRolesInner)` + +SetRoles sets Roles field to given value. + +### HasRoles + +`func (o *UserCollectionItem) HasRoles() bool` + +HasRoles returns a boolean if a field has been set. + +### GetUsername + +`func (o *UserCollectionItem) GetUsername() string` + +GetUsername returns the Username field if non-nil, zero value otherwise. + +### GetUsernameOk + +`func (o *UserCollectionItem) GetUsernameOk() (*string, bool)` + +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsername + +`func (o *UserCollectionItem) SetUsername(v string)` + +SetUsername sets Username field to given value. + +### HasUsername + +`func (o *UserCollectionItem) HasUsername() bool` + +HasUsername returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/auth/fab/docs/UserCollectionItemRolesInner.md b/airflow/auth/fab/docs/UserCollectionItemRolesInner.md new file mode 100644 index 0000000..96c9ebd --- /dev/null +++ b/airflow/auth/fab/docs/UserCollectionItemRolesInner.md @@ -0,0 +1,56 @@ +# UserCollectionItemRolesInner + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | | [optional] + +## Methods + +### NewUserCollectionItemRolesInner + +`func NewUserCollectionItemRolesInner() *UserCollectionItemRolesInner` + +NewUserCollectionItemRolesInner instantiates a new UserCollectionItemRolesInner object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUserCollectionItemRolesInnerWithDefaults + +`func NewUserCollectionItemRolesInnerWithDefaults() *UserCollectionItemRolesInner` + +NewUserCollectionItemRolesInnerWithDefaults instantiates a new UserCollectionItemRolesInner object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *UserCollectionItemRolesInner) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *UserCollectionItemRolesInner) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *UserCollectionItemRolesInner) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *UserCollectionItemRolesInner) HasName() bool` + +HasName returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/airflow/auth/fab/git_push.sh b/airflow/auth/fab/git_push.sh new file mode 100644 index 0000000..f53a75d --- /dev/null +++ b/airflow/auth/fab/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/airflow/auth/fab/go.mod b/airflow/auth/fab/go.mod new file mode 100644 index 0000000..49fe858 --- /dev/null +++ b/airflow/auth/fab/go.mod @@ -0,0 +1,11 @@ +module github.com/apache/airflow-client-go/airflow/auth/fab + +go 1.18 + +require github.com/stretchr/testify v1.10.0 + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/airflow/auth/fab/go.sum b/airflow/auth/fab/go.sum new file mode 100644 index 0000000..c38f9d6 --- /dev/null +++ b/airflow/auth/fab/go.sum @@ -0,0 +1,5 @@ +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/airflow/auth/fab/model_action.go b/airflow/auth/fab/model_action.go new file mode 100644 index 0000000..d8efc26 --- /dev/null +++ b/airflow/auth/fab/model_action.go @@ -0,0 +1,128 @@ +/* +Flask App Builder User & Role API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package fab + +import ( + "encoding/json" +) + +// checks if the Action type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Action{} + +// Action An action Item. *New in version 2.8.0* +type Action struct { + // The name of the permission \"action\" + Name *string `json:"name,omitempty"` +} + +// NewAction instantiates a new Action object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAction() *Action { + this := Action{} + return &this +} + +// NewActionWithDefaults instantiates a new Action object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActionWithDefaults() *Action { + this := Action{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Action) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Action) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Action) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Action) SetName(v string) { + o.Name = &v +} + +func (o Action) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Action) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableAction struct { + value *Action + isSet bool +} + +func (v NullableAction) Get() *Action { + return v.value +} + +func (v *NullableAction) Set(val *Action) { + v.value = val + v.isSet = true +} + +func (v NullableAction) IsSet() bool { + return v.isSet +} + +func (v *NullableAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAction(val *Action) *NullableAction { + return &NullableAction{value: val, isSet: true} +} + +func (v NullableAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/auth/fab/model_action_collection.go b/airflow/auth/fab/model_action_collection.go new file mode 100644 index 0000000..4995f8b --- /dev/null +++ b/airflow/auth/fab/model_action_collection.go @@ -0,0 +1,164 @@ +/* +Flask App Builder User & Role API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package fab + +import ( + "encoding/json" +) + +// checks if the ActionCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActionCollection{} + +// ActionCollection A collection of actions. *New in version 2.8.0* +type ActionCollection struct { + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. + TotalEntries *int32 `json:"total_entries,omitempty"` + Actions []Action `json:"actions,omitempty"` +} + +// NewActionCollection instantiates a new ActionCollection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActionCollection() *ActionCollection { + this := ActionCollection{} + return &this +} + +// NewActionCollectionWithDefaults instantiates a new ActionCollection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActionCollectionWithDefaults() *ActionCollection { + this := ActionCollection{} + return &this +} + +// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. +func (o *ActionCollection) GetTotalEntries() int32 { + if o == nil || IsNil(o.TotalEntries) { + var ret int32 + return ret + } + return *o.TotalEntries +} + +// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionCollection) GetTotalEntriesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalEntries) { + return nil, false + } + return o.TotalEntries, true +} + +// HasTotalEntries returns a boolean if a field has been set. +func (o *ActionCollection) HasTotalEntries() bool { + if o != nil && !IsNil(o.TotalEntries) { + return true + } + + return false +} + +// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. +func (o *ActionCollection) SetTotalEntries(v int32) { + o.TotalEntries = &v +} + +// GetActions returns the Actions field value if set, zero value otherwise. +func (o *ActionCollection) GetActions() []Action { + if o == nil || IsNil(o.Actions) { + var ret []Action + return ret + } + return o.Actions +} + +// GetActionsOk returns a tuple with the Actions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionCollection) GetActionsOk() ([]Action, bool) { + if o == nil || IsNil(o.Actions) { + return nil, false + } + return o.Actions, true +} + +// HasActions returns a boolean if a field has been set. +func (o *ActionCollection) HasActions() bool { + if o != nil && !IsNil(o.Actions) { + return true + } + + return false +} + +// SetActions gets a reference to the given []Action and assigns it to the Actions field. +func (o *ActionCollection) SetActions(v []Action) { + o.Actions = v +} + +func (o ActionCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActionCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalEntries) { + toSerialize["total_entries"] = o.TotalEntries + } + if !IsNil(o.Actions) { + toSerialize["actions"] = o.Actions + } + return toSerialize, nil +} + +type NullableActionCollection struct { + value *ActionCollection + isSet bool +} + +func (v NullableActionCollection) Get() *ActionCollection { + return v.value +} + +func (v *NullableActionCollection) Set(val *ActionCollection) { + v.value = val + v.isSet = true +} + +func (v NullableActionCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableActionCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActionCollection(val *ActionCollection) *NullableActionCollection { + return &NullableActionCollection{value: val, isSet: true} +} + +func (v NullableActionCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActionCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/auth/fab/model_action_resource.go b/airflow/auth/fab/model_action_resource.go new file mode 100644 index 0000000..34b85b2 --- /dev/null +++ b/airflow/auth/fab/model_action_resource.go @@ -0,0 +1,163 @@ +/* +Flask App Builder User & Role API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package fab + +import ( + "encoding/json" +) + +// checks if the ActionResource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActionResource{} + +// ActionResource The Action-Resource item. *New in version 2.8.0* +type ActionResource struct { + Action *Action `json:"action,omitempty"` + Resource *Resource `json:"resource,omitempty"` +} + +// NewActionResource instantiates a new ActionResource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewActionResource() *ActionResource { + this := ActionResource{} + return &this +} + +// NewActionResourceWithDefaults instantiates a new ActionResource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewActionResourceWithDefaults() *ActionResource { + this := ActionResource{} + return &this +} + +// GetAction returns the Action field value if set, zero value otherwise. +func (o *ActionResource) GetAction() Action { + if o == nil || IsNil(o.Action) { + var ret Action + return ret + } + return *o.Action +} + +// GetActionOk returns a tuple with the Action field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionResource) GetActionOk() (*Action, bool) { + if o == nil || IsNil(o.Action) { + return nil, false + } + return o.Action, true +} + +// HasAction returns a boolean if a field has been set. +func (o *ActionResource) HasAction() bool { + if o != nil && !IsNil(o.Action) { + return true + } + + return false +} + +// SetAction gets a reference to the given Action and assigns it to the Action field. +func (o *ActionResource) SetAction(v Action) { + o.Action = &v +} + +// GetResource returns the Resource field value if set, zero value otherwise. +func (o *ActionResource) GetResource() Resource { + if o == nil || IsNil(o.Resource) { + var ret Resource + return ret + } + return *o.Resource +} + +// GetResourceOk returns a tuple with the Resource field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActionResource) GetResourceOk() (*Resource, bool) { + if o == nil || IsNil(o.Resource) { + return nil, false + } + return o.Resource, true +} + +// HasResource returns a boolean if a field has been set. +func (o *ActionResource) HasResource() bool { + if o != nil && !IsNil(o.Resource) { + return true + } + + return false +} + +// SetResource gets a reference to the given Resource and assigns it to the Resource field. +func (o *ActionResource) SetResource(v Resource) { + o.Resource = &v +} + +func (o ActionResource) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActionResource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Action) { + toSerialize["action"] = o.Action + } + if !IsNil(o.Resource) { + toSerialize["resource"] = o.Resource + } + return toSerialize, nil +} + +type NullableActionResource struct { + value *ActionResource + isSet bool +} + +func (v NullableActionResource) Get() *ActionResource { + return v.value +} + +func (v *NullableActionResource) Set(val *ActionResource) { + v.value = val + v.isSet = true +} + +func (v NullableActionResource) IsSet() bool { + return v.isSet +} + +func (v *NullableActionResource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActionResource(val *ActionResource) *NullableActionResource { + return &NullableActionResource{value: val, isSet: true} +} + +func (v NullableActionResource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActionResource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/auth/fab/model_collection_info.go b/airflow/auth/fab/model_collection_info.go new file mode 100644 index 0000000..e0f6769 --- /dev/null +++ b/airflow/auth/fab/model_collection_info.go @@ -0,0 +1,128 @@ +/* +Flask App Builder User & Role API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package fab + +import ( + "encoding/json" +) + +// checks if the CollectionInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CollectionInfo{} + +// CollectionInfo Metadata about collection. +type CollectionInfo struct { + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. + TotalEntries *int32 `json:"total_entries,omitempty"` +} + +// NewCollectionInfo instantiates a new CollectionInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCollectionInfo() *CollectionInfo { + this := CollectionInfo{} + return &this +} + +// NewCollectionInfoWithDefaults instantiates a new CollectionInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCollectionInfoWithDefaults() *CollectionInfo { + this := CollectionInfo{} + return &this +} + +// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. +func (o *CollectionInfo) GetTotalEntries() int32 { + if o == nil || IsNil(o.TotalEntries) { + var ret int32 + return ret + } + return *o.TotalEntries +} + +// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CollectionInfo) GetTotalEntriesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalEntries) { + return nil, false + } + return o.TotalEntries, true +} + +// HasTotalEntries returns a boolean if a field has been set. +func (o *CollectionInfo) HasTotalEntries() bool { + if o != nil && !IsNil(o.TotalEntries) { + return true + } + + return false +} + +// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. +func (o *CollectionInfo) SetTotalEntries(v int32) { + o.TotalEntries = &v +} + +func (o CollectionInfo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CollectionInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalEntries) { + toSerialize["total_entries"] = o.TotalEntries + } + return toSerialize, nil +} + +type NullableCollectionInfo struct { + value *CollectionInfo + isSet bool +} + +func (v NullableCollectionInfo) Get() *CollectionInfo { + return v.value +} + +func (v *NullableCollectionInfo) Set(val *CollectionInfo) { + v.value = val + v.isSet = true +} + +func (v NullableCollectionInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableCollectionInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCollectionInfo(val *CollectionInfo) *NullableCollectionInfo { + return &NullableCollectionInfo{value: val, isSet: true} +} + +func (v NullableCollectionInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCollectionInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/auth/fab/model_error.go b/airflow/auth/fab/model_error.go new file mode 100644 index 0000000..7774751 --- /dev/null +++ b/airflow/auth/fab/model_error.go @@ -0,0 +1,292 @@ +/* +Flask App Builder User & Role API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package fab + +import ( + "encoding/json" + "bytes" + "fmt" +) + +// checks if the Error type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Error{} + +// Error [RFC7807](https://tools.ietf.org/html/rfc7807) compliant response. +type Error struct { + // A human-readable explanation specific to this occurrence of the problem. + Detail *string `json:"detail,omitempty"` + // A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. + Instance *string `json:"instance,omitempty"` + // The HTTP status code generated by the API server for this occurrence of the problem. + Status float32 `json:"status"` + // A short, human-readable summary of the problem type. + Title string `json:"title"` + // A URI reference [RFC3986] that identifies the problem type. This specification encourages that, when dereferenced, it provide human-readable documentation for the problem type. + Type string `json:"type"` +} + +type _Error Error + +// NewError instantiates a new Error object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewError(status float32, title string, type_ string) *Error { + this := Error{} + this.Status = status + this.Title = title + this.Type = type_ + return &this +} + +// NewErrorWithDefaults instantiates a new Error object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorWithDefaults() *Error { + this := Error{} + return &this +} + +// GetDetail returns the Detail field value if set, zero value otherwise. +func (o *Error) GetDetail() string { + if o == nil || IsNil(o.Detail) { + var ret string + return ret + } + return *o.Detail +} + +// GetDetailOk returns a tuple with the Detail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Error) GetDetailOk() (*string, bool) { + if o == nil || IsNil(o.Detail) { + return nil, false + } + return o.Detail, true +} + +// HasDetail returns a boolean if a field has been set. +func (o *Error) HasDetail() bool { + if o != nil && !IsNil(o.Detail) { + return true + } + + return false +} + +// SetDetail gets a reference to the given string and assigns it to the Detail field. +func (o *Error) SetDetail(v string) { + o.Detail = &v +} + +// GetInstance returns the Instance field value if set, zero value otherwise. +func (o *Error) GetInstance() string { + if o == nil || IsNil(o.Instance) { + var ret string + return ret + } + return *o.Instance +} + +// GetInstanceOk returns a tuple with the Instance field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Error) GetInstanceOk() (*string, bool) { + if o == nil || IsNil(o.Instance) { + return nil, false + } + return o.Instance, true +} + +// HasInstance returns a boolean if a field has been set. +func (o *Error) HasInstance() bool { + if o != nil && !IsNil(o.Instance) { + return true + } + + return false +} + +// SetInstance gets a reference to the given string and assigns it to the Instance field. +func (o *Error) SetInstance(v string) { + o.Instance = &v +} + +// GetStatus returns the Status field value +func (o *Error) GetStatus() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Error) GetStatusOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Error) SetStatus(v float32) { + o.Status = v +} + +// GetTitle returns the Title field value +func (o *Error) GetTitle() string { + if o == nil { + var ret string + return ret + } + + return o.Title +} + +// GetTitleOk returns a tuple with the Title field value +// and a boolean to check if the value has been set. +func (o *Error) GetTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Title, true +} + +// SetTitle sets field value +func (o *Error) SetTitle(v string) { + o.Title = v +} + +// GetType returns the Type field value +func (o *Error) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Error) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Error) SetType(v string) { + o.Type = v +} + +func (o Error) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Error) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Detail) { + toSerialize["detail"] = o.Detail + } + if !IsNil(o.Instance) { + toSerialize["instance"] = o.Instance + } + toSerialize["status"] = o.Status + toSerialize["title"] = o.Title + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *Error) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "status", + "title", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varError := _Error{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varError) + + if err != nil { + return err + } + + *o = Error(varError) + + return err +} + +type NullableError struct { + value *Error + isSet bool +} + +func (v NullableError) Get() *Error { + return v.value +} + +func (v *NullableError) Set(val *Error) { + v.value = val + v.isSet = true +} + +func (v NullableError) IsSet() bool { + return v.isSet +} + +func (v *NullableError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableError(val *Error) *NullableError { + return &NullableError{value: val, isSet: true} +} + +func (v NullableError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/auth/fab/model_resource.go b/airflow/auth/fab/model_resource.go new file mode 100644 index 0000000..66418c0 --- /dev/null +++ b/airflow/auth/fab/model_resource.go @@ -0,0 +1,128 @@ +/* +Flask App Builder User & Role API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package fab + +import ( + "encoding/json" +) + +// checks if the Resource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Resource{} + +// Resource A resource on which permissions are granted. *New in version 2.8.0* +type Resource struct { + // The name of the resource + Name *string `json:"name,omitempty"` +} + +// NewResource instantiates a new Resource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResource() *Resource { + this := Resource{} + return &this +} + +// NewResourceWithDefaults instantiates a new Resource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResourceWithDefaults() *Resource { + this := Resource{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Resource) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Resource) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Resource) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Resource) SetName(v string) { + o.Name = &v +} + +func (o Resource) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Resource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableResource struct { + value *Resource + isSet bool +} + +func (v NullableResource) Get() *Resource { + return v.value +} + +func (v *NullableResource) Set(val *Resource) { + v.value = val + v.isSet = true +} + +func (v NullableResource) IsSet() bool { + return v.isSet +} + +func (v *NullableResource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResource(val *Resource) *NullableResource { + return &NullableResource{value: val, isSet: true} +} + +func (v NullableResource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/auth/fab/model_role.go b/airflow/auth/fab/model_role.go new file mode 100644 index 0000000..876020f --- /dev/null +++ b/airflow/auth/fab/model_role.go @@ -0,0 +1,164 @@ +/* +Flask App Builder User & Role API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package fab + +import ( + "encoding/json" +) + +// checks if the Role type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Role{} + +// Role a role item. *New in version 2.8.0* +type Role struct { + Actions []ActionResource `json:"actions,omitempty"` + // The name of the role + Name *string `json:"name,omitempty"` +} + +// NewRole instantiates a new Role object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRole() *Role { + this := Role{} + return &this +} + +// NewRoleWithDefaults instantiates a new Role object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRoleWithDefaults() *Role { + this := Role{} + return &this +} + +// GetActions returns the Actions field value if set, zero value otherwise. +func (o *Role) GetActions() []ActionResource { + if o == nil || IsNil(o.Actions) { + var ret []ActionResource + return ret + } + return o.Actions +} + +// GetActionsOk returns a tuple with the Actions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Role) GetActionsOk() ([]ActionResource, bool) { + if o == nil || IsNil(o.Actions) { + return nil, false + } + return o.Actions, true +} + +// HasActions returns a boolean if a field has been set. +func (o *Role) HasActions() bool { + if o != nil && !IsNil(o.Actions) { + return true + } + + return false +} + +// SetActions gets a reference to the given []ActionResource and assigns it to the Actions field. +func (o *Role) SetActions(v []ActionResource) { + o.Actions = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Role) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Role) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Role) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Role) SetName(v string) { + o.Name = &v +} + +func (o Role) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Role) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Actions) { + toSerialize["actions"] = o.Actions + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableRole struct { + value *Role + isSet bool +} + +func (v NullableRole) Get() *Role { + return v.value +} + +func (v *NullableRole) Set(val *Role) { + v.value = val + v.isSet = true +} + +func (v NullableRole) IsSet() bool { + return v.isSet +} + +func (v *NullableRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRole(val *Role) *NullableRole { + return &NullableRole{value: val, isSet: true} +} + +func (v NullableRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/auth/fab/model_role_collection.go b/airflow/auth/fab/model_role_collection.go new file mode 100644 index 0000000..43a0f94 --- /dev/null +++ b/airflow/auth/fab/model_role_collection.go @@ -0,0 +1,164 @@ +/* +Flask App Builder User & Role API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package fab + +import ( + "encoding/json" +) + +// checks if the RoleCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RoleCollection{} + +// RoleCollection A collection of roles. *New in version 2.8.0* +type RoleCollection struct { + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. + TotalEntries *int32 `json:"total_entries,omitempty"` + Roles []Role `json:"roles,omitempty"` +} + +// NewRoleCollection instantiates a new RoleCollection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRoleCollection() *RoleCollection { + this := RoleCollection{} + return &this +} + +// NewRoleCollectionWithDefaults instantiates a new RoleCollection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRoleCollectionWithDefaults() *RoleCollection { + this := RoleCollection{} + return &this +} + +// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. +func (o *RoleCollection) GetTotalEntries() int32 { + if o == nil || IsNil(o.TotalEntries) { + var ret int32 + return ret + } + return *o.TotalEntries +} + +// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoleCollection) GetTotalEntriesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalEntries) { + return nil, false + } + return o.TotalEntries, true +} + +// HasTotalEntries returns a boolean if a field has been set. +func (o *RoleCollection) HasTotalEntries() bool { + if o != nil && !IsNil(o.TotalEntries) { + return true + } + + return false +} + +// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. +func (o *RoleCollection) SetTotalEntries(v int32) { + o.TotalEntries = &v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *RoleCollection) GetRoles() []Role { + if o == nil || IsNil(o.Roles) { + var ret []Role + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoleCollection) GetRolesOk() ([]Role, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *RoleCollection) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []Role and assigns it to the Roles field. +func (o *RoleCollection) SetRoles(v []Role) { + o.Roles = v +} + +func (o RoleCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RoleCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalEntries) { + toSerialize["total_entries"] = o.TotalEntries + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + return toSerialize, nil +} + +type NullableRoleCollection struct { + value *RoleCollection + isSet bool +} + +func (v NullableRoleCollection) Get() *RoleCollection { + return v.value +} + +func (v *NullableRoleCollection) Set(val *RoleCollection) { + v.value = val + v.isSet = true +} + +func (v NullableRoleCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableRoleCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRoleCollection(val *RoleCollection) *NullableRoleCollection { + return &NullableRoleCollection{value: val, isSet: true} +} + +func (v NullableRoleCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRoleCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/auth/fab/model_user.go b/airflow/auth/fab/model_user.go new file mode 100644 index 0000000..d927dda --- /dev/null +++ b/airflow/auth/fab/model_user.go @@ -0,0 +1,594 @@ +/* +Flask App Builder User & Role API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package fab + +import ( + "encoding/json" +) + +// checks if the User type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &User{} + +// User A user object with sensitive data. *New in version 2.8.0* +type User struct { + // Whether the user is active + Active NullableBool `json:"active,omitempty"` + // The date user was changed + ChangedOn NullableString `json:"changed_on,omitempty"` + // The date user was created + CreatedOn NullableString `json:"created_on,omitempty"` + // The user's email. + Email *string `json:"email,omitempty"` + // The number of times the login failed + FailedLoginCount NullableInt32 `json:"failed_login_count,omitempty"` + // The user's first name. + FirstName *string `json:"first_name,omitempty"` + // The last user login + LastLogin NullableString `json:"last_login,omitempty"` + // The user's last name. + LastName *string `json:"last_name,omitempty"` + // The login count + LoginCount NullableInt32 `json:"login_count,omitempty"` + // User roles. + Roles []UserCollectionItemRolesInner `json:"roles,omitempty"` + // The username. + Username *string `json:"username,omitempty"` + Password *string `json:"password,omitempty"` +} + +// NewUser instantiates a new User object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUser() *User { + this := User{} + return &this +} + +// NewUserWithDefaults instantiates a new User object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserWithDefaults() *User { + this := User{} + return &this +} + +// GetActive returns the Active field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *User) GetActive() bool { + if o == nil || IsNil(o.Active.Get()) { + var ret bool + return ret + } + return *o.Active.Get() +} + +// GetActiveOk returns a tuple with the Active field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *User) GetActiveOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.Active.Get(), o.Active.IsSet() +} + +// HasActive returns a boolean if a field has been set. +func (o *User) HasActive() bool { + if o != nil && o.Active.IsSet() { + return true + } + + return false +} + +// SetActive gets a reference to the given NullableBool and assigns it to the Active field. +func (o *User) SetActive(v bool) { + o.Active.Set(&v) +} +// SetActiveNil sets the value for Active to be an explicit nil +func (o *User) SetActiveNil() { + o.Active.Set(nil) +} + +// UnsetActive ensures that no value is present for Active, not even an explicit nil +func (o *User) UnsetActive() { + o.Active.Unset() +} + +// GetChangedOn returns the ChangedOn field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *User) GetChangedOn() string { + if o == nil || IsNil(o.ChangedOn.Get()) { + var ret string + return ret + } + return *o.ChangedOn.Get() +} + +// GetChangedOnOk returns a tuple with the ChangedOn field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *User) GetChangedOnOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ChangedOn.Get(), o.ChangedOn.IsSet() +} + +// HasChangedOn returns a boolean if a field has been set. +func (o *User) HasChangedOn() bool { + if o != nil && o.ChangedOn.IsSet() { + return true + } + + return false +} + +// SetChangedOn gets a reference to the given NullableString and assigns it to the ChangedOn field. +func (o *User) SetChangedOn(v string) { + o.ChangedOn.Set(&v) +} +// SetChangedOnNil sets the value for ChangedOn to be an explicit nil +func (o *User) SetChangedOnNil() { + o.ChangedOn.Set(nil) +} + +// UnsetChangedOn ensures that no value is present for ChangedOn, not even an explicit nil +func (o *User) UnsetChangedOn() { + o.ChangedOn.Unset() +} + +// GetCreatedOn returns the CreatedOn field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *User) GetCreatedOn() string { + if o == nil || IsNil(o.CreatedOn.Get()) { + var ret string + return ret + } + return *o.CreatedOn.Get() +} + +// GetCreatedOnOk returns a tuple with the CreatedOn field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *User) GetCreatedOnOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CreatedOn.Get(), o.CreatedOn.IsSet() +} + +// HasCreatedOn returns a boolean if a field has been set. +func (o *User) HasCreatedOn() bool { + if o != nil && o.CreatedOn.IsSet() { + return true + } + + return false +} + +// SetCreatedOn gets a reference to the given NullableString and assigns it to the CreatedOn field. +func (o *User) SetCreatedOn(v string) { + o.CreatedOn.Set(&v) +} +// SetCreatedOnNil sets the value for CreatedOn to be an explicit nil +func (o *User) SetCreatedOnNil() { + o.CreatedOn.Set(nil) +} + +// UnsetCreatedOn ensures that no value is present for CreatedOn, not even an explicit nil +func (o *User) UnsetCreatedOn() { + o.CreatedOn.Unset() +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *User) GetEmail() string { + if o == nil || IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetEmailOk() (*string, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *User) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *User) SetEmail(v string) { + o.Email = &v +} + +// GetFailedLoginCount returns the FailedLoginCount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *User) GetFailedLoginCount() int32 { + if o == nil || IsNil(o.FailedLoginCount.Get()) { + var ret int32 + return ret + } + return *o.FailedLoginCount.Get() +} + +// GetFailedLoginCountOk returns a tuple with the FailedLoginCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *User) GetFailedLoginCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.FailedLoginCount.Get(), o.FailedLoginCount.IsSet() +} + +// HasFailedLoginCount returns a boolean if a field has been set. +func (o *User) HasFailedLoginCount() bool { + if o != nil && o.FailedLoginCount.IsSet() { + return true + } + + return false +} + +// SetFailedLoginCount gets a reference to the given NullableInt32 and assigns it to the FailedLoginCount field. +func (o *User) SetFailedLoginCount(v int32) { + o.FailedLoginCount.Set(&v) +} +// SetFailedLoginCountNil sets the value for FailedLoginCount to be an explicit nil +func (o *User) SetFailedLoginCountNil() { + o.FailedLoginCount.Set(nil) +} + +// UnsetFailedLoginCount ensures that no value is present for FailedLoginCount, not even an explicit nil +func (o *User) UnsetFailedLoginCount() { + o.FailedLoginCount.Unset() +} + +// GetFirstName returns the FirstName field value if set, zero value otherwise. +func (o *User) GetFirstName() string { + if o == nil || IsNil(o.FirstName) { + var ret string + return ret + } + return *o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetFirstNameOk() (*string, bool) { + if o == nil || IsNil(o.FirstName) { + return nil, false + } + return o.FirstName, true +} + +// HasFirstName returns a boolean if a field has been set. +func (o *User) HasFirstName() bool { + if o != nil && !IsNil(o.FirstName) { + return true + } + + return false +} + +// SetFirstName gets a reference to the given string and assigns it to the FirstName field. +func (o *User) SetFirstName(v string) { + o.FirstName = &v +} + +// GetLastLogin returns the LastLogin field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *User) GetLastLogin() string { + if o == nil || IsNil(o.LastLogin.Get()) { + var ret string + return ret + } + return *o.LastLogin.Get() +} + +// GetLastLoginOk returns a tuple with the LastLogin field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *User) GetLastLoginOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.LastLogin.Get(), o.LastLogin.IsSet() +} + +// HasLastLogin returns a boolean if a field has been set. +func (o *User) HasLastLogin() bool { + if o != nil && o.LastLogin.IsSet() { + return true + } + + return false +} + +// SetLastLogin gets a reference to the given NullableString and assigns it to the LastLogin field. +func (o *User) SetLastLogin(v string) { + o.LastLogin.Set(&v) +} +// SetLastLoginNil sets the value for LastLogin to be an explicit nil +func (o *User) SetLastLoginNil() { + o.LastLogin.Set(nil) +} + +// UnsetLastLogin ensures that no value is present for LastLogin, not even an explicit nil +func (o *User) UnsetLastLogin() { + o.LastLogin.Unset() +} + +// GetLastName returns the LastName field value if set, zero value otherwise. +func (o *User) GetLastName() string { + if o == nil || IsNil(o.LastName) { + var ret string + return ret + } + return *o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetLastNameOk() (*string, bool) { + if o == nil || IsNil(o.LastName) { + return nil, false + } + return o.LastName, true +} + +// HasLastName returns a boolean if a field has been set. +func (o *User) HasLastName() bool { + if o != nil && !IsNil(o.LastName) { + return true + } + + return false +} + +// SetLastName gets a reference to the given string and assigns it to the LastName field. +func (o *User) SetLastName(v string) { + o.LastName = &v +} + +// GetLoginCount returns the LoginCount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *User) GetLoginCount() int32 { + if o == nil || IsNil(o.LoginCount.Get()) { + var ret int32 + return ret + } + return *o.LoginCount.Get() +} + +// GetLoginCountOk returns a tuple with the LoginCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *User) GetLoginCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.LoginCount.Get(), o.LoginCount.IsSet() +} + +// HasLoginCount returns a boolean if a field has been set. +func (o *User) HasLoginCount() bool { + if o != nil && o.LoginCount.IsSet() { + return true + } + + return false +} + +// SetLoginCount gets a reference to the given NullableInt32 and assigns it to the LoginCount field. +func (o *User) SetLoginCount(v int32) { + o.LoginCount.Set(&v) +} +// SetLoginCountNil sets the value for LoginCount to be an explicit nil +func (o *User) SetLoginCountNil() { + o.LoginCount.Set(nil) +} + +// UnsetLoginCount ensures that no value is present for LoginCount, not even an explicit nil +func (o *User) UnsetLoginCount() { + o.LoginCount.Unset() +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *User) GetRoles() []UserCollectionItemRolesInner { + if o == nil || IsNil(o.Roles) { + var ret []UserCollectionItemRolesInner + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetRolesOk() ([]UserCollectionItemRolesInner, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *User) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []UserCollectionItemRolesInner and assigns it to the Roles field. +func (o *User) SetRoles(v []UserCollectionItemRolesInner) { + o.Roles = v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *User) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *User) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *User) SetUsername(v string) { + o.Username = &v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *User) GetPassword() string { + if o == nil || IsNil(o.Password) { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetPasswordOk() (*string, bool) { + if o == nil || IsNil(o.Password) { + return nil, false + } + return o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *User) HasPassword() bool { + if o != nil && !IsNil(o.Password) { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *User) SetPassword(v string) { + o.Password = &v +} + +func (o User) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o User) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Active.IsSet() { + toSerialize["active"] = o.Active.Get() + } + if o.ChangedOn.IsSet() { + toSerialize["changed_on"] = o.ChangedOn.Get() + } + if o.CreatedOn.IsSet() { + toSerialize["created_on"] = o.CreatedOn.Get() + } + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + if o.FailedLoginCount.IsSet() { + toSerialize["failed_login_count"] = o.FailedLoginCount.Get() + } + if !IsNil(o.FirstName) { + toSerialize["first_name"] = o.FirstName + } + if o.LastLogin.IsSet() { + toSerialize["last_login"] = o.LastLogin.Get() + } + if !IsNil(o.LastName) { + toSerialize["last_name"] = o.LastName + } + if o.LoginCount.IsSet() { + toSerialize["login_count"] = o.LoginCount.Get() + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + if !IsNil(o.Password) { + toSerialize["password"] = o.Password + } + return toSerialize, nil +} + +type NullableUser struct { + value *User + isSet bool +} + +func (v NullableUser) Get() *User { + return v.value +} + +func (v *NullableUser) Set(val *User) { + v.value = val + v.isSet = true +} + +func (v NullableUser) IsSet() bool { + return v.isSet +} + +func (v *NullableUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUser(val *User) *NullableUser { + return &NullableUser{value: val, isSet: true} +} + +func (v NullableUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/auth/fab/model_user_collection.go b/airflow/auth/fab/model_user_collection.go new file mode 100644 index 0000000..654c946 --- /dev/null +++ b/airflow/auth/fab/model_user_collection.go @@ -0,0 +1,164 @@ +/* +Flask App Builder User & Role API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package fab + +import ( + "encoding/json" +) + +// checks if the UserCollection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserCollection{} + +// UserCollection Collection of users. *New in version 2.8.0* +type UserCollection struct { + // Count of total objects in the current result set before pagination parameters (limit, offset) are applied. + TotalEntries *int32 `json:"total_entries,omitempty"` + Users []UserCollectionItem `json:"users,omitempty"` +} + +// NewUserCollection instantiates a new UserCollection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserCollection() *UserCollection { + this := UserCollection{} + return &this +} + +// NewUserCollectionWithDefaults instantiates a new UserCollection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserCollectionWithDefaults() *UserCollection { + this := UserCollection{} + return &this +} + +// GetTotalEntries returns the TotalEntries field value if set, zero value otherwise. +func (o *UserCollection) GetTotalEntries() int32 { + if o == nil || IsNil(o.TotalEntries) { + var ret int32 + return ret + } + return *o.TotalEntries +} + +// GetTotalEntriesOk returns a tuple with the TotalEntries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCollection) GetTotalEntriesOk() (*int32, bool) { + if o == nil || IsNil(o.TotalEntries) { + return nil, false + } + return o.TotalEntries, true +} + +// HasTotalEntries returns a boolean if a field has been set. +func (o *UserCollection) HasTotalEntries() bool { + if o != nil && !IsNil(o.TotalEntries) { + return true + } + + return false +} + +// SetTotalEntries gets a reference to the given int32 and assigns it to the TotalEntries field. +func (o *UserCollection) SetTotalEntries(v int32) { + o.TotalEntries = &v +} + +// GetUsers returns the Users field value if set, zero value otherwise. +func (o *UserCollection) GetUsers() []UserCollectionItem { + if o == nil || IsNil(o.Users) { + var ret []UserCollectionItem + return ret + } + return o.Users +} + +// GetUsersOk returns a tuple with the Users field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCollection) GetUsersOk() ([]UserCollectionItem, bool) { + if o == nil || IsNil(o.Users) { + return nil, false + } + return o.Users, true +} + +// HasUsers returns a boolean if a field has been set. +func (o *UserCollection) HasUsers() bool { + if o != nil && !IsNil(o.Users) { + return true + } + + return false +} + +// SetUsers gets a reference to the given []UserCollectionItem and assigns it to the Users field. +func (o *UserCollection) SetUsers(v []UserCollectionItem) { + o.Users = v +} + +func (o UserCollection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserCollection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalEntries) { + toSerialize["total_entries"] = o.TotalEntries + } + if !IsNil(o.Users) { + toSerialize["users"] = o.Users + } + return toSerialize, nil +} + +type NullableUserCollection struct { + value *UserCollection + isSet bool +} + +func (v NullableUserCollection) Get() *UserCollection { + return v.value +} + +func (v *NullableUserCollection) Set(val *UserCollection) { + v.value = val + v.isSet = true +} + +func (v NullableUserCollection) IsSet() bool { + return v.isSet +} + +func (v *NullableUserCollection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserCollection(val *UserCollection) *NullableUserCollection { + return &NullableUserCollection{value: val, isSet: true} +} + +func (v NullableUserCollection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserCollection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/auth/fab/model_user_collection_item.go b/airflow/auth/fab/model_user_collection_item.go new file mode 100644 index 0000000..fd07022 --- /dev/null +++ b/airflow/auth/fab/model_user_collection_item.go @@ -0,0 +1,558 @@ +/* +Flask App Builder User & Role API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package fab + +import ( + "encoding/json" +) + +// checks if the UserCollectionItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserCollectionItem{} + +// UserCollectionItem A user object. *New in version 2.8.0* +type UserCollectionItem struct { + // Whether the user is active + Active NullableBool `json:"active,omitempty"` + // The date user was changed + ChangedOn NullableString `json:"changed_on,omitempty"` + // The date user was created + CreatedOn NullableString `json:"created_on,omitempty"` + // The user's email. + Email *string `json:"email,omitempty"` + // The number of times the login failed + FailedLoginCount NullableInt32 `json:"failed_login_count,omitempty"` + // The user's first name. + FirstName *string `json:"first_name,omitempty"` + // The last user login + LastLogin NullableString `json:"last_login,omitempty"` + // The user's last name. + LastName *string `json:"last_name,omitempty"` + // The login count + LoginCount NullableInt32 `json:"login_count,omitempty"` + // User roles. + Roles []UserCollectionItemRolesInner `json:"roles,omitempty"` + // The username. + Username *string `json:"username,omitempty"` +} + +// NewUserCollectionItem instantiates a new UserCollectionItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserCollectionItem() *UserCollectionItem { + this := UserCollectionItem{} + return &this +} + +// NewUserCollectionItemWithDefaults instantiates a new UserCollectionItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserCollectionItemWithDefaults() *UserCollectionItem { + this := UserCollectionItem{} + return &this +} + +// GetActive returns the Active field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UserCollectionItem) GetActive() bool { + if o == nil || IsNil(o.Active.Get()) { + var ret bool + return ret + } + return *o.Active.Get() +} + +// GetActiveOk returns a tuple with the Active field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserCollectionItem) GetActiveOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.Active.Get(), o.Active.IsSet() +} + +// HasActive returns a boolean if a field has been set. +func (o *UserCollectionItem) HasActive() bool { + if o != nil && o.Active.IsSet() { + return true + } + + return false +} + +// SetActive gets a reference to the given NullableBool and assigns it to the Active field. +func (o *UserCollectionItem) SetActive(v bool) { + o.Active.Set(&v) +} +// SetActiveNil sets the value for Active to be an explicit nil +func (o *UserCollectionItem) SetActiveNil() { + o.Active.Set(nil) +} + +// UnsetActive ensures that no value is present for Active, not even an explicit nil +func (o *UserCollectionItem) UnsetActive() { + o.Active.Unset() +} + +// GetChangedOn returns the ChangedOn field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UserCollectionItem) GetChangedOn() string { + if o == nil || IsNil(o.ChangedOn.Get()) { + var ret string + return ret + } + return *o.ChangedOn.Get() +} + +// GetChangedOnOk returns a tuple with the ChangedOn field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserCollectionItem) GetChangedOnOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ChangedOn.Get(), o.ChangedOn.IsSet() +} + +// HasChangedOn returns a boolean if a field has been set. +func (o *UserCollectionItem) HasChangedOn() bool { + if o != nil && o.ChangedOn.IsSet() { + return true + } + + return false +} + +// SetChangedOn gets a reference to the given NullableString and assigns it to the ChangedOn field. +func (o *UserCollectionItem) SetChangedOn(v string) { + o.ChangedOn.Set(&v) +} +// SetChangedOnNil sets the value for ChangedOn to be an explicit nil +func (o *UserCollectionItem) SetChangedOnNil() { + o.ChangedOn.Set(nil) +} + +// UnsetChangedOn ensures that no value is present for ChangedOn, not even an explicit nil +func (o *UserCollectionItem) UnsetChangedOn() { + o.ChangedOn.Unset() +} + +// GetCreatedOn returns the CreatedOn field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UserCollectionItem) GetCreatedOn() string { + if o == nil || IsNil(o.CreatedOn.Get()) { + var ret string + return ret + } + return *o.CreatedOn.Get() +} + +// GetCreatedOnOk returns a tuple with the CreatedOn field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserCollectionItem) GetCreatedOnOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CreatedOn.Get(), o.CreatedOn.IsSet() +} + +// HasCreatedOn returns a boolean if a field has been set. +func (o *UserCollectionItem) HasCreatedOn() bool { + if o != nil && o.CreatedOn.IsSet() { + return true + } + + return false +} + +// SetCreatedOn gets a reference to the given NullableString and assigns it to the CreatedOn field. +func (o *UserCollectionItem) SetCreatedOn(v string) { + o.CreatedOn.Set(&v) +} +// SetCreatedOnNil sets the value for CreatedOn to be an explicit nil +func (o *UserCollectionItem) SetCreatedOnNil() { + o.CreatedOn.Set(nil) +} + +// UnsetCreatedOn ensures that no value is present for CreatedOn, not even an explicit nil +func (o *UserCollectionItem) UnsetCreatedOn() { + o.CreatedOn.Unset() +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *UserCollectionItem) GetEmail() string { + if o == nil || IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCollectionItem) GetEmailOk() (*string, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *UserCollectionItem) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *UserCollectionItem) SetEmail(v string) { + o.Email = &v +} + +// GetFailedLoginCount returns the FailedLoginCount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UserCollectionItem) GetFailedLoginCount() int32 { + if o == nil || IsNil(o.FailedLoginCount.Get()) { + var ret int32 + return ret + } + return *o.FailedLoginCount.Get() +} + +// GetFailedLoginCountOk returns a tuple with the FailedLoginCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserCollectionItem) GetFailedLoginCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.FailedLoginCount.Get(), o.FailedLoginCount.IsSet() +} + +// HasFailedLoginCount returns a boolean if a field has been set. +func (o *UserCollectionItem) HasFailedLoginCount() bool { + if o != nil && o.FailedLoginCount.IsSet() { + return true + } + + return false +} + +// SetFailedLoginCount gets a reference to the given NullableInt32 and assigns it to the FailedLoginCount field. +func (o *UserCollectionItem) SetFailedLoginCount(v int32) { + o.FailedLoginCount.Set(&v) +} +// SetFailedLoginCountNil sets the value for FailedLoginCount to be an explicit nil +func (o *UserCollectionItem) SetFailedLoginCountNil() { + o.FailedLoginCount.Set(nil) +} + +// UnsetFailedLoginCount ensures that no value is present for FailedLoginCount, not even an explicit nil +func (o *UserCollectionItem) UnsetFailedLoginCount() { + o.FailedLoginCount.Unset() +} + +// GetFirstName returns the FirstName field value if set, zero value otherwise. +func (o *UserCollectionItem) GetFirstName() string { + if o == nil || IsNil(o.FirstName) { + var ret string + return ret + } + return *o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCollectionItem) GetFirstNameOk() (*string, bool) { + if o == nil || IsNil(o.FirstName) { + return nil, false + } + return o.FirstName, true +} + +// HasFirstName returns a boolean if a field has been set. +func (o *UserCollectionItem) HasFirstName() bool { + if o != nil && !IsNil(o.FirstName) { + return true + } + + return false +} + +// SetFirstName gets a reference to the given string and assigns it to the FirstName field. +func (o *UserCollectionItem) SetFirstName(v string) { + o.FirstName = &v +} + +// GetLastLogin returns the LastLogin field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UserCollectionItem) GetLastLogin() string { + if o == nil || IsNil(o.LastLogin.Get()) { + var ret string + return ret + } + return *o.LastLogin.Get() +} + +// GetLastLoginOk returns a tuple with the LastLogin field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserCollectionItem) GetLastLoginOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.LastLogin.Get(), o.LastLogin.IsSet() +} + +// HasLastLogin returns a boolean if a field has been set. +func (o *UserCollectionItem) HasLastLogin() bool { + if o != nil && o.LastLogin.IsSet() { + return true + } + + return false +} + +// SetLastLogin gets a reference to the given NullableString and assigns it to the LastLogin field. +func (o *UserCollectionItem) SetLastLogin(v string) { + o.LastLogin.Set(&v) +} +// SetLastLoginNil sets the value for LastLogin to be an explicit nil +func (o *UserCollectionItem) SetLastLoginNil() { + o.LastLogin.Set(nil) +} + +// UnsetLastLogin ensures that no value is present for LastLogin, not even an explicit nil +func (o *UserCollectionItem) UnsetLastLogin() { + o.LastLogin.Unset() +} + +// GetLastName returns the LastName field value if set, zero value otherwise. +func (o *UserCollectionItem) GetLastName() string { + if o == nil || IsNil(o.LastName) { + var ret string + return ret + } + return *o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCollectionItem) GetLastNameOk() (*string, bool) { + if o == nil || IsNil(o.LastName) { + return nil, false + } + return o.LastName, true +} + +// HasLastName returns a boolean if a field has been set. +func (o *UserCollectionItem) HasLastName() bool { + if o != nil && !IsNil(o.LastName) { + return true + } + + return false +} + +// SetLastName gets a reference to the given string and assigns it to the LastName field. +func (o *UserCollectionItem) SetLastName(v string) { + o.LastName = &v +} + +// GetLoginCount returns the LoginCount field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UserCollectionItem) GetLoginCount() int32 { + if o == nil || IsNil(o.LoginCount.Get()) { + var ret int32 + return ret + } + return *o.LoginCount.Get() +} + +// GetLoginCountOk returns a tuple with the LoginCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserCollectionItem) GetLoginCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.LoginCount.Get(), o.LoginCount.IsSet() +} + +// HasLoginCount returns a boolean if a field has been set. +func (o *UserCollectionItem) HasLoginCount() bool { + if o != nil && o.LoginCount.IsSet() { + return true + } + + return false +} + +// SetLoginCount gets a reference to the given NullableInt32 and assigns it to the LoginCount field. +func (o *UserCollectionItem) SetLoginCount(v int32) { + o.LoginCount.Set(&v) +} +// SetLoginCountNil sets the value for LoginCount to be an explicit nil +func (o *UserCollectionItem) SetLoginCountNil() { + o.LoginCount.Set(nil) +} + +// UnsetLoginCount ensures that no value is present for LoginCount, not even an explicit nil +func (o *UserCollectionItem) UnsetLoginCount() { + o.LoginCount.Unset() +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *UserCollectionItem) GetRoles() []UserCollectionItemRolesInner { + if o == nil || IsNil(o.Roles) { + var ret []UserCollectionItemRolesInner + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCollectionItem) GetRolesOk() ([]UserCollectionItemRolesInner, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *UserCollectionItem) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []UserCollectionItemRolesInner and assigns it to the Roles field. +func (o *UserCollectionItem) SetRoles(v []UserCollectionItemRolesInner) { + o.Roles = v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *UserCollectionItem) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCollectionItem) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *UserCollectionItem) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *UserCollectionItem) SetUsername(v string) { + o.Username = &v +} + +func (o UserCollectionItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserCollectionItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Active.IsSet() { + toSerialize["active"] = o.Active.Get() + } + if o.ChangedOn.IsSet() { + toSerialize["changed_on"] = o.ChangedOn.Get() + } + if o.CreatedOn.IsSet() { + toSerialize["created_on"] = o.CreatedOn.Get() + } + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + if o.FailedLoginCount.IsSet() { + toSerialize["failed_login_count"] = o.FailedLoginCount.Get() + } + if !IsNil(o.FirstName) { + toSerialize["first_name"] = o.FirstName + } + if o.LastLogin.IsSet() { + toSerialize["last_login"] = o.LastLogin.Get() + } + if !IsNil(o.LastName) { + toSerialize["last_name"] = o.LastName + } + if o.LoginCount.IsSet() { + toSerialize["login_count"] = o.LoginCount.Get() + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + return toSerialize, nil +} + +type NullableUserCollectionItem struct { + value *UserCollectionItem + isSet bool +} + +func (v NullableUserCollectionItem) Get() *UserCollectionItem { + return v.value +} + +func (v *NullableUserCollectionItem) Set(val *UserCollectionItem) { + v.value = val + v.isSet = true +} + +func (v NullableUserCollectionItem) IsSet() bool { + return v.isSet +} + +func (v *NullableUserCollectionItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserCollectionItem(val *UserCollectionItem) *NullableUserCollectionItem { + return &NullableUserCollectionItem{value: val, isSet: true} +} + +func (v NullableUserCollectionItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserCollectionItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/auth/fab/model_user_collection_item_roles_inner.go b/airflow/auth/fab/model_user_collection_item_roles_inner.go new file mode 100644 index 0000000..3668ee1 --- /dev/null +++ b/airflow/auth/fab/model_user_collection_item_roles_inner.go @@ -0,0 +1,127 @@ +/* +Flask App Builder User & Role API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package fab + +import ( + "encoding/json" +) + +// checks if the UserCollectionItemRolesInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserCollectionItemRolesInner{} + +// UserCollectionItemRolesInner struct for UserCollectionItemRolesInner +type UserCollectionItemRolesInner struct { + Name *string `json:"name,omitempty"` +} + +// NewUserCollectionItemRolesInner instantiates a new UserCollectionItemRolesInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserCollectionItemRolesInner() *UserCollectionItemRolesInner { + this := UserCollectionItemRolesInner{} + return &this +} + +// NewUserCollectionItemRolesInnerWithDefaults instantiates a new UserCollectionItemRolesInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserCollectionItemRolesInnerWithDefaults() *UserCollectionItemRolesInner { + this := UserCollectionItemRolesInner{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UserCollectionItemRolesInner) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserCollectionItemRolesInner) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UserCollectionItemRolesInner) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UserCollectionItemRolesInner) SetName(v string) { + o.Name = &v +} + +func (o UserCollectionItemRolesInner) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserCollectionItemRolesInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableUserCollectionItemRolesInner struct { + value *UserCollectionItemRolesInner + isSet bool +} + +func (v NullableUserCollectionItemRolesInner) Get() *UserCollectionItemRolesInner { + return v.value +} + +func (v *NullableUserCollectionItemRolesInner) Set(val *UserCollectionItemRolesInner) { + v.value = val + v.isSet = true +} + +func (v NullableUserCollectionItemRolesInner) IsSet() bool { + return v.isSet +} + +func (v *NullableUserCollectionItemRolesInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserCollectionItemRolesInner(val *UserCollectionItemRolesInner) *NullableUserCollectionItemRolesInner { + return &NullableUserCollectionItemRolesInner{value: val, isSet: true} +} + +func (v NullableUserCollectionItemRolesInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserCollectionItemRolesInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/airflow/auth/fab/response.go b/airflow/auth/fab/response.go new file mode 100644 index 0000000..f2ab968 --- /dev/null +++ b/airflow/auth/fab/response.go @@ -0,0 +1,48 @@ +/* +Flask App Builder User & Role API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package fab + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/airflow/auth/fab/test/api_permission_test.go b/airflow/auth/fab/test/api_permission_test.go new file mode 100644 index 0000000..2e8facf --- /dev/null +++ b/airflow/auth/fab/test/api_permission_test.go @@ -0,0 +1,37 @@ +/* +Flask App Builder User & Role API + +Testing PermissionAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package fab + +import ( + openapiclient "./airflow" + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func Test_fab_PermissionAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test PermissionAPIService GetPermissions", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.PermissionAPI.GetPermissions(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/airflow/auth/fab/test/api_role_test.go b/airflow/auth/fab/test/api_role_test.go new file mode 100644 index 0000000..866eca6 --- /dev/null +++ b/airflow/auth/fab/test/api_role_test.go @@ -0,0 +1,90 @@ +/* +Flask App Builder User & Role API + +Testing RoleAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package fab + +import ( + openapiclient "./airflow" + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func Test_fab_RoleAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test RoleAPIService DeleteRole", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var roleName string + + httpRes, err := apiClient.RoleAPI.DeleteRole(context.Background(), roleName).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test RoleAPIService GetRole", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var roleName string + + resp, httpRes, err := apiClient.RoleAPI.GetRole(context.Background(), roleName).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test RoleAPIService GetRoles", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.RoleAPI.GetRoles(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test RoleAPIService PatchRole", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var roleName string + + resp, httpRes, err := apiClient.RoleAPI.PatchRole(context.Background(), roleName).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test RoleAPIService PostRole", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.RoleAPI.PostRole(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/airflow/auth/fab/test/api_user_test.go b/airflow/auth/fab/test/api_user_test.go new file mode 100644 index 0000000..92446e6 --- /dev/null +++ b/airflow/auth/fab/test/api_user_test.go @@ -0,0 +1,90 @@ +/* +Flask App Builder User & Role API + +Testing UserAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package fab + +import ( + openapiclient "./airflow" + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" +) + +func Test_fab_UserAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test UserAPIService DeleteUser", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var username string + + httpRes, err := apiClient.UserAPI.DeleteUser(context.Background(), username).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test UserAPIService GetUser", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var username string + + resp, httpRes, err := apiClient.UserAPI.GetUser(context.Background(), username).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test UserAPIService GetUsers", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.UserAPI.GetUsers(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test UserAPIService PatchUser", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var username string + + resp, httpRes, err := apiClient.UserAPI.PatchUser(context.Background(), username).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test UserAPIService PostUser", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.UserAPI.PostUser(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/airflow/auth/fab/utils.go b/airflow/auth/fab/utils.go new file mode 100644 index 0000000..5095e4b --- /dev/null +++ b/airflow/auth/fab/utils.go @@ -0,0 +1,362 @@ +/* +Flask App Builder User & Role API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.0.0 +Contact: dev@airflow.apache.org +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package fab + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} \ No newline at end of file From ccea1125980b7a182ee9eb6502d4c78053156cbf Mon Sep 17 00:00:00 2001 From: Mikhail Nacharov <1246847+mnacharov@users.noreply.github.com> Date: Thu, 22 May 2025 20:47:18 +0200 Subject: [PATCH 3/3] added v2.10.0 version into CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50f9be7..4b2c609 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,12 @@ under the License. --> +# v2.10.0 + +Apache Airflow API version: 2.10.x + +Apache Airflow Auth Fab API Version: 1.5.x + # v2.5.0 Apache Airflow API version: 2.5.x