Exemplo n.º 1
0
    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

        def __delete_variable(self, variable_key, **kwargs):
            """Delete a variable  # noqa: E501

            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.delete_variable(variable_key, async_req=True)
            >>> result = thread.get()

            Args:
                variable_key (str): The variable Key.

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                None
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['variable_key'] = \
                variable_key
            return self.call_with_http_info(**kwargs)

        self.delete_variable = _Endpoint(settings={
            'response_type': None,
            'auth': ['Basic', 'Kerberos'],
            'endpoint_path': '/variables/{variable_key}',
            'operation_id': 'delete_variable',
            'http_method': 'DELETE',
            'servers': None,
        },
                                         params_map={
                                             'all': [
                                                 'variable_key',
                                             ],
                                             'required': [
                                                 'variable_key',
                                             ],
                                             'nullable': [],
                                             'enum': [],
                                             'validation': []
                                         },
                                         root_map={
                                             'validations': {},
                                             'allowed_values': {},
                                             'openapi_types': {
                                                 'variable_key': (str, ),
                                             },
                                             'attribute_map': {
                                                 'variable_key':
                                                 'variable_key',
                                             },
                                             'location_map': {
                                                 'variable_key': 'path',
                                             },
                                             'collection_format_map': {}
                                         },
                                         headers_map={
                                             'accept': ['application/json'],
                                             'content_type': [],
                                         },
                                         api_client=api_client,
                                         callable=__delete_variable)

        def __get_variable(self, variable_key, **kwargs):
            """Get a variable  # noqa: E501

            Get a variable by key.  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.get_variable(variable_key, async_req=True)
            >>> result = thread.get()

            Args:
                variable_key (str): The variable Key.

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                Variable
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['variable_key'] = \
                variable_key
            return self.call_with_http_info(**kwargs)

        self.get_variable = _Endpoint(settings={
            'response_type': (Variable, ),
            'auth': ['Basic', 'Kerberos'],
            'endpoint_path': '/variables/{variable_key}',
            'operation_id': 'get_variable',
            'http_method': 'GET',
            'servers': None,
        },
                                      params_map={
                                          'all': [
                                              'variable_key',
                                          ],
                                          'required': [
                                              'variable_key',
                                          ],
                                          'nullable': [],
                                          'enum': [],
                                          'validation': []
                                      },
                                      root_map={
                                          'validations': {},
                                          'allowed_values': {},
                                          'openapi_types': {
                                              'variable_key': (str, ),
                                          },
                                          'attribute_map': {
                                              'variable_key': 'variable_key',
                                          },
                                          'location_map': {
                                              'variable_key': 'path',
                                          },
                                          'collection_format_map': {}
                                      },
                                      headers_map={
                                          'accept': ['application/json'],
                                          'content_type': [],
                                      },
                                      api_client=api_client,
                                      callable=__get_variable)

        def __get_variables(self, **kwargs):
            """List variables  # noqa: E501

            The collection does not contain data. To get data, you must get a single entity.  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.get_variables(async_req=True)
            >>> result = thread.get()


            Keyword Args:
                limit (int): The numbers of items to return.. [optional] if omitted the server will use the default value of 100
                offset (int): The number of items to skip before starting to collect the result set.. [optional]
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                VariableCollection
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            return self.call_with_http_info(**kwargs)

        self.get_variables = _Endpoint(settings={
            'response_type': (VariableCollection, ),
            'auth': ['Basic', 'Kerberos'],
            'endpoint_path': '/variables',
            'operation_id': 'get_variables',
            'http_method': 'GET',
            'servers': None,
        },
                                       params_map={
                                           'all': [
                                               'limit',
                                               'offset',
                                           ],
                                           'required': [],
                                           'nullable': [],
                                           'enum': [],
                                           'validation': [
                                               'offset',
                                           ]
                                       },
                                       root_map={
                                           'validations': {
                                               ('offset', ): {
                                                   'inclusive_minimum': 0,
                                               },
                                           },
                                           'allowed_values': {},
                                           'openapi_types': {
                                               'limit': (int, ),
                                               'offset': (int, ),
                                           },
                                           'attribute_map': {
                                               'limit': 'limit',
                                               'offset': 'offset',
                                           },
                                           'location_map': {
                                               'limit': 'query',
                                               'offset': 'query',
                                           },
                                           'collection_format_map': {}
                                       },
                                       headers_map={
                                           'accept': ['application/json'],
                                           'content_type': [],
                                       },
                                       api_client=api_client,
                                       callable=__get_variables)

        def __patch_variable(self, variable_key, variable, **kwargs):
            """Update a variable  # noqa: E501

            Update a variable by key.  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.patch_variable(variable_key, variable, async_req=True)
            >>> result = thread.get()

            Args:
                variable_key (str): The variable Key.
                variable (Variable):

            Keyword Args:
                update_mask ([str]): 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]
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                Variable
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['variable_key'] = \
                variable_key
            kwargs['variable'] = \
                variable
            return self.call_with_http_info(**kwargs)

        self.patch_variable = _Endpoint(settings={
            'response_type': (Variable, ),
            'auth': ['Basic', 'Kerberos'],
            'endpoint_path': '/variables/{variable_key}',
            'operation_id': 'patch_variable',
            'http_method': 'PATCH',
            'servers': None,
        },
                                        params_map={
                                            'all': [
                                                'variable_key',
                                                'variable',
                                                'update_mask',
                                            ],
                                            'required': [
                                                'variable_key',
                                                'variable',
                                            ],
                                            'nullable': [],
                                            'enum': [],
                                            'validation': []
                                        },
                                        root_map={
                                            'validations': {},
                                            'allowed_values': {},
                                            'openapi_types': {
                                                'variable_key': (str, ),
                                                'variable': (Variable, ),
                                                'update_mask': ([str], ),
                                            },
                                            'attribute_map': {
                                                'variable_key': 'variable_key',
                                                'update_mask': 'update_mask',
                                            },
                                            'location_map': {
                                                'variable_key': 'path',
                                                'variable': 'body',
                                                'update_mask': 'query',
                                            },
                                            'collection_format_map': {
                                                'update_mask': 'csv',
                                            }
                                        },
                                        headers_map={
                                            'accept': ['application/json'],
                                            'content_type':
                                            ['application/json']
                                        },
                                        api_client=api_client,
                                        callable=__patch_variable)

        def __post_variables(self, variable, **kwargs):
            """Create a variable  # noqa: E501

            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.post_variables(variable, async_req=True)
            >>> result = thread.get()

            Args:
                variable (Variable):

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                Variable
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['variable'] = \
                variable
            return self.call_with_http_info(**kwargs)

        self.post_variables = _Endpoint(settings={
            'response_type': (Variable, ),
            'auth': ['Basic', 'Kerberos'],
            'endpoint_path': '/variables',
            'operation_id': 'post_variables',
            'http_method': 'POST',
            'servers': None,
        },
                                        params_map={
                                            'all': [
                                                'variable',
                                            ],
                                            'required': [
                                                'variable',
                                            ],
                                            'nullable': [],
                                            'enum': [],
                                            'validation': []
                                        },
                                        root_map={
                                            'validations': {},
                                            'allowed_values': {},
                                            'openapi_types': {
                                                'variable': (Variable, ),
                                            },
                                            'attribute_map': {},
                                            'location_map': {
                                                'variable': 'body',
                                            },
                                            'collection_format_map': {}
                                        },
                                        headers_map={
                                            'accept': ['application/json'],
                                            'content_type':
                                            ['application/json']
                                        },
                                        api_client=api_client,
                                        callable=__post_variables)
Exemplo n.º 2
0
 def __init__(self, api_client=None):
     if api_client is None:
         api_client = ApiClient()
     self.api_client = api_client
Exemplo n.º 3
0
    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

        def __get_role(self, role_name, **kwargs):
            """Get a role  # noqa: E501

            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.get_role(role_name, async_req=True)
            >>> result = thread.get()

            Args:
                role_name (str): The role name

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                Role
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['role_name'] = \
                role_name
            return self.call_with_http_info(**kwargs)

        self.get_role = _Endpoint(settings={
            'response_type': (Role, ),
            'auth': ['Basic', 'Kerberos'],
            'endpoint_path': '/roles/{role_name}',
            'operation_id': 'get_role',
            'http_method': 'GET',
            'servers': None,
        },
                                  params_map={
                                      'all': [
                                          'role_name',
                                      ],
                                      'required': [
                                          'role_name',
                                      ],
                                      'nullable': [],
                                      'enum': [],
                                      'validation': []
                                  },
                                  root_map={
                                      'validations': {},
                                      'allowed_values': {},
                                      'openapi_types': {
                                          'role_name': (str, ),
                                      },
                                      'attribute_map': {
                                          'role_name': 'role_name',
                                      },
                                      'location_map': {
                                          'role_name': 'path',
                                      },
                                      'collection_format_map': {}
                                  },
                                  headers_map={
                                      'accept': ['application/json'],
                                      'content_type': [],
                                  },
                                  api_client=api_client,
                                  callable=__get_role)

        def __get_roles(self, **kwargs):
            """List roles  # noqa: E501

            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.get_roles(async_req=True)
            >>> result = thread.get()


            Keyword Args:
                limit (int): The numbers of items to return.. [optional] if omitted the server will use the default value of 100
                offset (int): The number of items to skip before starting to collect the result set.. [optional]
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                RoleCollection
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            return self.call_with_http_info(**kwargs)

        self.get_roles = _Endpoint(settings={
            'response_type': (RoleCollection, ),
            'auth': ['Basic', 'Kerberos'],
            'endpoint_path': '/roles',
            'operation_id': 'get_roles',
            'http_method': 'GET',
            'servers': None,
        },
                                   params_map={
                                       'all': [
                                           'limit',
                                           'offset',
                                       ],
                                       'required': [],
                                       'nullable': [],
                                       'enum': [],
                                       'validation': [
                                           'offset',
                                       ]
                                   },
                                   root_map={
                                       'validations': {
                                           ('offset', ): {
                                               'inclusive_minimum': 0,
                                           },
                                       },
                                       'allowed_values': {},
                                       'openapi_types': {
                                           'limit': (int, ),
                                           'offset': (int, ),
                                       },
                                       'attribute_map': {
                                           'limit': 'limit',
                                           'offset': 'offset',
                                       },
                                       'location_map': {
                                           'limit': 'query',
                                           'offset': 'query',
                                       },
                                       'collection_format_map': {}
                                   },
                                   headers_map={
                                       'accept': ['application/json'],
                                       'content_type': [],
                                   },
                                   api_client=api_client,
                                   callable=__get_roles)
    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

        def __get_extra_links(
            self,
            dag_id,
            dag_run_id,
            task_id,
            **kwargs
        ):
            """List extra links  # noqa: E501

            List extra links for task instance.   # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.get_extra_links(dag_id, dag_run_id, task_id, async_req=True)
            >>> result = thread.get()

            Args:
                dag_id (str): The DAG ID.
                dag_run_id (str): The DAG run ID.
                task_id (str): The task ID.

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                ExtraLinkCollection
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get(
                'async_req', False
            )
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True
            )
            kwargs['_preload_content'] = kwargs.get(
                '_preload_content', True
            )
            kwargs['_request_timeout'] = kwargs.get(
                '_request_timeout', None
            )
            kwargs['_check_input_type'] = kwargs.get(
                '_check_input_type', True
            )
            kwargs['_check_return_type'] = kwargs.get(
                '_check_return_type', True
            )
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['dag_id'] = \
                dag_id
            kwargs['dag_run_id'] = \
                dag_run_id
            kwargs['task_id'] = \
                task_id
            return self.call_with_http_info(**kwargs)

        self.get_extra_links = _Endpoint(
            settings={
                'response_type': (ExtraLinkCollection,),
                'auth': [
                    'Basic',
                    'Kerberos'
                ],
                'endpoint_path': '/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/links',
                'operation_id': 'get_extra_links',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'dag_id',
                    'dag_run_id',
                    'task_id',
                ],
                'required': [
                    'dag_id',
                    'dag_run_id',
                    'task_id',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'dag_id':
                        (str,),
                    'dag_run_id':
                        (str,),
                    'task_id':
                        (str,),
                },
                'attribute_map': {
                    'dag_id': 'dag_id',
                    'dag_run_id': 'dag_run_id',
                    'task_id': 'task_id',
                },
                'location_map': {
                    'dag_id': 'path',
                    'dag_run_id': 'path',
                    'task_id': 'path',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client,
            callable=__get_extra_links
        )

        def __get_log(
            self,
            dag_id,
            dag_run_id,
            task_id,
            task_try_number,
            **kwargs
        ):
            """Get logs  # noqa: E501

            Get logs for a specific task instance and its try number.  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.get_log(dag_id, dag_run_id, task_id, task_try_number, async_req=True)
            >>> result = thread.get()

            Args:
                dag_id (str): The DAG ID.
                dag_run_id (str): The DAG run ID.
                task_id (str): The task ID.
                task_try_number (int): The task try number.

            Keyword Args:
                full_content (bool): A full content will be returned. By default, only the first fragment will be returned. . [optional]
                token (str): A token that allows you to continue fetching logs. If passed, it will specify the location from which the download should be continued. . [optional]
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                InlineResponse200
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get(
                'async_req', False
            )
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True
            )
            kwargs['_preload_content'] = kwargs.get(
                '_preload_content', True
            )
            kwargs['_request_timeout'] = kwargs.get(
                '_request_timeout', None
            )
            kwargs['_check_input_type'] = kwargs.get(
                '_check_input_type', True
            )
            kwargs['_check_return_type'] = kwargs.get(
                '_check_return_type', True
            )
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['dag_id'] = \
                dag_id
            kwargs['dag_run_id'] = \
                dag_run_id
            kwargs['task_id'] = \
                task_id
            kwargs['task_try_number'] = \
                task_try_number
            return self.call_with_http_info(**kwargs)

        self.get_log = _Endpoint(
            settings={
                'response_type': (InlineResponse200,),
                'auth': [
                    'Basic',
                    'Kerberos'
                ],
                'endpoint_path': '/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/logs/{task_try_number}',
                'operation_id': 'get_log',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'dag_id',
                    'dag_run_id',
                    'task_id',
                    'task_try_number',
                    'full_content',
                    'token',
                ],
                'required': [
                    'dag_id',
                    'dag_run_id',
                    'task_id',
                    'task_try_number',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'dag_id':
                        (str,),
                    'dag_run_id':
                        (str,),
                    'task_id':
                        (str,),
                    'task_try_number':
                        (int,),
                    'full_content':
                        (bool,),
                    'token':
                        (str,),
                },
                'attribute_map': {
                    'dag_id': 'dag_id',
                    'dag_run_id': 'dag_run_id',
                    'task_id': 'task_id',
                    'task_try_number': 'task_try_number',
                    'full_content': 'full_content',
                    'token': 'token',
                },
                'location_map': {
                    'dag_id': 'path',
                    'dag_run_id': 'path',
                    'task_id': 'path',
                    'task_try_number': 'path',
                    'full_content': 'query',
                    'token': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json',
                    'text/plain'
                ],
                'content_type': [],
            },
            api_client=api_client,
            callable=__get_log
        )

        def __get_task_instance(
            self,
            dag_id,
            dag_run_id,
            task_id,
            **kwargs
        ):
            """Get a task instance  # noqa: E501

            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.get_task_instance(dag_id, dag_run_id, task_id, async_req=True)
            >>> result = thread.get()

            Args:
                dag_id (str): The DAG ID.
                dag_run_id (str): The DAG run ID.
                task_id (str): The task ID.

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                TaskInstance
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get(
                'async_req', False
            )
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True
            )
            kwargs['_preload_content'] = kwargs.get(
                '_preload_content', True
            )
            kwargs['_request_timeout'] = kwargs.get(
                '_request_timeout', None
            )
            kwargs['_check_input_type'] = kwargs.get(
                '_check_input_type', True
            )
            kwargs['_check_return_type'] = kwargs.get(
                '_check_return_type', True
            )
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['dag_id'] = \
                dag_id
            kwargs['dag_run_id'] = \
                dag_run_id
            kwargs['task_id'] = \
                task_id
            return self.call_with_http_info(**kwargs)

        self.get_task_instance = _Endpoint(
            settings={
                'response_type': (TaskInstance,),
                'auth': [
                    'Basic',
                    'Kerberos'
                ],
                'endpoint_path': '/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}',
                'operation_id': 'get_task_instance',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'dag_id',
                    'dag_run_id',
                    'task_id',
                ],
                'required': [
                    'dag_id',
                    'dag_run_id',
                    'task_id',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'dag_id':
                        (str,),
                    'dag_run_id':
                        (str,),
                    'task_id':
                        (str,),
                },
                'attribute_map': {
                    'dag_id': 'dag_id',
                    'dag_run_id': 'dag_run_id',
                    'task_id': 'task_id',
                },
                'location_map': {
                    'dag_id': 'path',
                    'dag_run_id': 'path',
                    'task_id': 'path',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client,
            callable=__get_task_instance
        )

        def __get_task_instances(
            self,
            dag_id,
            dag_run_id,
            **kwargs
        ):
            """List task instances  # noqa: E501

            This endpoint allows specifying `~` as the dag_id, dag_run_id to retrieve DAG runs for all DAGs and DAG runs.   # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.get_task_instances(dag_id, dag_run_id, async_req=True)
            >>> result = thread.get()

            Args:
                dag_id (str): The DAG ID.
                dag_run_id (str): The DAG run ID.

            Keyword Args:
                execution_date_gte (datetime): 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]
                execution_date_lte (datetime): 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]
                start_date_gte (datetime): Returns objects greater or equal the specified date.  This can be combined with start_date_lte parameter to receive only the selected period. . [optional]
                start_date_lte (datetime): Returns objects less or equal the specified date.  This can be combined with start_date_gte parameter to receive only the selected period. . [optional]
                end_date_gte (datetime): Returns objects greater or equal the specified date.  This can be combined with start_date_lte parameter to receive only the selected period. . [optional]
                end_date_lte (datetime): 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]
                duration_gte (float): 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]
                duration_lte (float): 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 ([str]): The value can be repeated to retrieve multiple matching values (OR condition).. [optional]
                pool ([str]): The value can be repeated to retrieve multiple matching values (OR condition).. [optional]
                queue ([str]): The value can be repeated to retrieve multiple matching values (OR condition).. [optional]
                limit (int): The numbers of items to return.. [optional] if omitted the server will use the default value of 100
                offset (int): The number of items to skip before starting to collect the result set.. [optional]
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                TaskInstanceCollection
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get(
                'async_req', False
            )
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True
            )
            kwargs['_preload_content'] = kwargs.get(
                '_preload_content', True
            )
            kwargs['_request_timeout'] = kwargs.get(
                '_request_timeout', None
            )
            kwargs['_check_input_type'] = kwargs.get(
                '_check_input_type', True
            )
            kwargs['_check_return_type'] = kwargs.get(
                '_check_return_type', True
            )
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['dag_id'] = \
                dag_id
            kwargs['dag_run_id'] = \
                dag_run_id
            return self.call_with_http_info(**kwargs)

        self.get_task_instances = _Endpoint(
            settings={
                'response_type': (TaskInstanceCollection,),
                'auth': [
                    'Basic',
                    'Kerberos'
                ],
                'endpoint_path': '/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances',
                'operation_id': 'get_task_instances',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'dag_id',
                    'dag_run_id',
                    'execution_date_gte',
                    'execution_date_lte',
                    'start_date_gte',
                    'start_date_lte',
                    'end_date_gte',
                    'end_date_lte',
                    'duration_gte',
                    'duration_lte',
                    'state',
                    'pool',
                    'queue',
                    'limit',
                    'offset',
                ],
                'required': [
                    'dag_id',
                    'dag_run_id',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                    'offset',
                ]
            },
            root_map={
                'validations': {
                    ('offset',): {

                        'inclusive_minimum': 0,
                    },
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'dag_id':
                        (str,),
                    'dag_run_id':
                        (str,),
                    'execution_date_gte':
                        (datetime,),
                    'execution_date_lte':
                        (datetime,),
                    'start_date_gte':
                        (datetime,),
                    'start_date_lte':
                        (datetime,),
                    'end_date_gte':
                        (datetime,),
                    'end_date_lte':
                        (datetime,),
                    'duration_gte':
                        (float,),
                    'duration_lte':
                        (float,),
                    'state':
                        ([str],),
                    'pool':
                        ([str],),
                    'queue':
                        ([str],),
                    'limit':
                        (int,),
                    'offset':
                        (int,),
                },
                'attribute_map': {
                    'dag_id': 'dag_id',
                    'dag_run_id': 'dag_run_id',
                    'execution_date_gte': 'execution_date_gte',
                    'execution_date_lte': 'execution_date_lte',
                    'start_date_gte': 'start_date_gte',
                    'start_date_lte': 'start_date_lte',
                    'end_date_gte': 'end_date_gte',
                    'end_date_lte': 'end_date_lte',
                    'duration_gte': 'duration_gte',
                    'duration_lte': 'duration_lte',
                    'state': 'state',
                    'pool': 'pool',
                    'queue': 'queue',
                    'limit': 'limit',
                    'offset': 'offset',
                },
                'location_map': {
                    'dag_id': 'path',
                    'dag_run_id': 'path',
                    'execution_date_gte': 'query',
                    'execution_date_lte': 'query',
                    'start_date_gte': 'query',
                    'start_date_lte': 'query',
                    'end_date_gte': 'query',
                    'end_date_lte': 'query',
                    'duration_gte': 'query',
                    'duration_lte': 'query',
                    'state': 'query',
                    'pool': 'query',
                    'queue': 'query',
                    'limit': 'query',
                    'offset': 'query',
                },
                'collection_format_map': {
                    'state': 'multi',
                    'pool': 'multi',
                    'queue': 'multi',
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client,
            callable=__get_task_instances
        )

        def __get_task_instances_batch(
            self,
            list_task_instance_form,
            **kwargs
        ):
            """List task instances (batch)  # noqa: E501

            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.   # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.get_task_instances_batch(list_task_instance_form, async_req=True)
            >>> result = thread.get()

            Args:
                list_task_instance_form (ListTaskInstanceForm):

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                TaskInstanceCollection
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get(
                'async_req', False
            )
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True
            )
            kwargs['_preload_content'] = kwargs.get(
                '_preload_content', True
            )
            kwargs['_request_timeout'] = kwargs.get(
                '_request_timeout', None
            )
            kwargs['_check_input_type'] = kwargs.get(
                '_check_input_type', True
            )
            kwargs['_check_return_type'] = kwargs.get(
                '_check_return_type', True
            )
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['list_task_instance_form'] = \
                list_task_instance_form
            return self.call_with_http_info(**kwargs)

        self.get_task_instances_batch = _Endpoint(
            settings={
                'response_type': (TaskInstanceCollection,),
                'auth': [
                    'Basic',
                    'Kerberos'
                ],
                'endpoint_path': '/dags/~/dagRuns/~/taskInstances/list',
                'operation_id': 'get_task_instances_batch',
                'http_method': 'POST',
                'servers': None,
            },
            params_map={
                'all': [
                    'list_task_instance_form',
                ],
                'required': [
                    'list_task_instance_form',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'list_task_instance_form':
                        (ListTaskInstanceForm,),
                },
                'attribute_map': {
                },
                'location_map': {
                    'list_task_instance_form': 'body',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [
                    'application/json'
                ]
            },
            api_client=api_client,
            callable=__get_task_instances_batch
        )
Exemplo n.º 5
0
    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

        def __get_config(
            self,
            **kwargs
        ):
            """Get current configuration  # noqa: E501

            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.get_config(async_req=True)
            >>> result = thread.get()


            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                Config
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get(
                'async_req', False
            )
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True
            )
            kwargs['_preload_content'] = kwargs.get(
                '_preload_content', True
            )
            kwargs['_request_timeout'] = kwargs.get(
                '_request_timeout', None
            )
            kwargs['_check_input_type'] = kwargs.get(
                '_check_input_type', True
            )
            kwargs['_check_return_type'] = kwargs.get(
                '_check_return_type', True
            )
            kwargs['_host_index'] = kwargs.get('_host_index')
            return self.call_with_http_info(**kwargs)

        self.get_config = _Endpoint(
            settings={
                'response_type': (Config,),
                'auth': [
                    'Basic',
                    'Kerberos'
                ],
                'endpoint_path': '/config',
                'operation_id': 'get_config',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                ],
                'required': [],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                },
                'attribute_map': {
                },
                'location_map': {
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json',
                    'text/plain'
                ],
                'content_type': [],
            },
            api_client=api_client,
            callable=__get_config
        )
Exemplo n.º 6
0
    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

        def __delete_dag_run(self, dag_id, dag_run_id, **kwargs):
            """Delete a DAG run  # noqa: E501

            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.delete_dag_run(dag_id, dag_run_id, async_req=True)
            >>> result = thread.get()

            Args:
                dag_id (str): The DAG ID.
                dag_run_id (str): The DAG run ID.

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                None
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['dag_id'] = \
                dag_id
            kwargs['dag_run_id'] = \
                dag_run_id
            return self.call_with_http_info(**kwargs)

        self.delete_dag_run = _Endpoint(settings={
            'response_type': None,
            'auth': ['Basic', 'Kerberos'],
            'endpoint_path': '/dags/{dag_id}/dagRuns/{dag_run_id}',
            'operation_id': 'delete_dag_run',
            'http_method': 'DELETE',
            'servers': None,
        },
                                        params_map={
                                            'all': [
                                                'dag_id',
                                                'dag_run_id',
                                            ],
                                            'required': [
                                                'dag_id',
                                                'dag_run_id',
                                            ],
                                            'nullable': [],
                                            'enum': [],
                                            'validation': []
                                        },
                                        root_map={
                                            'validations': {},
                                            'allowed_values': {},
                                            'openapi_types': {
                                                'dag_id': (str, ),
                                                'dag_run_id': (str, ),
                                            },
                                            'attribute_map': {
                                                'dag_id': 'dag_id',
                                                'dag_run_id': 'dag_run_id',
                                            },
                                            'location_map': {
                                                'dag_id': 'path',
                                                'dag_run_id': 'path',
                                            },
                                            'collection_format_map': {}
                                        },
                                        headers_map={
                                            'accept': ['application/json'],
                                            'content_type': [],
                                        },
                                        api_client=api_client,
                                        callable=__delete_dag_run)

        def __get_dag_run(self, dag_id, dag_run_id, **kwargs):
            """Get a DAG run  # noqa: E501

            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.get_dag_run(dag_id, dag_run_id, async_req=True)
            >>> result = thread.get()

            Args:
                dag_id (str): The DAG ID.
                dag_run_id (str): The DAG run ID.

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                DAGRun
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['dag_id'] = \
                dag_id
            kwargs['dag_run_id'] = \
                dag_run_id
            return self.call_with_http_info(**kwargs)

        self.get_dag_run = _Endpoint(settings={
            'response_type': (DAGRun, ),
            'auth': ['Basic', 'Kerberos'],
            'endpoint_path': '/dags/{dag_id}/dagRuns/{dag_run_id}',
            'operation_id': 'get_dag_run',
            'http_method': 'GET',
            'servers': None,
        },
                                     params_map={
                                         'all': [
                                             'dag_id',
                                             'dag_run_id',
                                         ],
                                         'required': [
                                             'dag_id',
                                             'dag_run_id',
                                         ],
                                         'nullable': [],
                                         'enum': [],
                                         'validation': []
                                     },
                                     root_map={
                                         'validations': {},
                                         'allowed_values': {},
                                         'openapi_types': {
                                             'dag_id': (str, ),
                                             'dag_run_id': (str, ),
                                         },
                                         'attribute_map': {
                                             'dag_id': 'dag_id',
                                             'dag_run_id': 'dag_run_id',
                                         },
                                         'location_map': {
                                             'dag_id': 'path',
                                             'dag_run_id': 'path',
                                         },
                                         'collection_format_map': {}
                                     },
                                     headers_map={
                                         'accept': ['application/json'],
                                         'content_type': [],
                                     },
                                     api_client=api_client,
                                     callable=__get_dag_run)

        def __get_dag_runs(self, dag_id, **kwargs):
            """List DAG runs  # noqa: E501

            This endpoint allows specifying `~` as the dag_id to retrieve DAG runs for all DAGs.   # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.get_dag_runs(dag_id, async_req=True)
            >>> result = thread.get()

            Args:
                dag_id (str): The DAG ID.

            Keyword Args:
                limit (int): The numbers of items to return.. [optional] if omitted the server will use the default value of 100
                offset (int): The number of items to skip before starting to collect the result set.. [optional]
                execution_date_gte (datetime): 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]
                execution_date_lte (datetime): 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]
                start_date_gte (datetime): Returns objects greater or equal the specified date.  This can be combined with start_date_lte parameter to receive only the selected period. . [optional]
                start_date_lte (datetime): Returns objects less or equal the specified date.  This can be combined with start_date_gte parameter to receive only the selected period. . [optional]
                end_date_gte (datetime): Returns objects greater or equal the specified date.  This can be combined with start_date_lte parameter to receive only the selected period. . [optional]
                end_date_lte (datetime): 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]
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                DAGRunCollection
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['dag_id'] = \
                dag_id
            return self.call_with_http_info(**kwargs)

        self.get_dag_runs = _Endpoint(
            settings={
                'response_type': (DAGRunCollection, ),
                'auth': ['Basic', 'Kerberos'],
                'endpoint_path': '/dags/{dag_id}/dagRuns',
                'operation_id': 'get_dag_runs',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'dag_id',
                    'limit',
                    'offset',
                    'execution_date_gte',
                    'execution_date_lte',
                    'start_date_gte',
                    'start_date_lte',
                    'end_date_gte',
                    'end_date_lte',
                ],
                'required': [
                    'dag_id',
                ],
                'nullable': [],
                'enum': [],
                'validation': [
                    'offset',
                ]
            },
            root_map={
                'validations': {
                    ('offset', ): {
                        'inclusive_minimum': 0,
                    },
                },
                'allowed_values': {},
                'openapi_types': {
                    'dag_id': (str, ),
                    'limit': (int, ),
                    'offset': (int, ),
                    'execution_date_gte': (datetime, ),
                    'execution_date_lte': (datetime, ),
                    'start_date_gte': (datetime, ),
                    'start_date_lte': (datetime, ),
                    'end_date_gte': (datetime, ),
                    'end_date_lte': (datetime, ),
                },
                'attribute_map': {
                    'dag_id': 'dag_id',
                    'limit': 'limit',
                    'offset': 'offset',
                    'execution_date_gte': 'execution_date_gte',
                    'execution_date_lte': 'execution_date_lte',
                    'start_date_gte': 'start_date_gte',
                    'start_date_lte': 'start_date_lte',
                    'end_date_gte': 'end_date_gte',
                    'end_date_lte': 'end_date_lte',
                },
                'location_map': {
                    'dag_id': 'path',
                    'limit': 'query',
                    'offset': 'query',
                    'execution_date_gte': 'query',
                    'execution_date_lte': 'query',
                    'start_date_gte': 'query',
                    'start_date_lte': 'query',
                    'end_date_gte': 'query',
                    'end_date_lte': 'query',
                },
                'collection_format_map': {}
            },
            headers_map={
                'accept': ['application/json'],
                'content_type': [],
            },
            api_client=api_client,
            callable=__get_dag_runs)

        def __get_dag_runs_batch(self, list_dag_runs_form, **kwargs):
            """List DAG runs (batch)  # noqa: E501

            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.   # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.get_dag_runs_batch(list_dag_runs_form, async_req=True)
            >>> result = thread.get()

            Args:
                list_dag_runs_form (ListDagRunsForm):

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                DAGRunCollection
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['list_dag_runs_form'] = \
                list_dag_runs_form
            return self.call_with_http_info(**kwargs)

        self.get_dag_runs_batch = _Endpoint(settings={
            'response_type': (DAGRunCollection, ),
            'auth': ['Basic', 'Kerberos'],
            'endpoint_path':
            '/dags/~/dagRuns/list',
            'operation_id':
            'get_dag_runs_batch',
            'http_method':
            'POST',
            'servers':
            None,
        },
                                            params_map={
                                                'all': [
                                                    'list_dag_runs_form',
                                                ],
                                                'required': [
                                                    'list_dag_runs_form',
                                                ],
                                                'nullable': [],
                                                'enum': [],
                                                'validation': []
                                            },
                                            root_map={
                                                'validations': {},
                                                'allowed_values': {},
                                                'openapi_types': {
                                                    'list_dag_runs_form':
                                                    (ListDagRunsForm, ),
                                                },
                                                'attribute_map': {},
                                                'location_map': {
                                                    'list_dag_runs_form':
                                                    'body',
                                                },
                                                'collection_format_map': {}
                                            },
                                            headers_map={
                                                'accept': ['application/json'],
                                                'content_type':
                                                ['application/json']
                                            },
                                            api_client=api_client,
                                            callable=__get_dag_runs_batch)

        def __post_dag_run(self, dag_id, dag_run, **kwargs):
            """Trigger a new DAG run  # noqa: E501

            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.post_dag_run(dag_id, dag_run, async_req=True)
            >>> result = thread.get()

            Args:
                dag_id (str): The DAG ID.
                dag_run (DAGRun):

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                DAGRun
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['dag_id'] = \
                dag_id
            kwargs['dag_run'] = \
                dag_run
            return self.call_with_http_info(**kwargs)

        self.post_dag_run = _Endpoint(settings={
            'response_type': (DAGRun, ),
            'auth': ['Basic', 'Kerberos'],
            'endpoint_path': '/dags/{dag_id}/dagRuns',
            'operation_id': 'post_dag_run',
            'http_method': 'POST',
            'servers': None,
        },
                                      params_map={
                                          'all': [
                                              'dag_id',
                                              'dag_run',
                                          ],
                                          'required': [
                                              'dag_id',
                                              'dag_run',
                                          ],
                                          'nullable': [],
                                          'enum': [],
                                          'validation': []
                                      },
                                      root_map={
                                          'validations': {},
                                          'allowed_values': {},
                                          'openapi_types': {
                                              'dag_id': (str, ),
                                              'dag_run': (DAGRun, ),
                                          },
                                          'attribute_map': {
                                              'dag_id': 'dag_id',
                                          },
                                          'location_map': {
                                              'dag_id': 'path',
                                              'dag_run': 'body',
                                          },
                                          'collection_format_map': {}
                                      },
                                      headers_map={
                                          'accept': ['application/json'],
                                          'content_type': ['application/json']
                                      },
                                      api_client=api_client,
                                      callable=__post_dag_run)
