summaryrefslogtreecommitdiffstats
path: root/nova/virt/virtapi.py
blob: 5b0a31826040241feed853559b76c5a320a13334 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# vim: tabstop=4 shiftwidth=4 softtabstop=4

#    Copyright 2012 IBM Corp.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.


class VirtAPI(object):
    def instance_update(self, context, instance_uuid, updates):
        """Perform an instance update operation on behalf of a virt driver
        :param context: security context
        :param instance_uuid: uuid of the instance to be updated
        :param updates: dict of attribute=value pairs to change

        Returns: orig_instance, new_instance
        """
        raise NotImplementedError()

    def aggregate_get_by_host(self, context, host, key=None):
        """Get a list of aggregates to which the specified host belongs
        :param context: security context
        :param host: the host for which aggregates should be returned
        :param key: optionally filter by hosts with the given metadata key
        """
        raise NotImplementedError()

    def aggregate_metadata_add(self, context, aggregate, metadata,
                               set_delete=False):
        """Add/update metadata for specified aggregate
        :param context: security context
        :param aggregate: aggregate on which to update metadata
        :param metadata: dict of metadata to add/update
        :param set_delete: if True, only add
        """
        raise NotImplementedError()

    def aggregate_metadata_delete(self, context, aggregate, key):
        """Delete the given metadata key from specified aggregate
        :param context: security context
        :param aggregate: aggregate from which to delete metadata
        :param key: metadata key to delete
        """
        raise NotImplementedError()

    def security_group_get_by_instance(self, context, instance):
        """Get the security group for a specified instance
        :param context: security context
        :param instance: instance defining the security group we want
        """
        raise NotImplementedError()

    def security_group_rule_get_by_security_group(self, context,
                                                  security_group):
        """Get the rules associated with a specified security group
        :param context: security context
        :param security_group: the security group for which the rules
                               should be returned
        """
        raise NotImplementedError()

    def provider_fw_rule_get_all(self, context):
        """Get the provider firewall rules
        :param context: security context
        """
        raise NotImplementedError()

    def agent_build_get_by_triple(self, context, hypervisor, os, architecture):
        """Get information about the available agent builds for a given
        hypervisor, os, and architecture
        :param context: security context
        :param hypervisor: agent hypervisor type
        :param os: agent operating system type
        :param architecture: agent architecture
        """
        raise NotImplementedError()

    def instance_type_get(self, context, instance_type_id):
        """Get information about an instance type
        :param context: security context
        :param instance_type_id: the id of the instance type in question
        """
        raise NotImplementedError()