[lxc-devel] [pylxd/master] Add used_by to profile attributes
e1ee1e11 on Github
lxc-bot at linuxcontainers.org
Tue Jan 23 07:39:41 UTC 2018
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 469 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180123/217cd7c0/attachment.bin>
-------------- next part --------------
From 0441552252a91e3aabe845eec7d7739991229ace Mon Sep 17 00:00:00 2001
From: Oliver Cheng <e1ee1e11e1ee at gmail.com>
Date: Tue, 23 Jan 2018 15:16:40 +0800
Subject: [PATCH 1/2] Update profiles.rst
---
doc/source/profiles.rst | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/doc/source/profiles.rst b/doc/source/profiles.rst
index d1fde77..af72b2d 100644
--- a/doc/source/profiles.rst
+++ b/doc/source/profiles.rst
@@ -10,8 +10,8 @@ Manager methods
Profiles can be queried through the following client manager
methods:
- - `all()` - Retrieve all networks
- - `get()` - Get a specific network, by its name.
+ - `all()` - Retrieve all profiles
+ - `get()` - Get a specific profile, by its name.
- `create(name, config, devices)` - Create a new profile. The name of the
profile is required. `config` and `devices` dictionaries are optional,
and the scope of their contents is documented in the LXD documentation.
@@ -20,9 +20,11 @@ methods:
Profile attributes
------------------
- - `name` - The name of the network
- - `type` - The type of the network
- - `used_by` - A list of containers using this network
+ - `config` - config options for containers
+ - `description` - The description of the profile
+ - `devices` - device options for containers
+ - `name` - The name of the profile
+ - `used_by` - A list of containers using this profile
Profile methods
From 49ad4a833b2754f622ee5c97c3e65abf257d916f Mon Sep 17 00:00:00 2001
From: Oliver Cheng <e1ee1e11e1ee at gmail.com>
Date: Tue, 23 Jan 2018 15:21:12 +0800
Subject: [PATCH 2/2] Add used_by to profile attributes
Arrange attributes in alphabetical order
---
pylxd/models/profile.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/pylxd/models/profile.py b/pylxd/models/profile.py
index 13f01e7..e4b531b 100644
--- a/pylxd/models/profile.py
+++ b/pylxd/models/profile.py
@@ -17,10 +17,11 @@
class Profile(model.Model):
"""A LXD profile."""
- name = model.Attribute(readonly=True)
- description = model.Attribute()
config = model.Attribute()
+ description = model.Attribute()
devices = model.Attribute()
+ name = model.Attribute(readonly=True)
+ used_by = model.Attribute(readonly=True)
@classmethod
def exists(cls, client, name):
More information about the lxc-devel
mailing list