~andrewjbeach/juju-ci-tools/get-juju-dict

« back to all changes in this revision

Viewing changes to substrate.py

  • Committer: Martin Packman
  • Date: 2016-09-22 13:55:21 UTC
  • mfrom: (1612.1.1 maas_substrate_spaces)
  • Revision ID: martin.packman@canonical.com-20160922135521-s4jogh82i6dkicw6
Add spaces management methods to maas substrate

Show diffs side-by-side

added added

removed removed

Lines of Context:
502
502
        """Delete a fabric with given id."""
503
503
        return self._maas(self.profile, 'fabric', 'delete', str(fabric_id))
504
504
 
 
505
    def spaces(self):
 
506
        """Return list of all spaces."""
 
507
        return self._maas(self.profile, 'spaces', 'read')
 
508
 
 
509
    def create_space(self, name):
 
510
        """Create a new space with given name."""
 
511
        return self._maas(self.profile, 'spaces', 'create', 'name=' + name)
 
512
 
 
513
    def delete_space(self, space_id):
 
514
        """Delete a space with given id."""
 
515
        return self._maas(self.profile, 'space', 'delete', str(space_id))
 
516
 
505
517
 
506
518
class MAAS1Account(MAASAccount):
507
519
    """Represent a MAAS 1.X account."""