begin_unit
comment|'# Copyright (c) 2014 Red Hat, Inc.'
nl|'\n'
comment|'# All Rights Reserved.'
nl|'\n'
comment|'#'
nl|'\n'
comment|'#    Licensed under the Apache License, Version 2.0 (the "License"); you may'
nl|'\n'
comment|'#    not use this file except in compliance with the License. You may obtain'
nl|'\n'
comment|'#    a copy of the License at'
nl|'\n'
comment|'#'
nl|'\n'
comment|'#         http://www.apache.org/licenses/LICENSE-2.0'
nl|'\n'
comment|'#'
nl|'\n'
comment|'#    Unless required by applicable law or agreed to in writing, software'
nl|'\n'
comment|'#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT'
nl|'\n'
comment|'#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the'
nl|'\n'
comment|'#    License for the specific language governing permissions and limitations'
nl|'\n'
comment|'#    under the License.'
nl|'\n'
nl|'\n'
name|'from'
name|'nova'
op|'.'
name|'scheduler'
name|'import'
name|'rpcapi'
name|'as'
name|'scheduler_rpcapi'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|class|SchedulerQueryClient
name|'class'
name|'SchedulerQueryClient'
op|'('
name|'object'
op|')'
op|':'
newline|'\n'
indent|'    '
string|'"""Client class for querying to the scheduler."""'
newline|'\n'
nl|'\n'
DECL|member|__init__
name|'def'
name|'__init__'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'self'
op|'.'
name|'scheduler_rpcapi'
op|'='
name|'scheduler_rpcapi'
op|'.'
name|'SchedulerAPI'
op|'('
op|')'
newline|'\n'
nl|'\n'
DECL|member|select_destinations
dedent|''
name|'def'
name|'select_destinations'
op|'('
name|'self'
op|','
name|'context'
op|','
name|'spec_obj'
op|')'
op|':'
newline|'\n'
indent|'        '
string|'"""Returns destinations(s) best suited for this request_spec and\n        filter_properties.\n\n        The result should be a list of dicts with \'host\', \'nodename\' and\n        \'limits\' as keys.\n        """'
newline|'\n'
name|'return'
name|'self'
op|'.'
name|'scheduler_rpcapi'
op|'.'
name|'select_destinations'
op|'('
name|'context'
op|','
name|'spec_obj'
op|')'
newline|'\n'
nl|'\n'
DECL|member|update_aggregates
dedent|''
name|'def'
name|'update_aggregates'
op|'('
name|'self'
op|','
name|'context'
op|','
name|'aggregates'
op|')'
op|':'
newline|'\n'
indent|'        '
string|'"""Updates HostManager internal aggregates information.\n\n        :param aggregates: Aggregate(s) to update\n        :type aggregates: :class:`nova.objects.Aggregate`\n                          or :class:`nova.objects.AggregateList`\n        """'
newline|'\n'
name|'self'
op|'.'
name|'scheduler_rpcapi'
op|'.'
name|'update_aggregates'
op|'('
name|'context'
op|','
name|'aggregates'
op|')'
newline|'\n'
nl|'\n'
DECL|member|delete_aggregate
dedent|''
name|'def'
name|'delete_aggregate'
op|'('
name|'self'
op|','
name|'context'
op|','
name|'aggregate'
op|')'
op|':'
newline|'\n'
indent|'        '
string|'"""Deletes HostManager internal information about a specific aggregate.\n\n        :param aggregate: Aggregate to delete\n        :type aggregate: :class:`nova.objects.Aggregate`\n        """'
newline|'\n'
name|'self'
op|'.'
name|'scheduler_rpcapi'
op|'.'
name|'delete_aggregate'
op|'('
name|'context'
op|','
name|'aggregate'
op|')'
newline|'\n'
nl|'\n'
DECL|member|update_instance_info
dedent|''
name|'def'
name|'update_instance_info'
op|'('
name|'self'
op|','
name|'context'
op|','
name|'host_name'
op|','
name|'instance_info'
op|')'
op|':'
newline|'\n'
indent|'        '
string|'"""Updates the HostManager with the current information about the\n        instances on a host.\n\n        :param context: local context\n        :param host_name: name of host sending the update\n        :param instance_info: an InstanceList object.\n        """'
newline|'\n'
name|'self'
op|'.'
name|'scheduler_rpcapi'
op|'.'
name|'update_instance_info'
op|'('
name|'context'
op|','
name|'host_name'
op|','
nl|'\n'
name|'instance_info'
op|')'
newline|'\n'
nl|'\n'
DECL|member|delete_instance_info
dedent|''
name|'def'
name|'delete_instance_info'
op|'('
name|'self'
op|','
name|'context'
op|','
name|'host_name'
op|','
name|'instance_uuid'
op|')'
op|':'
newline|'\n'
indent|'        '
string|'"""Updates the HostManager with the current information about an\n        instance that has been deleted on a host.\n\n        :param context: local context\n        :param host_name: name of host sending the update\n        :param instance_uuid: the uuid of the deleted instance\n        """'
newline|'\n'
name|'self'
op|'.'
name|'scheduler_rpcapi'
op|'.'
name|'delete_instance_info'
op|'('
name|'context'
op|','
name|'host_name'
op|','
nl|'\n'
name|'instance_uuid'
op|')'
newline|'\n'
nl|'\n'
DECL|member|sync_instance_info
dedent|''
name|'def'
name|'sync_instance_info'
op|'('
name|'self'
op|','
name|'context'
op|','
name|'host_name'
op|','
name|'instance_uuids'
op|')'
op|':'
newline|'\n'
indent|'        '
string|'"""Notifies the HostManager of the current instances on a host by\n        sending a list of the uuids for those instances. The HostManager can\n        then compare that with its in-memory view of the instances to detect\n        when they are out of sync.\n\n        :param context: local context\n        :param host_name: name of host sending the update\n        :param instance_uuids: a list of UUID strings representing the current\n                               instances on the specified host\n        """'
newline|'\n'
name|'self'
op|'.'
name|'scheduler_rpcapi'
op|'.'
name|'sync_instance_info'
op|'('
name|'context'
op|','
name|'host_name'
op|','
nl|'\n'
name|'instance_uuids'
op|')'
newline|'\n'
dedent|''
dedent|''
endmarker|''
end_unit

