~ubuntu-branches/ubuntu/wily/heat/wily

« back to all changes in this revision

Viewing changes to heat/rpc/client.py

  • Committer: Package Import Robot
  • Author(s): Corey Bryant, Corey Bryant, James Page
  • Date: 2015-07-07 17:06:19 UTC
  • mfrom: (1.1.26) (45.1.1 vivid-proposed)
  • Revision ID: package-import@ubuntu.com-20150707170619-hra2dbjpfofpou4s
Tags: 1:5.0.0~b1-0ubuntu1
[ Corey Bryant ]
* New upstream milestone for OpenStack Liberty:
  - d/control: Align (build-)depends with upstream.
  - d/p/fix-requirements.patch: Rebased.
  - d/p/sudoers_patch.patch: Rebased.

[ James Page ]
* d/s/options: Ignore any removal of egg-info data during package clean.
* d/control: Drop MySQL and PostgreSQL related BD's, not required for unit
  testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
        1.0 - Initial version.
30
30
        1.1 - Add support_status argument to list_resource_types()
31
31
        1.4 - Add support for service list
 
32
        1.9 - Add template_type option to generate_template()
32
33
    '''
33
34
 
34
35
    BASE_RPC_API_VERSION = '1.0'
91
92
 
92
93
    def list_stacks(self, ctxt, limit=None, marker=None, sort_keys=None,
93
94
                    sort_dir=None, filters=None, tenant_safe=True,
94
 
                    show_deleted=False, show_nested=False):
 
95
                    show_deleted=False, show_nested=False, show_hidden=False,
 
96
                    tags=None, tags_any=None, not_tags=None,
 
97
                    not_tags_any=None):
95
98
        """
96
99
        The list_stacks method returns attributes of all stacks.  It supports
97
100
        pagination (``limit`` and ``marker``), sorting (``sort_keys`` and
106
109
        :param tenant_safe: if true, scope the request by the current tenant
107
110
        :param show_deleted: if true, show soft-deleted stacks
108
111
        :param show_nested: if true, show nested stacks
 
112
        :param show_hidden: if true, show hidden stacks
 
113
        :param tags: show stacks containing these tags, combine multiple
 
114
            tags using the boolean AND expression
 
115
        :param tags_any: show stacks containing these tags, combine multiple
 
116
            tags using the boolean OR expression
 
117
        :param not_tags: show stacks not containing these tags, combine
 
118
            multiple tags using the boolean AND expression
 
119
        :param not_tags_any: show stacks not containing these tags, combine
 
120
            multiple tags using the boolean OR expression
109
121
        :returns: a list of stacks
110
122
        """
111
123
        return self.call(ctxt,
114
126
                                       sort_dir=sort_dir, filters=filters,
115
127
                                       tenant_safe=tenant_safe,
116
128
                                       show_deleted=show_deleted,
117
 
                                       show_nested=show_nested))
 
129
                                       show_nested=show_nested,
 
130
                                       show_hidden=show_hidden,
 
131
                                       tags=tags, tags_any=tags_any,
 
132
                                       not_tags=not_tags,
 
133
                                       not_tags_any=not_tags_any),
 
134
                         version='1.8')
118
135
 
119
136
    def count_stacks(self, ctxt, filters=None, tenant_safe=True,
120
 
                     show_deleted=False, show_nested=False):
 
137
                     show_deleted=False, show_nested=False, show_hidden=False,
 
138
                     tags=None, tags_any=None, not_tags=None,
 
139
                     not_tags_any=None):
121
140
        """
122
141
        Return the number of stacks that match the given filters
123
142
        :param ctxt: RPC context.
125
144
        :param tenant_safe: if true, scope the request by the current tenant
126
145
        :param show_deleted: if true, count will include the deleted stacks
127
146
        :param show_nested: if true, count will include nested stacks
 
147
        :param show_hidden: if true, count will include hidden stacks
 
148
        :param tags: count stacks containing these tags, combine multiple tags
 
149
            using the boolean AND expression
 
150
        :param tags_any: count stacks containing these tags, combine multiple
 
151
            tags using the boolean OR expression
 
152
        :param not_tags: count stacks not containing these tags, combine
 
153
            multiple tags using the boolean AND expression
 
154
        :param not_tags_any: count stacks not containing these tags, combine
 
155
            multiple tags using the boolean OR expression
128
156
        :returns: a integer representing the number of matched stacks
129
157
        """
130
158
        return self.call(ctxt, self.make_msg('count_stacks',
131
159
                                             filters=filters,
132
160
                                             tenant_safe=tenant_safe,
133
161
                                             show_deleted=show_deleted,
134
 
                                             show_nested=show_nested))
 
162
                                             show_nested=show_nested,
 
163
                                             show_hidden=show_hidden,
 
164
                                             tags=tags,
 
165
                                             tags_any=tags_any,
 
166
                                             not_tags=not_tags,
 
167
                                             not_tags_any=not_tags_any),
 
168
                         version='1.8')
135
169
 
136
170
    def show_stack(self, ctxt, stack_identity):
137
171
        """
201
235
                                user_creds_id=user_creds_id,
202
236
                                stack_user_project_id=stack_user_project_id,
203
237
                                parent_resource_name=parent_resource_name),
204
 
            version='1.7')
 
238
            version='1.8')
205
239
 
206
240
    def update_stack(self, ctxt, stack_identity, template, params,
207
241
                     files, args):
301
335
        return self.call(ctxt, self.make_msg('resource_schema',
302
336
                                             type_name=type_name))
303
337
 
304
 
    def generate_template(self, ctxt, type_name):
 
338
    def generate_template(self, ctxt, type_name, template_type='cfn'):
305
339
        """
306
340
        Generate a template based on the specified type.
307
341
 
308
342
        :param ctxt: RPC context.
309
343
        :param type_name: The resource type name to generate a template for.
 
344
        :param template_type: the template type to generate, cfn or hot.
310
345
        """
311
346
        return self.call(ctxt, self.make_msg('generate_template',
312
 
                                             type_name=type_name))
 
347
                                             type_name=type_name,
 
348
                                             template_type=template_type),
 
349
                         version='1.9')
313
350
 
314
351
    def list_events(self, ctxt, stack_identity, filters=None, limit=None,
315
352
                    marker=None, sort_keys=None, sort_dir=None,):
400
437
        return self.call(ctxt, self.make_msg('stack_cancel_update',
401
438
                                             stack_identity=stack_identity))
402
439
 
403
 
    def metadata_update(self, ctxt, stack_identity, resource_name, metadata):
404
 
        """
405
 
        Update the metadata for the given resource.
406
 
        """
407
 
        return self.call(ctxt, self.make_msg('metadata_update',
408
 
                                             stack_identity=stack_identity,
409
 
                                             resource_name=resource_name,
410
 
                                             metadata=metadata))
411
 
 
412
440
    def resource_signal(self, ctxt, stack_identity, resource_name, details,
413
441
                        sync_call=False):
414
442
        """