Exemplo n.º 7
0
    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

        def __get_xcom_entries(self, dag_id, dag_run_id, task_id, **kwargs):
            """List XCom entries  # noqa: E501

            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.  # noqa: E501
            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.get_xcom_entries(dag_id, dag_run_id, task_id, async_req=True)
            >>> result = thread.get()

            Args:
                dag_id (str): The DAG ID.
                dag_run_id (str): The DAG run ID.
                task_id (str): The task ID.

            Keyword Args:
                limit (int): The numbers of items to return.. [optional] if omitted the server will use the default value of 100
                offset (int): The number of items to skip before starting to collect the result set.. [optional]
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                XComCollection
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['dag_id'] = \
                dag_id
            kwargs['dag_run_id'] = \
                dag_run_id
            kwargs['task_id'] = \
                task_id
            return self.call_with_http_info(**kwargs)

        self.get_xcom_entries = _Endpoint(settings={
            'response_type': (XComCollection, ),
            'auth': ['Basic', 'Kerberos'],
            'endpoint_path':
            '/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries',
            'operation_id': 'get_xcom_entries',
            'http_method': 'GET',
            'servers': None,
        },
                                          params_map={
                                              'all': [
                                                  'dag_id',
                                                  'dag_run_id',
                                                  'task_id',
                                                  'limit',
                                                  'offset',
                                              ],
                                              'required': [
                                                  'dag_id',
                                                  'dag_run_id',
                                                  'task_id',
                                              ],
                                              'nullable': [],
                                              'enum': [],
                                              'validation': [
                                                  'offset',
                                              ]
                                          },
                                          root_map={
                                              'validations': {
                                                  ('offset', ): {
                                                      'inclusive_minimum': 0,
                                                  },
                                              },
                                              'allowed_values': {},
                                              'openapi_types': {
                                                  'dag_id': (str, ),
                                                  'dag_run_id': (str, ),
                                                  'task_id': (str, ),
                                                  'limit': (int, ),
                                                  'offset': (int, ),
                                              },
                                              'attribute_map': {
                                                  'dag_id': 'dag_id',
                                                  'dag_run_id': 'dag_run_id',
                                                  'task_id': 'task_id',
                                                  'limit': 'limit',
                                                  'offset': 'offset',
                                              },
                                              'location_map': {
                                                  'dag_id': 'path',
                                                  'dag_run_id': 'path',
                                                  'task_id': 'path',
                                                  'limit': 'query',
                                                  'offset': 'query',
                                              },
                                              'collection_format_map': {}
                                          },
                                          headers_map={
                                              'accept': ['application/json'],
                                              'content_type': [],
                                          },
                                          api_client=api_client,
                                          callable=__get_xcom_entries)

        def __get_xcom_entry(self, dag_id, dag_run_id, task_id, xcom_key,
                             **kwargs):
            """Get an XCom entry  # noqa: E501

            This method makes a synchronous HTTP request by default. To make an
            asynchronous HTTP request, please pass async_req=True

            >>> thread = api.get_xcom_entry(dag_id, dag_run_id, task_id, xcom_key, async_req=True)
            >>> result = thread.get()

            Args:
                dag_id (str): The DAG ID.
                dag_run_id (str): The DAG run ID.
                task_id (str): The task ID.
                xcom_key (str): The XCom key.

            Keyword Args:
                _return_http_data_only (bool): response data without head status
                    code and headers. Default is True.
                _preload_content (bool): if False, the urllib3.HTTPResponse object
                    will be returned without reading/decoding response data.
                    Default is True.
                _request_timeout (float/tuple): timeout setting for this request. If one
                    number provided, it will be total request timeout. It can also
                    be a pair (tuple) of (connection, read) timeouts.
                    Default is None.
                _check_input_type (bool): specifies if type checking
                    should be done one the data sent to the server.
                    Default is True.
                _check_return_type (bool): specifies if type checking
                    should be done one the data received from the server.
                    Default is True.
                _host_index (int/None): specifies the index of the server
                    that we want to use.
                    Default is read from the configuration.
                async_req (bool): execute request asynchronously

            Returns:
                XCom
                    If the method is called asynchronously, returns the request
                    thread.
            """
            kwargs['async_req'] = kwargs.get('async_req', False)
            kwargs['_return_http_data_only'] = kwargs.get(
                '_return_http_data_only', True)
            kwargs['_preload_content'] = kwargs.get('_preload_content', True)
            kwargs['_request_timeout'] = kwargs.get('_request_timeout', None)
            kwargs['_check_input_type'] = kwargs.get('_check_input_type', True)
            kwargs['_check_return_type'] = kwargs.get('_check_return_type',
                                                      True)
            kwargs['_host_index'] = kwargs.get('_host_index')
            kwargs['dag_id'] = \
                dag_id
            kwargs['dag_run_id'] = \
                dag_run_id
            kwargs['task_id'] = \
                task_id
            kwargs['xcom_key'] = \
                xcom_key
            return self.call_with_http_info(**kwargs)

        self.get_xcom_entry = _Endpoint(settings={
            'response_type': (XCom, ),
            'auth': ['Basic', 'Kerberos'],
            'endpoint_path':
            '/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}/xcomEntries/{xcom_key}',
            'operation_id': 'get_xcom_entry',
            'http_method': 'GET',
            'servers': None,
        },
                                        params_map={
                                            'all': [
                                                'dag_id',
                                                'dag_run_id',
                                                'task_id',
                                                'xcom_key',
                                            ],
                                            'required': [
                                                'dag_id',
                                                'dag_run_id',
                                                'task_id',
                                                'xcom_key',
                                            ],
                                            'nullable': [],
                                            'enum': [],
                                            'validation': []
                                        },
                                        root_map={
                                            'validations': {},
                                            'allowed_values': {},
                                            'openapi_types': {
                                                'dag_id': (str, ),
                                                'dag_run_id': (str, ),
                                                'task_id': (str, ),
                                                'xcom_key': (str, ),
                                            },
                                            'attribute_map': {
                                                'dag_id': 'dag_id',
                                                'dag_run_id': 'dag_run_id',
                                                'task_id': 'task_id',
                                                'xcom_key': 'xcom_key',
                                            },
                                            'location_map': {
                                                'dag_id': 'path',
                                                'dag_run_id': 'path',
                                                'task_id': 'path',
                                                'xcom_key': 'path',
                                            },
                                            'collection_format_map': {}
                                        },
                                        headers_map={
                                            'accept': ['application/json'],
                                            'content_type': [],
                                        },
                                        api_client=api_client,
                                        callable=__get_xcom_entry)