begin_unit
comment|'# Copyright (c) 2014 Red Hat, Inc.'
nl|'\n'
comment|'# All Rights Reserved.'
nl|'\n'
comment|'#'
nl|'\n'
comment|'#    Licensed under the Apache License, Version 2.0 (the "License"); you may'
nl|'\n'
comment|'#    not use this file except in compliance with the License. You may obtain'
nl|'\n'
comment|'#    a copy of the License at'
nl|'\n'
comment|'#'
nl|'\n'
comment|'#         http://www.apache.org/licenses/LICENSE-2.0'
nl|'\n'
comment|'#'
nl|'\n'
comment|'#    Unless required by applicable law or agreed to in writing, software'
nl|'\n'
comment|'#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT'
nl|'\n'
comment|'#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the'
nl|'\n'
comment|'#    License for the specific language governing permissions and limitations'
nl|'\n'
comment|'#    under the License.'
nl|'\n'
nl|'\n'
name|'from'
name|'nova'
op|'.'
name|'scheduler'
name|'import'
name|'rpcapi'
name|'as'
name|'scheduler_rpcapi'
newline|'\n'
nl|'\n'
nl|'\n'
DECL|class|SchedulerQueryClient
name|'class'
name|'SchedulerQueryClient'
op|'('
name|'object'
op|')'
op|':'
newline|'\n'
indent|'    '
string|'"""Client class for querying to the scheduler."""'
newline|'\n'
nl|'\n'
DECL|member|__init__
name|'def'
name|'__init__'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|'        '
name|'self'
op|'.'
name|'scheduler_rpcapi'
op|'='
name|'scheduler_rpcapi'
op|'.'
name|'SchedulerAPI'
op|'('
op|')'
newline|'\n'
nl|'\n'
DECL|member|select_destinations
dedent|''
name|'def'
name|'select_destinations'
op|'('
name|'self'
op|','
name|'context'
op|','
name|'spec_obj'
op|')'
op|':'
newline|'\n'
indent|'        '
string|'"""Returns destinations(s) best suited for this request_spec and\n        filter_properties.\n\n        The result should be a list of dicts with \'host\', \'nodename\' and\n        \'limits\' as keys.\n        """'
newline|'\n'
name|'return'
name|'self'
op|'.'
name|'scheduler_rpcapi'
op|'.'
name|'select_destinations'
op|'('
name|'context'
op|','
name|'spec_obj'
op|')'
newline|'\n'
nl|'\n'
DECL|member|update_aggregates
dedent|''
name|'def'
name|'update_aggregates'
op|'('
name|'self'
op|','
name|'context'
op|','
name|'aggregates'
op|')'
op|':'
newline|'\n'
indent|'        '
string|'"""Updates HostManager internal aggregates information.\n\n        :param aggregates: Aggregate(s) to update\n        :type aggregates: :class:`nova.objects.Aggregate`\n                          or :class:`nova.objects.AggregateList`\n        """'
newline|'\n'
name|'self'
op|'.'
name|'scheduler_rpcapi'
op|'.'
name|'update_aggregates'
op|'('
name|'context'
op|','
name|'aggregates'
op|')'
newline|'\n'
nl|'\n'
DECL|member|delete_aggregate
dedent|''
name|'def'
name|'delete_aggregate'
op|'('
name|'self'
op|','
name|'context'
op|','
name|'aggregate'
op|')'
op|':'
newline|'\n'
indent|'        '
string|'"""Deletes HostManager internal information about a specific aggregate.\n\n        :param aggregate: Aggregate to delete\n        :type aggregate: :class:`nova.objects.Aggregate`\n        """'
newline|'\n'
name|'self'
op|'.'
name|'scheduler_rpcapi'
op|'.'
name|'delete_aggregate'
op|'('
name|'context'
op|','
name|'aggregate'
op|')'
newline|'\n'
nl|'\n'
DECL|member|update_instance_info
dedent|''
name|'def'
name|'update_instance_info'
op|'('
name|'self'
op|','
name|'context'
op|','
name|'host_name'
op|','
name|'instance_info'
op|')'
op|':'
newline|'\n'
indent|'        '
string|'"""Updates the HostManager with the current information about the\n        instances on a host.\n\n        :param context: local context\n        :param host_name: name of host sending the update\n        :param instance_info: an InstanceList object.\n        """'
newline|'\n'
name|'self'
op|'.'
name|'scheduler_rpcapi'
op|'.'
name|'update_instance_info'
op|'('
name|'context'
op|','
name|'host_name'
op|','
nl|'\n'
name|'instance_info'
op|')'
newline|'\n'
nl|'\n'
DECL|member|delete_instance_info
dedent|''
name|'def'
name|'delete_instance_info'
op|'('
name|'self'
op|','
name|'context'
op|','
name|'host_name'
op|','
name|'instance_uuid'
op|')'
op|':'
newline|'\n'
indent|'        '
string|'"""Updates the HostManager with the current information about an\n        instance that has been deleted on a host.\n\n        :param context: local context\n        :param host_name: name of host sending the update\n        :param instance_uuid: the uuid of the deleted instance\n        """'
newline|'\n'
name|'self'
op|'.'
name|'scheduler_rpcapi'
op|'.'
name|'delete_instance_info'
op|'('
name|'context'
op|','
name|'host_name'
op|','
nl|'\n'
name|'instance_uuid'
op|')'
newline|'\n'
nl|'\n'
DECL|member|sync_instance_info
dedent|''
name|'def'
name|'sync_instance_info'
op|'('
name|'self'
op|','
name|'context'
op|','
name|'host_name'
op|','
name|'instance_uuids'
op|')'
op|':'
newline|'\n'
indent|'        '
string|'"""Notifies the HostManager of the current instances on a host by\n        sending a list of the uuids for those instances. The HostManager can\n        then compare that with its in-memory view of the instances to detect\n        when they are out of sync.\n\n        :param context: local context\n        :param host_name: name of host sending the update\n        :param instance_uuids: a list of UUID strings representing the current\n                               instances on the specified host\n        """'
newline|'\n'
name|'self'
op|'.'
name|'scheduler_rpcapi'
op|'.'
name|'sync_instance_info'
op|'('
name|'context'
op|','
name|'host_name'
op|','
nl|'\n'
name|'instance_uuids'
op|')'
newline|'\n'
dedent|''
dedent|''
endmarker|''
end_unit

