def get_data(self, metrics, start_ts, end_ts=<NUM_LIT:0>, sampling_s=<NUM_LIT:0>,<EOL>filter='<STR_LIT>', datasource_type='<STR_LIT:host>', paging=None):
reqbody = {<EOL>'<STR_LIT>': metrics,<EOL>'<STR_LIT>': datasource_type,<EOL>}<EOL>if start_ts < <NUM_LIT:0>:<EOL><INDENT>reqbody['<STR_LIT>'] = -start_ts<EOL><DEDENT>elif start_ts == <NUM_LIT:0>:<EOL><INDENT>return [False, "<STR_LIT>"]<EOL><DEDENT>else:<EOL><INDENT>reqbody['<STR_LIT:start>'] = start_ts<EOL>reqbody['<STR_LIT:end>'] = end_ts<EOL><DEDENT>if filter != '<STR_LIT>':<EOL><INDENT>reqbody['<STR_LIT>'] = filter<EOL><DEDENT>if paging is not None:<EOL><INDENT>reqbody['<STR_LIT>'] = paging<EOL><DEDENT>if sampling_s != <NUM_LIT:0>:<EOL><INDENT>reqbody['<STR_LIT>'] = sampling_s<EOL><DEDENT>res = requests.post(self.url + '<STR_LIT>', headers=self.hdrs, data=json.dumps(reqbody), verify=self.ssl_verify)<EOL>return self._request_result(res)<EOL>
**Description**
            Export metric data (both time-series and table-based).

        **Arguments**
            - **metrics**: a list of dictionaries, specifying the metrics and grouping keys that the query will return. A metric is any of the entries that can be found in the *Metrics* section of the Explore page in Sysdig Monitor. Metric entries require an *aggregations* section specifying how to aggregate the metric across time and containers/hosts. A grouping key is any of the entries that can be found in the *Show* or *Segment By* sections of the Explore page in Sysdig Monitor. These entries are used to apply single or hierarchical segmentation to the returned data and don't require the aggregations section. Refer to the Example link below for ready-to-use code snippets.
            - **start_ts**: the UTC time (in seconds) of the beginning of the data window. A negative value can be optionally used to indicate a relative time in the past from now. For example, -3600 means "one hour ago".
            - **end_ts**: the UTC time (in seconds) of the end of the data window, or 0 to indicate "now". A negative value can also be optionally used to indicate a relative time in the past from now. For example, -3600 means "one hour ago".
            - **sampling_s**: the duration of the samples that will be returned. 0 means that the whole data will be returned as a single sample.
            - **filter**: a boolean expression combining Sysdig Monitor segmentation criteria that defines what the query will be applied to. For example: *kubernetes.namespace.name='production' and container.image='nginx'*.
            - **datasource_type**: specify the metric source for the request, can be ``container`` or ``host``. Most metrics, for example ``cpu.used.percent`` or ``memory.bytes.used``, are reported by both hosts and containers. By default, host metrics are used, but if the request contains a container-specific grouping key in the metric list/filter (e.g. ``container.name``), then the container source is used. In cases where grouping keys are missing or apply to both hosts and containers (e.g. ``tag.Name``), *datasource_type* can be explicitly set to avoid any ambiguity and allow the user to select precisely what kind of data should be used for the request. `examples/get_data_datasource.py <https://github.com/draios/python-sdc-client/blob/master/examples/get_data_datasource.py>`_ contains a few examples that should clarify the use of this argument.
            - **paging**: if segmentation of the query generates values for several different entities (e.g. containers/hosts), this parameter specifies which to include in the returned result. It's specified as a dictionary of inclusive values for ``from`` and ``to`` with the default being ``{ "from": 0, "to": 9 }``, which will return values for the "top 10" entities. The meaning of "top" is query-dependent, based on points having been sorted via the specified group aggregation, with the results sorted in ascending order if the group aggregation is ``min`` or ``none``, and descending order otherwise.

        **Success Return Value**
            A dictionary with the requested data. Data is organized in a list of time samples, each of which includes a UTC timestamp and a list of values, whose content and order reflect what was specified in the *metrics* argument.

        **Examples**
            - `examples/get_data_simple.py <https://github.com/draios/python-sdc-client/blob/master/examples/get_data_simple.py>`_
            - `examples/get_data_advanced.py <https://github.com/draios/python-sdc-client/blob/master/examples/get_data_advanced.py>`_
            - `examples/list_hosts.py <https://github.com/draios/python-sdc-client/blob/master/examples/list_hosts.py>`_
            - `examples/get_data_datasource.py <https://github.com/draios/python-sdc-client/blob/master/examples/get_data_datasource.py>`_