How to use the azure-devops.azext_devops.devops_sdk.v5_0.location.location_client.LocationClient function in azure-devops

To help you get started, we’ve selected a few azure-devops 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 Azure / azure-devops-cli-extension / azure-devops / azext_devops / devops_sdk / connection.py View on Github external
def _get_resource_areas(self, force=False):
        if self._resource_areas is None or force:
            location_client = LocationClient(self.base_url, self._creds)
            if self.use_fiddler:
                self._configure_client_for_fiddler(location_client)
            if not force and RESOURCE_FILE_CACHE[location_client.normalized_url]:
                try:
                    logger.debug('File cache hit for resources on: %s', location_client.normalized_url)
                    self._resource_areas = location_client._base_deserialize.deserialize_data(RESOURCE_FILE_CACHE[location_client.normalized_url],
                                                                                              '[ResourceAreaInfo]')
                    return self._resource_areas
                except Exception as ex:
                    logger.debug(ex, exc_info=True)
            elif not force:
                logger.debug('File cache miss for resources on: %s', location_client.normalized_url)
            self._resource_areas = location_client.get_resource_areas()
            if self._resource_areas is None:
                # For OnPrem environments we get an empty collection wrapper.
                self._resource_areas = []
github Azure / azure-devops-cli-extension / azure-devops / azext_devops / devops_sdk / connection.py View on Github external
def _get_deployment_resource_area_from_sps(self, resource_id):
        resource_id = resource_id.lower()
        if resource_id in _deployment_level_resource_areas:
            return _deployment_level_resource_areas[resource_id]
        location_client = LocationClient(sps_url, self._creds)
        if self.use_fiddler:
            self._configure_client_for_fiddler(location_client)
        resource_area = location_client.get_resource_area(area_id=resource_id)
        _deployment_level_resource_areas[resource_id] = resource_area
        return resource_area
github Azure / azure-devops-cli-extension / azure-devops / azext_devops / devops_sdk / v5_0 / location / location_client.py View on Github external
def __init__(self, base_url=None, creds=None):
        super(LocationClient, self).__init__(base_url, creds)
        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)

azure-devops

Python wrapper around the Azure DevOps 7.x APIs

MIT
Latest version published 1 year ago

Package Health Score

80 / 100
Full package analysis