Client class for querying to the scheduler. Returns destinations(s) best suited for this request_spec and\n        filter_properties.\n\n        The result should be a list of dicts with \'host\', \'nodename\' and\n        \'limits\' as keys.\n Updates HostManager internal aggregates information.\n\n        :param aggregates: Aggregate(s) to update\n        :type aggregates: :class:`nova.objects.Aggregate`\n                          or :class:`nova.objects.AggregateList`\n Deletes HostManager internal information about a specific aggregate.\n\n        :param aggregate: Aggregate to delete\n        :type aggregate: :class:`nova.objects.Aggregate`\n Updates the HostManager with the current information about the\n        instances on a host.\n\n        :param context: local context\n        :param host_name: name of host sending the update\n        :param instance_info: an InstanceList object.\n Updates the HostManager with the current information about an\n        instance that has been deleted on a host.\n\n        :param context: local context\n        :param host_name: name of host sending the update\n        :param instance_uuid: the uuid of the deleted instance\n Notifies the HostManager of the current instances on a host by\n        sending a list of the uuids for those instances. The HostManager can\n        then compare that with its in-memory view of the instances to detect\n        when they are out of sync.\n\n        :param context: local context\n        :param host_name: name of host sending the update\n        :param instance_uuids: a list of UUID strings representing the current\n                               instances on the specified host\n