How to use the atlasapi.lib.AtlasGranularities function in atlasapi

To help you get started, we’ve selected a few atlasapi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mgmonteleone / python-atlasapi / atlasapi / specs.py View on Github external
    def get_measurement_for_host(self, granularity: AtlasGranularities = AtlasGranularities.HOUR,
                                 period: AtlasPeriods = AtlasPeriods.WEEKS_1,
                                 measurement: AtlasMeasurementTypes = AtlasMeasurementTypes.Cache.dirty,
                                 pageNum: int = Settings.pageNum,
                                 itemsPerPage: int = Settings.itemsPerPage,
                                 iterable: bool = True) -> Union[dict, Iterable[AtlasMeasurement]]:
        """Get  measurement(s) for a host

        Returns measurements for the Host object.

        url: https://docs.atlas.mongodb.com/reference/api/process-measurements/


        Accepts either a single measurement, but will retrieve more than one measurement
        if the measurement (using the AtlasMeasurementTypes class)

        /api/atlas/v1.0/groups/{GROUP-ID}/processes/{HOST}:{PORT}/measurements
github mgmonteleone / python-atlasapi / atlasapi / atlas.py View on Github external
        def _get_measurement_for_host(self, host_obj: Host, granularity: AtlasGranularities = AtlasGranularities.HOUR,
                                      period: AtlasPeriods = AtlasPeriods.WEEKS_1,
                                      measurement: AtlasMeasurementTypes = AtlasMeasurementTypes.Cache.dirty,
                                      pageNum: int = Settings.pageNum,
                                      itemsPerPage: int = Settings.itemsPerPage,
                                      iterable: bool = True) -> Union[dict, Iterable[AtlasMeasurement]]:
            """Get  measurement(s) for a host

            Internal use only, should come from the host obj itself.

            Returns measurements for the passed Host object.

            url: https://docs.atlas.mongodb.com/reference/api/process-measurements/


            Accepts either a single measurement, but will retrieve more than one measurement
            if the measurement (using the AtlasMeasurementTypes class)