def get_regions(self):
        """
        Get list of available service bus regions.
        """
        response = self._perform_get(self._get_path("services/serviceBus/Regions/", None), None)

        return _MinidomXmlToObject.convert_response_to_feeds(response, _ServiceBusManagementXmlSerializer.xml_to_region)
    def get_metrics_data_relay(self, name, relay_name, metric, rollup,
                               filter_expresssion):
        '''
        Retrieves the list of supported metrics for this namespace and relay

        name:
            Name of the service bus namespace.
        relay_name:
            Name of the service bus relay in this namespace.
        metric:
            name of a supported metric
        rollup:
            name of a supported rollup
        filter_expression:
            filter, for instance "$filter=Timestamp gt datetime'2014-10-01T00:00:00Z'"
        '''
        response = self._perform_get(
            self._get_get_metrics_data_relay_path(name, relay_name, metric,
                                                  rollup, filter_expresssion),
            None)

        return _MinidomXmlToObject.convert_response_to_feeds(
            response,
            partial(_ServiceBusManagementXmlSerializer.xml_to_metrics,
                    object_type=MetricValues))
    def get_metrics_data_relay(self, name, relay_name, metric, rollup, filter_expresssion):
        '''
        Retrieves the list of supported metrics for this namespace and relay

        name:
            Name of the service bus namespace.
        relay_name:
            Name of the service bus relay in this namespace.
        metric:
            name of a supported metric
        rollup:
            name of a supported rollup
        filter_expression:
            filter, for instance "$filter=Timestamp gt datetime'2014-10-01T00:00:00Z'"
        '''
        response = self._perform_get(
            self._get_get_metrics_data_relay_path(name, relay_name, metric, rollup, filter_expresssion),
            None)

        return _MinidomXmlToObject.convert_response_to_feeds(
            response,
            partial(
                _ServiceBusManagementXmlSerializer.xml_to_metrics,
                object_type=MetricValues
            )
        )
    def list_namespaces(self):
        '''
        List the service bus namespaces defined on the account.
        '''
        response = self._perform_get(
            self._get_path('services/serviceBus/Namespaces/', None), None)

        return _MinidomXmlToObject.convert_response_to_feeds(
            response, _ServiceBusManagementXmlSerializer.xml_to_namespace)
    def get_regions(self):
        '''
        Get list of available service bus regions.
        '''
        response = self._perform_get(
            self._get_path('services/serviceBus/Regions/', None), None)

        return _MinidomXmlToObject.convert_response_to_feeds(
            response, _ServiceBusManagementXmlSerializer.xml_to_region)
    def list_namespaces(self):
        """
        List the service bus namespaces defined on the account.
        """
        response = self._perform_get(self._get_path("services/serviceBus/Namespaces/", None), None)

        return _MinidomXmlToObject.convert_response_to_feeds(
            response, _ServiceBusManagementXmlSerializer.xml_to_namespace
        )
    def list_relays(self, name):
        """
        Retrieves the relays in the service namespace.

        name:
            Name of the service bus namespace.
        """
        response = self._perform_get(self._get_list_relays_path(name), None)

        return _MinidomXmlToObject.convert_response_to_feeds(
            response, partial(_MinidomXmlToObject.convert_xml_to_azure_object, azure_type=RelayDescription)
        )
    def list_relays(self, name):
        '''
        Retrieves the relays in the service namespace.

        name:
            Name of the service bus namespace.
        '''
        response = self._perform_get(self._get_list_relays_path(name), None)

        return _MinidomXmlToObject.convert_response_to_feeds(
            response,
            partial(_MinidomXmlToObject.convert_xml_to_azure_object,
                    azure_type=RelayDescription))
    def get_supported_metrics_relay(self, name, relay_name):
        """
        Retrieves the list of supported metrics for this namespace and relay

        name:
            Name of the service bus namespace.
        relay_name:
            Name of the service bus relay in this namespace.
        """
        response = self._perform_get(self._get_get_supported_metrics_relay_path(name, relay_name), None)

        return _MinidomXmlToObject.convert_response_to_feeds(
            response, partial(_ServiceBusManagementXmlSerializer.xml_to_metrics, object_type=MetricProperties)
        )
    def list_queues(self, name):
        """
        Enumerates the queues in the service namespace.

        name:
            Name of the service bus namespace.
        """
        _validate_not_none("name", name)

        response = self._perform_get(self._get_list_queues_path(name), None)

        return _MinidomXmlToObject.convert_response_to_feeds(
            response, partial(_MinidomXmlToObject.convert_xml_to_azure_object, azure_type=QueueDescription)
        )
    def list_queues(self, name):
        '''
        Enumerates the queues in the service namespace.

        name:
            Name of the service bus namespace.
        '''
        _validate_not_none('name', name)

        response = self._perform_get(self._get_list_queues_path(name), None)

        return _MinidomXmlToObject.convert_response_to_feeds(
            response,
            partial(_MinidomXmlToObject.convert_xml_to_azure_object,
                    azure_type=QueueDescription))
    def get_supported_metrics_relay(self, name, relay_name):
        '''
        Retrieves the list of supported metrics for this namespace and relay

        name:
            Name of the service bus namespace.
        relay_name:
            Name of the service bus relay in this namespace.
        '''
        response = self._perform_get(
            self._get_get_supported_metrics_relay_path(name, relay_name), None)

        return _MinidomXmlToObject.convert_response_to_feeds(
            response,
            partial(_ServiceBusManagementXmlSerializer.xml_to_metrics,
                    object_type=MetricProperties))
    def get_metrics_rollups_relay(self, name, relay_name, metric):
        """
        This operation gets rollup data for Service Bus metrics relay.
        Rollup data includes the time granularity for the telemetry aggregation as well as
        the retention settings for each time granularity.

        name:
            Name of the service bus namespace.
        relay_name:
            Name of the service bus relay in this namespace.
        metric:
            name of a supported metric
        """
        response = self._perform_get(self._get_get_metrics_rollup_relay_path(name, relay_name, metric), None)

        return _MinidomXmlToObject.convert_response_to_feeds(
            response, partial(_ServiceBusManagementXmlSerializer.xml_to_metrics, object_type=MetricRollups)
        )
    def list_notification_hubs(self, name):
        '''
        Retrieves the notification hubs in the service namespace.

        name:
            Name of the service bus namespace.
        '''
        response = self._perform_get(
            self._get_list_notification_hubs_path(name),
            None)

        return _MinidomXmlToObject.convert_response_to_feeds(
            response,
            partial(
                _MinidomXmlToObject.convert_xml_to_azure_object,
                azure_type=NotificationHubDescription
            )
        )
    def get_supported_metrics_notification_hub(self, name, hub_name):
        '''
        Retrieves the list of supported metrics for this namespace and topic

        name:
            Name of the service bus namespace.
        hub_name:
            Name of the service bus notification hub in this namespace.
        '''
        response = self._perform_get(
            self._get_get_supported_metrics_hub_path(name, hub_name),
            None)

        return _MinidomXmlToObject.convert_response_to_feeds(
            response,
            partial(
                _ServiceBusManagementXmlSerializer.xml_to_metrics,
                object_type=MetricProperties
            )
        )
    def get_metrics_rollups_relay(self, name, relay_name, metric):
        '''
        This operation gets rollup data for Service Bus metrics relay.
        Rollup data includes the time granularity for the telemetry aggregation as well as
        the retention settings for each time granularity.

        name:
            Name of the service bus namespace.
        relay_name:
            Name of the service bus relay in this namespace.
        metric:
            name of a supported metric
        '''
        response = self._perform_get(
            self._get_get_metrics_rollup_relay_path(name, relay_name, metric),
            None)

        return _MinidomXmlToObject.convert_response_to_feeds(
            response,
            partial(_ServiceBusManagementXmlSerializer.xml_to_metrics,
                    object_type=MetricRollups))