コード例 #1
0
 def list_databases(self, name):
     '''
     List the SQL databases defined on the specified server name
     '''
     response = self._perform_get(self._get_list_databases_path(name), None)
     return _MinidomXmlToObject.parse_service_resources_response(
         response, Database)
コード例 #2
0
    def get_server_event_logs(self, server_name, start_date,
                              interval_size_in_minutes, event_types=''):
        '''
        Gets the event logs for an Azure SQL Database Server.

        server_name:
            Name of the server to retrieve the event logs from.
        start_date:
            The starting date and time of the events to retrieve in UTC format,
            for example '2011-09-28 16:05:00'.
        interval_size_in_minutes:
            Size of the event logs to retrieve (in minutes).
            Valid values are: 5, 60, or 1440.
        event_types:
            The event type of the log entries you want to retrieve.
            Valid values are: 
                - connection_successful
                - connection_failed
                - connection_terminated
                - deadlock
                - throttling
                - throttling_long_transaction
            To return all event types pass in an empty string.
        '''
        _validate_not_none('server_name', server_name)
        _validate_not_none('start_date', start_date)
        _validate_not_none('interval_size_in_minutes', interval_size_in_minutes)
        _validate_not_none('event_types', event_types)
        path = self._get_server_event_logs_path(server_name) + \
               '?startDate={0}&intervalSizeInMinutes={1}&eventTypes={2}'.format(
            start_date, interval_size_in_minutes, event_types)
        response = self._perform_get(path, None)
        return _MinidomXmlToObject.parse_service_resources_response(
            response, EventLog)
コード例 #3
0
 def list_databases(self, name):
     '''
     List the SQL databases defined on the specified server name
     '''
     response = self._perform_get(self._get_list_databases_path(name),
                                  None)
     return _MinidomXmlToObject.parse_service_resources_response(
         response, Database)
コード例 #4
0
    def list_quotas(self, server_name):
        '''
        Gets quotas for an Azure SQL Database Server.

        server_name:
            Name of the server.
        '''
        _validate_not_none('server_name', server_name)
        response = self._perform_get(self._get_quotas_path(server_name), None)
        return _MinidomXmlToObject.parse_service_resources_response(
            response, ServerQuota)
コード例 #5
0
    def list_firewall_rules(self, server_name):
        '''
        Retrieves the set of firewall rules for an Azure SQL Database Server.

        server_name:
            Name of the server.
        '''
        _validate_not_none('server_name', server_name)
        response = self._perform_get(
            self._get_firewall_rules_path(server_name), None)
        return _MinidomXmlToObject.parse_service_resources_response(
            response, FirewallRule)
コード例 #6
0
    def list_service_level_objectives(self, server_name):
        '''
        Gets the service level objectives for an Azure SQL Database server.

        server_name:
            Name of the server.
        '''
        _validate_not_none('server_name', server_name)
        response = self._perform_get(
            self._get_service_objectives_path(server_name), None)
        return _MinidomXmlToObject.parse_service_resources_response(
            response, ServiceObjective)
コード例 #7
0
    def list_firewall_rules(self, server_name):
        '''
        Retrieves the set of firewall rules for an Azure SQL Database Server.

        server_name:
            Name of the server.
        '''
        _validate_not_none('server_name', server_name)
        response = self._perform_get(self._get_firewall_rules_path(server_name),
                                     None)
        return _MinidomXmlToObject.parse_service_resources_response(
            response, FirewallRule)
コード例 #8
0
    def get_server_event_logs(self,
                              server_name,
                              start_date,
                              interval_size_in_minutes,
                              event_types=''):
        '''
        Gets the event logs for an Azure SQL Database Server.

        server_name:
            Name of the server to retrieve the event logs from.
        start_date:
            The starting date and time of the events to retrieve in UTC format,
            for example '2011-09-28 16:05:00'.
        interval_size_in_minutes:
            Size of the event logs to retrieve (in minutes).
            Valid values are: 5, 60, or 1440.
        event_types:
            The event type of the log entries you want to retrieve.
            Valid values are: 
                - connection_successful
                - connection_failed
                - connection_terminated
                - deadlock
                - throttling
                - throttling_long_transaction
            To return all event types pass in an empty string.
        '''
        _validate_not_none('server_name', server_name)
        _validate_not_none('start_date', start_date)
        _validate_not_none('interval_size_in_minutes',
                           interval_size_in_minutes)
        _validate_not_none('event_types', event_types)
        path = self._get_server_event_logs_path(server_name) + \
               '?startDate={0}&intervalSizeInMinutes={1}&eventTypes={2}'.format(
            start_date, interval_size_in_minutes, event_types)
        response = self._perform_get(path, None)
        return _MinidomXmlToObject.parse_service_resources_response(
            response, EventLog)