~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/interfaces/processor.py

  • Committer: Colin Watson
  • Date: 2011-08-19 00:25:11 UTC
  • mfrom: (7675.1045.728 db-devel)
  • mto: This revision was merged to the branch mainline in revision 13909.
  • Revision ID: cjwatson@canonical.com-20110819002511-0x8hrqs1ckiqk53g
merge db-devel

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
    'IProcessor',
12
12
    'IProcessorFamily',
13
13
    'IProcessorFamilySet',
 
14
    'IProcessorSet',
 
15
    'ProcessorNotFound',
14
16
    ]
15
17
 
16
18
from zope.interface import (
38
40
    CollectionField,
39
41
    Reference,
40
42
    )
 
43
from lp.app.errors import NameLookupFailed
 
44
 
 
45
 
 
46
class ProcessorNotFound(NameLookupFailed):
 
47
    """Exception raised when a processor name isn't found."""
 
48
    _message_prefix = 'No such processor'
41
49
 
42
50
 
43
51
class IProcessor(Interface):
49
57
    # the WADL generation work it must be back-dated to the earliest version.
50
58
    # Note that individual attributes and methods can and must truthfully set
51
59
    # 'devel' as their version.
52
 
    export_as_webservice_entry(publish_web_link=True, as_of='beta')
 
60
    export_as_webservice_entry(publish_web_link=False, as_of='beta')
53
61
    id = Attribute("The Processor ID")
54
62
    family = exported(
55
63
        Reference(
84
92
    # 'devel' as their version.
85
93
    export_as_webservice_entry(
86
94
        plural_name='processor_families',
87
 
        publish_web_link=True,
 
95
        publish_web_link=False,
88
96
        as_of='beta')
89
97
 
90
98
    id = Attribute("The ProcessorFamily ID")
123
131
        """
124
132
 
125
133
 
 
134
class IProcessorSet(Interface):
 
135
    """Operations related to Processor instances."""
 
136
    export_as_webservice_collection(IProcessor)
 
137
 
 
138
    @operation_parameters(
 
139
        name=TextLine(required=True))
 
140
    @operation_returns_entry(IProcessor)
 
141
    @export_read_operation()
 
142
    @operation_for_version('devel')
 
143
    def getByName(name):
 
144
        """Return the IProcessor instance with the matching name.
 
145
 
 
146
        :param name: The name to look for.
 
147
        :raise ProcessorNotFound: if there is no processor with that name.
 
148
        :return: A `IProcessor` instance if found
 
149
        """
 
150
 
 
151
    @collection_default_content()
 
152
    def getAll():
 
153
        """Return all the `IProcessor` known to Launchpad."""
 
154
 
 
155
 
126
156
class IProcessorFamilySet(Interface):
127
157
    """Operations related to ProcessorFamily instances."""
128
158
 
129
 
    export_as_webservice_collection(Interface)
 
159
    export_as_webservice_collection(IProcessorFamily)
130
160
 
131
161
    @operation_parameters(
132
162
        name=TextLine(required=True))
133
 
    @operation_returns_entry(Interface)
 
163
    @operation_returns_entry(IProcessorFamily)
134
164
    @export_read_operation()
135
165
    @operation_for_version('devel')
136
166
    def getByName(name):